FMX.DialogService.TDialogService.MessageDialog
Delphi
class procedure MessageDialog(const AMessage: string; const ADialogType: TMsgDlgType;
const AButtons: TMsgDlgButtons; const ADefaultButton: TMsgDlgBtn; const AHelpCtx: THelpContext;
const ACloseDialogProc: TInputCloseDialogProc); overload;
class procedure MessageDialog(const AMessage: string; const ADialogType: TMsgDlgType;
const AButtons: TMsgDlgButtons; const ADefaultButton: TMsgDlgBtn; const AHelpCtx: THelpContext;
const ACloseDialogEvent: TInputCloseDialogEvent; const AContext: TObject = nil); overload;
C++
__classmethod void __fastcall MessageDialog(const System::UnicodeString AMessage, const System::Uitypes::TMsgDlgType ADialogType, const System::Uitypes::TMsgDlgButtons AButtons, const System::Uitypes::TMsgDlgBtn ADefaultButton, const System::Classes::THelpContext AHelpCtx, const Fmx::Dialogs::_di_TInputCloseDialogProc ACloseDialogProc)/* overload */;
__classmethod void __fastcall MessageDialog(const System::UnicodeString AMessage, const System::Uitypes::TMsgDlgType ADialogType, const System::Uitypes::TMsgDlgButtons AButtons, const System::Uitypes::TMsgDlgBtn ADefaultButton, const System::Classes::THelpContext AHelpCtx, const Fmx::Dialogs::TInputCloseDialogEvent ACloseDialogEvent, System::TObject* const AContext = (System::TObject*)(0x0))/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | FMX.DialogService.pas FMX.DialogService.hpp |
FMX.DialogService | TDialogService |
Description
Displays a dialog box with a custom message, dialog type, set of buttons and help context ID.
MessageDialog can work synchronously or asynchronously depending on the preferred mode. MessageDialog internally calls MessageDialogAsync or MessageDialogSync.
When PreferredMode is set to Platform:
- On desktop platforms (Windows and OS X), MessageDialog behaves synchronously. The call finishes only when the user closes the dialog box.
- On mobile platforms (Android and iOS), MessageDialog behaves asynchronously. The call finishes instantaneously, it does not wait for the user to close the dialog box.
To force a specific behaviour for the different platforms, set PreferredMode to Sync or ASync (Not supported by Android).
MessageDialog receives the following parameters:
AMessage
is the text message.ADialogType
is the dialog type.AButtons
is the set of buttons.ADefaultButton
is the button that has the focus by default.AHelpCtx
is the help context ID.ACloseDialogProc
orACloseDialogEvent
is an anonymous method or event handler that is called after the user closes the dialog box.- Note: The Help button does not trigger a call because it does not close the dialog box.
AContext
is an optional object that you can provide as a context for the event handler assigned toACloseQueryEvent
.