Jump to content


Photo

Mobile Version of InputQuery


  • Please log in to reply
No replies to this topic

#1 RobYost

RobYost

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 195 posts
  • LocationFlorida, USA

Posted 04 December 2017 - 05:37 PM

https://unigui.mirah...n_of_InputQuery

 

The link above tells how to use it.

function mInputQuery(aPrompt: string; aTitle: String; var rtnValue: String; InputType: String=''): Boolean;
var
    fModal  : TUnimForm;
    aMsg  : TUnimlabel;
    aInput  : TUnimEdit;
    btnOK  : TunimButton;
    btnCancel: TunimButton;
begin
    result  := False;
    fModal  := TUnimForm.Create(UniApplication);
    fModal.Caption := aTitle;

    aMsg  := TUnimlabel.Create(fModal);
    aMsg.Parent  := fModal;
    aMsg.Margins.Top  := 50;
    aMsg.Margins.Left  := 30;
    aMsg.Margins.Right  := 30;
    aMsg.AlignWithMargins := True;
    aMsg.Align  := alTop;
    aMsg.Caption  := aPrompt;

    aInput  := TUnimEdit.Create(fModal);
    aInput.Parent  := fModal;
    aInput.Margins.Top  := 50;
    aInput.Margins.Left  := 30;
    aInput.Margins.Right  := 30;
    aInput.AlignWithMargins := True;
    aInput.Align  := alTop;
    if (InputType <> '') then
        (aInput as IUniJSInterface).JSConfig('inputType', [''+InputType+'']);

    btnCancel  := TunimButton.Create(fModal);
    btnCancel.Parent  := fModal;
    btnCancel.Caption  := 'Cancel';
    btnCancel.Width  := Trunc((UniApplication.ScreenWidth - (2 * aMsg.Margins.Left)) / 2 - (aMsg.Margins.Left / 2));
    btnCancel.Top  := aMsg.Margins.Top + aMsg.Height + aInput.Height + 20 + (fModal.Height - fModal.ClientHeight);
    btnCancel.Left  := aMsg.Margins.Left;
    btnCancel.ModalResult := mrCancel;

    btnOK  := TunimButton.Create(fModal);
    btnOK.Parent  := fModal;
    btnOK.Caption  := 'OK';
    btnOK.Width  := btnCancel.Width;
    btnOK.Left  := UniApplication.ScreenWidth - aInput.Margins.Right - btnOK.Width;
    btnOK.Top  := aMsg.Margins.Top + aMsg.Height + aInput.Height + 20 + (fModal.Height - fModal.ClientHeight);
    btnOK.ModalResult := mrOk;

    result := (fModal.ShowModal() = mrOk);

    rtnValue := aInput.Text;
end;

  • 0

http://unigui.mirahe.../wiki/Main_Page

Please add any utilities you think are useful. I will try to keep the wiki organized.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users