![]() |
Wie nun InputQuery unter IOS nutzen?
Bis Delphi 10.3.3 und IOS 12.1 hat noch folgendes bei Klick auf einen Schalter funktioniert:
Delphi-Quellcode:
Nun soll man wohl Inputquerysync (oder Async) verwenden:
procedure Tfrm_fldverw.bnNewClick(Sender: TObject);
var NewString: String; P : Integer; begin InputQuery ('Neue Bezeichnung anlegen...', ['Bitte geben Sie einen Text ein:'], [NewString], procedure (const AResult: TModalresult; const AValues: array of string) begin if AResult= mrOK then begin P := lbKat.Items.Add (AValues[0]); lbKat.ItemIndex := P; end; end); end; ![]() Aber beides funktioniert hier nicht: Die Async-Variante kommt immer mit result 0 2 (cancel) zurück.
Delphi-Quellcode:
Was mache ich falsch, wie geht es richtig?
procedure Tfrm_fldverw.bnNewClick(Sender: TObject);
var ASyncService : IFMXDialogServiceASync; caption, inData: array[0..0] of string; P: Integer; SyncService : IFMXDialogServiceSync; Acaption, AinData : array[0..0] of string; begin caption[0] := 'Neue Bezeichnung :'; inData[0] := ''; // funktioniert nicht if TPlatformServices.Current.SupportsPlatformService (IFMXDialogServiceSync, IInterface(SyncService)) then begin if SyncService.InputQuerySync( 'Input String', caption, inData ) then begin P := lbKat.Items.Add (indata[0]); lbKat.ItemIndex := P; end; end; // das auch nicht, als Ergebnis kommt als result immer "2" zurück (cancel) if TPlatformServices.Current.SupportsPlatformService (IFMXDialogServiceAsync, IInterface (ASyncService)) then begin ASyncService.InputQueryAsync( 'Input String', caption, inData, procedure (const AResult : TModalResult; const AValues : array of string) var s: string; begin case AResult of mrOK: begin s := AValues[0]; P := lbKat.Items.Add (AValues[0]); lbKat.ItemIndex := P; end; end; end ); end; (* var NewString: String; P : Integer; begin InputQuery ('Neue Bezeichnung anlegen...', ['Bitte geben Sie einen Text ein:'], [NewString], procedure (const AResult: TModalresult; const AValues: array of string) begin if AResult= mrOK then begin P := lbKat.Items.Add (AValues[0]); lbKat.ItemIndex := P; end; end); *) end; |
AW: Wie nun InputQuery unter IOS nutzen?
Du brauchst doch eigentlich nur von der globalen Procedure auf die entsprechenden globalen class procedures umzustellen:
Delphi-Quellcode:
class procedure TDialogService.InputQuery(const ACaption: string; const APrompts: array of string; const AValues: array of string; const ACloseQueryProc: TInputCloseQueryProc);
... FMX.DialogService.TDialogService {} .InputQuery( ACaption, APrompts, AValues, LProcDlg ); |
AW: Wie nun InputQuery unter IOS nutzen?
@Rollo62
Danke. Ich meine, ich hätte es so versucht - werde ich aber beim nächsten Programm noch mal so angehen (jetzt habe ich einfach eine eigene Form für die Texteingabe gemacht).... |
Alle Zeitangaben in WEZ +1. Es ist jetzt 19:56 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz