Async InputQuery does not handle Cancel button

I use a simple TDialogServiceAsync.InputQuery()single-entry call . It simply ignores the button Canceland the close button of the window X.

But the button Okworks fine.

This is my code:

uses
  FMX.DialogService.Async;

procedure TForm1.Button1Click(Sender: TObject);
begin
  TDialogServiceAsync.InputQuery('Title',
   ['Insert value'], ['bla bla'],
  procedure(const AResult: TModalResult; const AValues: array of string)
  begin
    if Aresult = mrOk then
      ShowMessage('Ok!');

    if Aresult = mrCancel then
      ShowMessage('Cancel!'); // this is never called
  end);
end;

If I click Cancel, the InputQuery window does not close and my callback procedure is not called.

How can I close the InputQuery form when a button is clicked Cancel?

I am using RADStudio 10.1 Berlin.


Edit:

I did some tests:

  • On Windows, the 32-bit cancel button DOES NOT work
  • On Windows, the 64-bit cancel button DOES NOT work
  • On iOS, the 64-bit cancel button works correctly
  • On Android 32-bit cancel button works correctly
+4
1

. Embarcadero :

RSP-16148 TDialogService.InputQuery() -

RSP-16670 TDialogService.InputQuery.

FMX.DialogHelper.pas:

FMX.DialogHelper.pas

class function TDialogBuilder.InputQuery(const ACaption: string; const APrompts: array of string;

Button := CreateButton(LForm, BorderSize, WorkArea, Layout, SMsgDlgCancel, mrCancel, LForm.ButtonOnClick);

,

//fix or add by flyign wang.
Button.Cancel := True;
LForm.FCanCancel := True;
+5

Source: https://habr.com/ru/post/1672810/


All Articles