FMX.DialogService.TDialogService.InputQuery

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class procedure InputQuery(const ACaption: string; const APrompts: array of string; const AValues: array of string;  const ACloseQueryProc: TInputCloseQueryProc); overload;
class procedure InputQuery(const ACaption: string; const APrompts: array of string; const AValues: array of string;  const ACloseQueryEvent: TInputCloseQueryWithResultEvent; const AContext: TObject = nil); overload;

C++

__classmethod void __fastcall InputQuery(const System::UnicodeString ACaption, const System::UnicodeString *APrompts, const int APrompts_High, const System::UnicodeString *AValues, const int AValues_High, const Fmx::Dialogs::_di_TInputCloseQueryProc ACloseQueryProc)/* overload */;
__classmethod void __fastcall InputQuery(const System::UnicodeString ACaption, const System::UnicodeString *APrompts, const int APrompts_High, const System::UnicodeString *AValues, const int AValues_High, const Fmx::Dialogs::TInputCloseQueryWithResultEvent ACloseQueryEvent, 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 that contains text input fields and an OK button.

InputQuery can work synchronously or asynchronously depending on the preferred mode. InputQuery internally calls TDialogServiceAsync.InputQuery or TDialogServiceSync.InputQuery.

When PreferredMode is set to Platform:

  • On desktop platforms (Windows and OS X), InputQuery behaves synchronously. The call finishes only when the user closes the dialog box.
  • On mobile platforms (Android and iOS), InputQuery 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).

InputQuery 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.
  • AValues is an array of strings that define default values for fields.
    Note: The length of AValues must be greater than or equal to the length of APrompts.
  • ACloseDialogProc or ACloseQueryEvent 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 to ACloseQueryEvent.

See Also