kkelchev Posted April 6, 2018 Share Posted April 6, 2018 HI Is it possible TUniForm.prompt to be with modal behavior. It should be possible TUniForm.ShowMessage is modal. Unfortunately there is no provide source for uniGUIForm.pas and I can't fix it manually. I did try to find solution in this way. But it does not work and block session thread until TimeOut(10sec) is gone ----------------------------------------------------------------------------------------------------------------- Function InputQueryWEB(Form: TUniBaseForm; Const Msg: String; Var Value: String): Boolean; Var Res: Boolean; Val: String; TimeOutDT: TDateTime; Begin Res := False; Val := Value; TimeOutDT := IncSecond(Now, 10); Form.Prompt(Msg, Value, mtConfirmation, mbOKCancel, procedure(Sender: TComponent; AResult: Integer; AText: string) begin Res := AResult = mrOK; if Res then Val := AText; TimeOutDT := Now; End, False); while TimeOutDT >= Now do Sleep(100); if Res then Value := Val; End; ---------------------------------------------------------------------------------------------------------------- Thanks Kamen Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 6, 2018 Share Posted April 6, 2018 Hi, Sorry, what do you want? I think you need to change the logic of the program, you need to handle it in a callback function, or enable Synchronous Operation Quote Link to comment Share on other sites More sharing options...
kkelchev Posted April 6, 2018 Author Share Posted April 6, 2018 enable Synchronous is TRUE ! TUniForm.ShowMessage IS MODAL and works as expected(perfect) TUniForm.prompt is NOT ? Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 6, 2018 Administrators Share Posted April 6, 2018 Hi, You must call the prompt function: function Prompt(const AMsg, AValue: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; var UserValue: string; MultiLines:Boolean): Integer; Quote Link to comment Share on other sites More sharing options...
kkelchev Posted April 6, 2018 Author Share Posted April 6, 2018 I'm using that function Prompt procedure is method of Form - right ? It seems than internally is sources (UniGUIForm.pas) The form/dialog with edit that user will enter something is activated/shown with call like this PrompFormObj.Show (SHOW) Could it be with PrompFormObj.ShowModal ? Why Form.ShowMessage is MODAL but Form.prompt is NOT ? Thanks Kamen Quote Link to comment Share on other sites More sharing options...
kkelchev Posted April 6, 2018 Author Share Posted April 6, 2018 HI greats I did some simple solution for this my issue. Could you see it ? For now it works with String only but easy latter I will extend it to all simple (ordinary) data types Anyway Thanks for your time srcPromptWEB.zip Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 6, 2018 Administrators Share Posted April 6, 2018 I'm using that function Prompt procedure is method of Form - right ? It seems than internally is sources (UniGUIForm.pas) The form/dialog with edit that user will enter something is activated/shown with call like this PrompFormObj.Show (SHOW) Could it be with PrompFormObj.ShowModal ? Why Form.ShowMessage is MODAL but Form.prompt is NOT ? Thanks Kamen Prompt displays a Modal window. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.