TApPageSetupDialog

Inherited from : TCommonDialog

Unit: ApPageSetupDlg

Custom version: TApCustomPageSetupDialog.

Wrapper for PageSetupDlg Win32 function.

Types

Properties

Methods

Events



Types


TApRect = class(TPersistent)
published
property Left : integer;
property Top : integer;
property Right : integer;
property Bottom : integer;

TApRect class is simply wrapper for TRect type. It's used to set TRect's members using Object Inspector.


TApPoint = class(TPersistent)
published
property X;
property Y;
end;

TApPoint class is simply wrapper for TPoint type. It's used to set TPoint''s members using Object Inspector.


 



Properties


PaperSize : TApPoint

Public, Protected in custom version

Specifies the dimensions of the paper selected by the user. The MeasureUnits property indicates the units of measurement.


MeasureUnits : TApMeasureUnit

Specifies the measure units used in the dialog for PaperSize, MinMargin and Margin properties. Possible values:

muMillimeters - Indicates that hundredths of millimeters are the unit of measurement;
muInches - ndicates that thousandths of inches are the unit of measurement;
muLocale - default unit of measurement for the user's locale.


Margins : TApRect

Specifies the widths of the left, top, right, and bottom margins. If you set the psMargins flag in the Options property , Margins specifies the initial margin values. When Execute membe function returns, Margins contains the margin widths selected by the user. The MeasureUnits property indicates the units of measurement.


MinMargins : TApRect

Specifies the minimum allowable widths for the left, top, right, and bottom margins. The system ignores this member if the psMinMargins flag is not set in the Options property. These values must be less than or equal to the values specified in the rtMargin member.. The MeasureUnits property indicates the units of measurement.


Options : TApPageSetupOptions
TApPageSetupOptions = set of TApPageSetupOption

Page setup dialog options:

psDisableMargins - Disables the margin controls, preventing the user from setting the margins.

psDisableOrientation - Disables the orientation controls, preventing the user from setting the page orientation.

psDisablePaper - Disables the paper controls, preventing the user from setting page parameters such as the paper size and source.

psDisablePrinter - Disables the Printer button, preventing the user from invoking a dialog box that contains additional printer setup information.

psMargins - Causes the system to use the values specified in the Margins property as the initial widths for the left, top, right, and bottom margins. If this flag is not set, the system sets the initial widths to one inch for all margins.

psMinMargins - Causes the system to use the values specified in the MinMargins property as the minimum allowable widths for the left, top, right, and bottom margins. The system prevents the user from entering a width that is less than the specified minimum. If this flag is not specified, the system sets the minimum allowable widths to those allowed by the printer.

psNoWarning - Prevents the system from displaying a warning message when there is no default printer.

psShowHelp - Causes the dialog box to display the Help button. The owner of the dialog receives the HELPMSGSTRING registered messages that the dialog box sends when the user clicks the Help button.

psDisablePagePainting - Prevents the dialog box from drawing the contents of the sample page.


Orientation : TPrinterOrientation

TPrinterOrientation is defined in the printer module.

Specifies the paper orientation.


CustDlgParams : TApCustDlgParams

Published, Protected in custom version

This variable contains all information about panels of the standard dialog. See TApCustDlgParams type for details.

For page setup dialogs CustDlgParams.CustomForm[Name] member is not used.


DlgItemsCaptions : TApPrintDlgCaptions

Published; protected in custom version

You can set items in this property to replace labels for standard controls inside dialog. For example you can replace OK button caption using DlgItemsCaptions.OK property and so on. If there is no value in any subitem then original text is displayed.


Title : string

Published; protected in custom version

The title of the dialog



Methods


function Execute : boolean; override;

Executes the dialog.



Events


For all handlers: Published; Protected in custom version.


OnPageDraw : TApDrawPageEvent;

TApDrawPageEvent = procedure (Sender : TObject; RectType : TApPageRectType; Canvas : TCanvas; Rect : TRect) of object;

TApPageRectType = (rtFullPage, rtMinMargin, rtMargin,
rtGreekText, rtEnvStamp, rtYAFullPage);

Occurs when the system needs to redraw the page image in the dialog box.

RectType - specifies the part of the image need to be drawn:
rtFullPage - The dialog box is about to draw the sample page. This message specifies the bounding rectangle of the sample page.
        rtMinMargin - The dialog box is about to draw the sample page. This message specifies the margin rectangle.
        rtMargin - The dialog box is about to draw the margin rectangle.
        rtGreekText - The dialog box is about to draw the greek text inside the margin rectangle.
        rtEnvStamp - The dialog box is about to draw in the envelope-stamp rectangle of an envelope sample page. This message is sent for envelopes only.
        rtYAFullPage - The dialog box is about to draw the return address portion of an envelope sample page. This message is sent for envelopes and other paper sizes.

Canvas - drawing surface.
Rect - Rectangle.


OnPrinterShowing : TApCtrlQueryEvent;

Occurs when user tries to change current printer using "Printer..." button. Set AllowProceed to false to prevent printer selection dialog's  showing.


OnCanClose : TCloseQueryEvent

Occurs when you the user tries to close the dialog box using OK button.


OnEventHook : TWndMethod

General hook procedure. You can hook any message you want directry in this handler. This handler occurs after dialog procedure has processed current message.


OnEventHooking : TApMsgQueryEvent

You can determine here whether dialog box procedure should process current message (m parameter).  Set AllowDispatch to false to prevent this message's processing by dialog box procedure.