Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodCode SnippetDelphiFiremonkeyIOSOSXWindows

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);
InputString: string;
InputString:= Dialogs.InputBox('Input Box', 'Prompt', 'Default string');
Edit1.Text:= InputString;

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)
case AResult of
{ Detect which button was pushed and show a different message }
// AValue is the result of the inputbox dialog

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

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts

AutoBlogAI: FireMonkey Client To Leverage LLMs And Generative AI For Blogging


Unleashing Creativity With Song Writer AI: A Deep Dive


How To Build Stable Diffusion Text To Image Prompts


FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes

Sign up for our Newsletter and
stay informed

Leave a Reply