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 XE7 Firemonkey Anonymous Thread InputBoxIn 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.



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

Related posts
AndroidComponentDelphiDemoFiremonkeyIOSLinuxOSXShowcaseWindows

Experience ChatGPT As A Native Cross-Platform Firemonkey Application

DelphiLibraryWindows

Run Large Language Models Entirely On The GPU With Delphi And Vulkan

Code SnippetDelphiDemoLibraryWindows

Add Real-Time AI Voice Conversations To Windows Applications

ComponentDelphiDemoLibraryWindows

Give AI Models Eyes, Ears, And Real-World Capabilities

Sign up for our Newsletter and
stay informed
[mailpoet_form id="1"]

Leave a Reply