FMX.Platform.IFMXDialogServiceAsync.InputQueryAsync
Delphi
procedure InputQueryAsync(const ACaption: string; const APrompts: array of string; const ADefaultValues: array of string; const ACloseDialogProc: TInputCloseQueryProc); overload;
procedure InputQueryAsync(const ACaption: string; const APrompts: array of string; const ADefaultValues: array of string; const ACloseQueryEvent: TInputCloseQueryWithResultEvent; const AContext: TObject = nil); overload;
C++
virtual void __fastcall InputQueryAsync(const System::UnicodeString ACaption, const System::UnicodeString *APrompts, const int APrompts_High, const System::UnicodeString *ADefaultValues, const int ADefaultValues_High, const Fmx::Dialogs::_di_TInputCloseQueryProc ACloseDialogProc) = 0 /* overload */;
virtual void __fastcall InputQueryAsync(const System::UnicodeString ACaption, const System::UnicodeString *APrompts, const int APrompts_High, const System::UnicodeString *ADefaultValues, const int ADefaultValues_High, const Fmx::Dialogs::TInputCloseQueryWithResultEvent ACloseQueryEvent, System::TObject* const AContext = (System::TObject*)(0x0)) = 0 /* overload */;
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | FMX.Platform.pas FMX.Platform.hpp |
FMX.Platform | IFMXDialogServiceAsync |
Description
Displays a dialog box that contains text input fields and an OK button.
InputQueryAsync works asynchronously. Calls to InputQueryAsync finish instantaneously, they do not wait for the user to close the dialog box. To work synchronously, use IFMXDialogServiceSync.InputQuerySync.
InputQueryAsync receives the following parameters:
ACaption
is the title of the dialog box.APrompts
is an array of strings to use as labels on the left-hand side of the text input fields.ADefaultValues
is an array of strings that define default values for fields.- Note: The length of
ADefaultValues
must be greater than or equal to the length ofAPrompts
.
- Note: The length of
ACloseDialogProc
orACloseQueryEvent
is an anonymous method or event handler that is called after the user closes the dialog box and receives the user input.AContext
is an optional object that you can provide as a context for the event handler assigned toACloseQueryEvent
.
When the user closes the dialog box, InputQueryAsync calls the specified anonymous method or event handler with the following arguments:
Sender
(ACloseQueryEvent
only) contains the specifiedAContext
.AResult
is the modal result value of the button used to close the dialog box.AValues
contains the strings that the user entered into the text input fields of the dialog box.
To call InputQueryAsync without the need of an instance of IFMXDialogServiceAsync, use TDialogServiceAsync.InputQuery instead.
Masking the Content of a Text Input Field
To mask the content of a text input field, so that as you type dots are displayed instead of characters, include a start of heading (SOH) control character at the beginning of the corresponding label string from APrompts
. For example:
- Delphi:
#1'Password:'
- C++:
"\1Password:"
Platform Support
Platform | Support |
---|---|
Windows | ![]() |
macOS | ![]() |
iOS | ![]() |
Android | ![]() |