[ad_1]
I’m working with RAD Studio Delphi 11 Model 28.0.44500.8973 with Replace 1 and the PAServer replace on Home windows 10.
Once I use the TDialogServiceAsync.InputQuery technique below IOS, the modal response from the Enter question is reversed.
When the OK button is pressed, the Modal End result(AResult) is 2(mrCancel) and the Ensuing Response isn’t up to date.
When the Cancel button is pressed, the Modal End result(AResult) is 1(mrOK) and the Ensuing Response is returned.
That is utterly reverse to the way in which it’s imagined to work.
When the tactic is used below Android and Home windows, the Modal End result and Response are right.
This was working correctly in RAD Studio 10.4 and I imagine was working correctly once I first put in RAD Studio 11. Nevertheless, I since needed to reload RAD Studio 11 so I downloaded the most recent set up that had Patch 1 included after which loaded the PA Server Patch.
I’ve connected the code to a quite simple challenge that demonstrates the behaviour.
I have never been capable of finding any posts on this challenge apart from one again in 2017 the place the Cancel button wasn’t working below home windows however I am fairly certain that’s not related right here.
Simply questioning if anyone else is experiencing the identical challenge or whether it is one thing from my set up or setup. I duplicated the RAD Studio 11 set up on my growth laptop computer and I am getting the identical challenge.
I’m attaching code to a quite simple challenge that recreates the difficulty.
Unit:
unit Unit1;
interface
makes use of
System.SysUtils, System.Sorts, System.UITypes, System.Lessons, System.Variants,
FMX.Sorts, FMX.Controls, FMX.Types, FMX.Graphics, FMX.Dialogs, FMX.DialogService.Async,
FMX.Controls.Presentation, FMX.StdCtrls;
sort
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
chkFlipIOSResponse: TCheckBox;
Label2: TLabel;
Label3: TLabel;
process Button1Click(Sender: TObject);
process OnInputQuery_Close(const AResult: TModalResult; const AValues: array of string);
personal
{ Non-public declarations }
public
{ Public declarations }
finish;
var
Form1: TForm1;
implementation
{$R *.fmx}
process TForm1.Button1Click(Sender: TObject);
start
TDialogServiceAsync.InputQuery('Enter Textual content', ['Enter Text:'], [label1.Text], Self.OnInputQuery_Close)
finish;
process TForm1.OnInputQuery_Close(const AResult: TModalResult; const AValues: array of string);
var Response: String;
start
Label2.Textual content := 'Modal Response=" + IntToStr(AResult);
Response := AValues[0];
{$IFDEF IOS}
if AResult = 1 then
Label3.Textual content := "Cancel Button Pressed'
else
Label3.Textual content := 'OK Button Pressed';
{$ELSE}
if AResult = 1 then
Label3.Textual content := 'OK Button Pressed'
else
Label3.Textual content := 'Cancel Button Pressed';
{$ENDIF}
Label1.Textual content := Response.Trim;
finish;
finish.
Kind:
object Form1: TForm1
Left = 0
Prime = 0
Caption = 'Form1'
ClientHeight = 282
ClientWidth = 338
FormFactor.Width = 320
FormFactor.Top = 480
FormFactor.Gadgets = [Desktop]
DesignerMasterStyle = 0
object Button1: TButton
Place.X = 118.000000000000000000
Place.Y = 190.000000000000000000
TabOrder = 0
Textual content="Button1"
OnClick = Button1Click
finish
object Label1: TLabel
Place.X = -8.000000000000000000
Place.Y = 145.000000000000000000
Measurement.Width = 338.000000000000000000
Measurement.Top = 17.000000000000000000
Measurement.PlatformDefault = False
TextSettings.HorzAlign = Middle
Textual content="Message Response"
TabOrder = 3
finish
object chkFlipIOSResponse: TCheckBox
Place.X = 96.000000000000000000
Place.Y = 24.000000000000000000
Measurement.Width = 234.000000000000000000
Measurement.Top = 19.000000000000000000
Measurement.PlatformDefault = False
TabOrder = 4
Textual content="Flip IOS Response"
finish
object Label2: TLabel
Place.X = -8.000000000000000000
Place.Y = 107.000000000000000000
Measurement.Width = 338.000000000000000000
Measurement.Top = 17.000000000000000000
Measurement.PlatformDefault = False
TextSettings.HorzAlign = Middle
Textual content="Modal Response"
TabOrder = 2
finish
object Label3: TLabel
Place.Y = 75.000000000000000000
Measurement.Width = 338.000000000000000000
Measurement.Top = 17.000000000000000000
Measurement.PlatformDefault = False
TextSettings.HorzAlign = Middle
Textual content="Button Pressed"
TabOrder = 1
finish
finish
[ad_2]
