[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Widgetset-independent implementation of a prompt dialog.
Source position: dialogs.pp line 716
function DefaultPromptDialog( |
const DialogCaption: string; |
const DialogMessage: string; |
DialogType: LongInt; |
Buttons: PLongint; |
ButtonCount: LongInt; |
DefaultIndex: LongInt; |
EscapeResult: LongInt; |
UseDefaultPos: Boolean; |
X: LongInt; |
Y: LongInt |
):LongInt; |
DialogCaption |
|
Caption displayed on the dialog form. |
DialogMessage |
|
Text displayed as a prompt or message on the dialog form. |
DialogType |
|
Identifies the icon and default caption for the dialog. |
Buttons |
|
Contains the button identifiers displayed on the dialog form. |
ButtonCount |
|
Number of values in the Buttons argument. |
DefaultIndex |
|
Position for the default button on the dialog form. |
EscapeResult |
|
Value returned when the Escape key is pressed for the dialog. |
UseDefaultPos |
|
True to use the default position for the dialog form, False to use the values in X and Y as the Top and Left coordinates. |
X |
|
Horizontal coordinate where the dialog form is displayed. |
Y |
|
Vertical coordinate where the dialog form is displayed. |
LongInt value for the button clicked on the prompt dialog.
DefaultPromptDialog is a LongInt function which implements a widgetset-independent prompt dialog. It is uses a LCL TForm instance instead of relying on dialogs provided by the operating system. The content displayed on the dialog form is specified using the arguments passed to the routine, including:
The return value contains the LongInt value returned for the button clicked on the dialog. It corresponds to the values passed in the Buttons argument, but may be changed to the value in EscapeIndex if the Escape key was pressed during dialog display.
The size and layout for elements on the dialog are calculated when the dialog form is created. The maximum width and height for the dialog is the largest space needed for the icon, message text and buttons on the dialog. For small-format devices (width is 300 pixel or less), a width of 200 pixels is used on the dialog form.
Example:
uses LCLType; procedure TForm1.Button1Click(Sender: TObject); var btns: array[0..2] of LongInt = (idButtonOK, idButtonCancel, idButtonHelp); res: LongInt; begin res := DefaultPromptDialog('This is the caption', 'This is the message of this dialog', idDialogInfo, @btns, 3, 0, 1, true, 0, 0); Caption := 'Dialog result is ' + IntToStr(res); end;
|
Displays the form as a modal dialog. |
|
|
Specifies the return value for a form (or dialog) displayed modally. |
|
|
Version 3.2 | Generated 2024-02-25 | Home |