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 */;
プロパティ
| 種類 | 可視性 | ソース | ユニット | 親 |
|---|---|---|---|---|
procedure function |
public | FMX.Platform.pas FMX.Platform.hpp |
FMX.Platform | IFMXDialogServiceAsync |
説明
テキスト入力フィールドと OK ボタンを持つダイアログ ボックスを表示します。
InputQueryAsync は非同期に動作します。InputQueryAsync への呼び出しは即座に終了し、ユーザーがダイアログ ボックスを閉じるのを待ちません。同期的に動作させるには、IFMXDialogServiceSync.InputQuerySync を使用します。
InputQueryAsync は、次のパラメータを受け取ります:
ACaptionは、ダイアログ ボックスのタイトルです。APromptsは文字列の配列で、テキスト入力フィールドの左側にくるラベルとして使用されます。ADefaultValuesは文字列のp配列で、フィールドのデフォルト値を定義します。- メモ:
ADefaultValuesの長さは、APromptsの長さ以上でなければなりません。
- メモ:
ACloseDialogProcまたはACloseQueryEventは任意の無名メソッドまたはイベント ハンドラで、ユーザーがダイアログ ボックスを閉じ、ユーザー入力を受けとった後に呼び出されます。AContextは任意のオブジェクトで、ACloseQueryEventに割り当てられたイベント ハンドラに対するコンテキストとして渡すことができます。
ユーザーがダイアログ ボックスを閉じると、InputQueryAsync は指定された無名メソッドかイベント ハンドラを、次の引数で呼び出します:
Sender(ACloseQueryEventのみ)は、指定されたAContextを保有しています。AResultは、ダイアログ ボックスを閉じるのに使用されるボタンのモーダル結果の値です。AValuesには、ユーザーがダイアログ ボックスのテキスト入力フィールドに入力した文字列が含まれています。
InputQueryAsync を、IFMXDialogServiceAsync のインスタンスの必要なく呼び出すには、TDialogServiceAsync.InputQuery を代わりに使用してください。
テキスト入力フィールドのコンテンツにマスクする
テキスト入力フィールドのコンテンツをマスクして、入力した際に実際の文字の代わりに点が表示されるようにするには、APrompts の相当ラベル文字列の最初に、SOH(start of heading)コントロール文字 を含めます。例:
- Delphi:
#1'Password:'
- C++:
"\1Password:"
サポート対象プラットフォーム
| プラットフォーム | [ サポート] |
|---|---|
| Windows | |
| OS X | |
| iOS | |
| Android |