Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey, Delphi Android, Delphi IOS

New Non Blocking InputBox Function In Delphi XE7 Firemonkey On Android And IOS

| Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOS

Delphi XE7 Firemonkey Anonymous Thread InputBox | Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOSIn addition to the new non blocking MessageDlg function in Delphi XE7 Firemonkey and Appmethod there is also a new InputBox function. Embarcadero created the new non blocking InputBox function to better support Android which does not support blocking dialog boxes. This new InputBox function simply takes an anonymous method which gets executed when the InputBox is closed instead of blocking and executing code after the InputBox in the execution order. Now it should work great on Android, IOS, Windows, and OSX platforms without any problems. Here is an example code snippet for how you use the InputBox function in Delphi XE5 and Delphi XE6:
procedure TForm1.Button1Click(Sender: TObject);
var
InputString: string;
begin
InputString:= Dialogs.InputBox('Input Box', 'Prompt', 'Default string');
Edit1.Text:= InputString;
end;

Here is an example code snippet for the new InputBox with the anonymous function:
InputBox('What do you want to say?','','Stuff',
procedure(const AResult: TModalResult; const AValue: string)
begin
case AResult of
{ Detect which button was pushed and show a different message }
mrOk:
begin
// AValue is the result of the inputbox dialog
end;
mrCancel:
begin
end;
end;
end
);

Head over and check out the documentation of the new non blocking InputBox function on the Embarcadero DocWiki.

Exit mobile version