Recent

Author Topic: dialog box with two input boxes ?  (Read 5096 times)

IPguy

  • Sr. Member
  • ****
  • Posts: 385
dialog box with two input boxes ?
« on: March 12, 2012, 02:43:51 am »
Is there a standard dialog box which has two input fields? 
I'm looking at something like the InputBox or InputQuery with two fields.

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: dialog box with two input boxes ?
« Reply #1 on: March 12, 2012, 01:35:12 pm »
No, but you can add it easily.

Code: [Select]
aForm:=CreateMessageDialog('message',mtInfomation,[mbYes,mbNo]);
aEdit:=TEdit.Create(aForm);
...
aForm.ShowModal;   
Lazarus 1.7 (SVN) FPC 3.0.0

Arvur

  • New Member
  • *
  • Posts: 48
    • My GitHub
Re: dialog box with two input boxes ?
« Reply #2 on: October 13, 2017, 02:00:40 pm »
I've found basic implementation in messagedialogs.inc (Lazarus 1.6.4):
Code: Pascal  [Select][+][-]
  1. function InputQuery(const ACaption: string; const APrompts: array of string; var AValues: array of string; ACloseEvent: TInputCloseQueryEvent): boolean;

Thaddy

  • Hero Member
  • *****
  • Posts: 14393
  • Sensorship about opinions does not belong here.
Re: dialog box with two input boxes ?
« Reply #3 on: October 13, 2017, 05:16:40 pm »
Note: InputBox or InputQuery  are (Windows) platform dependent and need a (Windows) resource.
I would advise for cross-platform your own form.

If it is windows only, I wrote an example ages (no, light years, before 2000) ago.
« Last Edit: October 13, 2017, 05:19:47 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: dialog box with two input boxes ?
« Reply #4 on: October 13, 2017, 08:51:45 pm »
No, the InputQuery() in the Dialogs unit (messagedialogs.inc) is fully cross-platform, not restricted to Windows at all.

Its full signature is
Code: Pascal  [Select][+][-]
  1. function InputQuery(const ACaption: string; const APrompts: array of string;
  2.   var AValues: array of string; ACloseEvent: TInputCloseQueryEvent): boolean;

and it shows two (or more depending on the aPrompts parameter) edit input fields.


 

TinyPortal © 2005-2018