ttamturk Posted May 5, 2012 Posted May 5, 2012 Hi Farshad, I searched in demos but, I could not find InputQuery example.. Very simple example? Thanks. Quote
Administrators Farshad Mohajeri Posted May 6, 2012 Administrators Posted May 6, 2012 What do you specifically mean by Input Query? Quote
ttamturk Posted May 6, 2012 Author Posted May 6, 2012 Hi, I can see a different style InputQuery parameters in code completion. function InputQuery(const ACaption: string; const APromts: array of string; var AValues: array of string;CloseQueryFunc: TInputCloseQueryFunc = nil): Boolean; When I use this It opens Windows Form InputQuery box.. I need InputQuery in Web. Like MessageDlg web version.. procedure TMainForm._ExitConfirm(AResult:Integer); begin case AResult of mrYes : MainForm.Close; mrNo : ShowMessage('Application continue.'); end; end; procedure TMainForm.Cikis1Click(Sender: TObject); begin MessageDlg('Exit?',mtConfirmation, mbYesNo,_ExitConfirm); end; Quote
Administrators Farshad Mohajeri Posted May 7, 2012 Administrators Posted May 7, 2012 InputQuery fucntion is not implemented in uniGUI yet. We may add it in future. Thanks Quote
ttamturk Posted May 17, 2012 Author Posted May 17, 2012 Hi Farshad, I wrote a dirty version of InputQuery. procedure InputQuery(ACaption, APrompt, AValue : String; _OnOkClick, _OnCancelClick : TNotifyEvent); var F : TUniForm; Prompt: TUniLabel; Edit : TUniEdit; DialogUnits: TPoint; B1,B2 : TUniButton; ButtonTop, ButtonWidth, ButtonHeight: Integer; const SMsgDlgOK = 'Ok'; SMsgDlgCancel = 'Cancel'; begin F := TUniForm.Create(UniApplication); with F do begin F.Caption := ACaption; F.BorderStyle := bsDialog; DialogUnits := Point(8,8); //F.ClientWidth := MulDiv(180, DialogUnits.X,4); //Not Working //F.ClientHeight := MulDiv(60, DialogUnits.Y,4); //Not Working F.SetBounds(0,0,MulDiv(164, DialogUnits.X,4), MulDiv(70, DialogUnits.Y,4)); //Working Prompt := TUniLabel.Create(F); with Prompt do begin Parent := F; Caption := APrompt; Left := MulDiv(8, DialogUnits.X, 4); Top := MulDiv(8, DialogUnits.Y, 8); Constraints.MaxWidth := MulDiv(164, DialogUnits.X, 4); end; Edit := TUniEdit.Create(F); with Edit do begin Parent := F; Name := 'ueEdit'; Left := Prompt.Left; Top := Prompt.Top + Prompt.Height + 5; Width := MulDiv(140, DialogUnits.X, 4); Text := AValue; end; ButtonTop := Edit.Top + Edit.Height + 15; ButtonWidth := MulDiv(50, DialogUnits.X, 4); ButtonHeight := MulDiv(14, DialogUnits.Y, 8); with TUniButton.Create(F) do begin Parent := F; Caption := SMsgDlgOK; ModalResult := mrOk; Default := True; SetBounds(MulDiv(38, DialogUnits.X, 4), ButtonTop, ButtonWidth,ButtonHeight); OnClick := _OnOkClick; end; B2 := TUniButton.Create(F); with B2 do begin Parent := F; Caption := SMsgDlgCancel; ModalResult := mrCancel; Cancel := True; SetBounds(MulDiv(92, DialogUnits.X, 4), Edit.Top + Edit.Height + 15, ButtonWidth, ButtonHeight); OnClick := _OnCancelClick; //F.Height := B2.Top + B2.Height + 13 + 20; //Not Working end; F.ShowModal; end; end; procedure TMainForm._OkClick(Sender : TObject); var F : TUniForm; E : TUniEdit; begin F := TUniForm(TUniButton(Sender).Owner); E := TUniEdit(F.FindChildControl('ueEdit')); ShowMessage('Value : '+E.Text); end; Question 1: ClientWidht, ClientHeight is not working? Question 2: What is the best way to release F (TUniForm)? Or Is it cleared automaticaly? Quote
Administrators Farshad Mohajeri Posted May 17, 2012 Administrators Posted May 17, 2012 Question 1: ClientWidht, ClientHeight is not working? Question 2: What is the best way to release F (TUniForm)? Or Is it cleared automaticaly? 1) ClientWidht, ClientHeightcan only be set at design time. At runtime use Width and Height 2) Form is freed automatically. FreeOnClose is true by default. Quote
FRANCISCO CASTRO SOTO Posted December 28, 2022 Posted December 28, 2022 Hello, how would the inputquery procedure be used?, I'm trying to use it and I get memory access errors Thanks. Quote
Sherzod Posted December 29, 2022 Posted December 29, 2022 Hello, 3 hours ago, FRANCISCO CASTRO SOTO said: Hello, how would the inputquery procedure be used?, On 5/6/2012 at 2:21 PM, Farshad Mohajeri said: What do you specifically mean by Input Query? 3 hours ago, FRANCISCO CASTRO SOTO said: I'm trying to use it and I get memory access errors In what way do you use? See the demos: \FMSoft\Framework\uniGUI\Demos\Desktop\Prompt \FMSoft\Framework\uniGUI\Demos\Desktop\Prompt Anonymous Callback Quote
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.