* * *

Author Topic: dialog box with two input boxes ?  (Read 2021 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: 19
    • 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: 4525
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 »
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

howardpc

  • Hero Member
  • *****
  • Posts: 2334
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.


 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus