[Lazarus] Default button for QuestionDLG

Jürgen Hestermann juergen.hestermann at gmx.de
Tue Oct 14 14:16:24 CEST 2014


Am 2014-10-14 um 12:10 schrieb Bart:
> On 10/14/14, Reinier Olislagers <reinierolislagers at gmail.com> wrote:
>
>> http://wiki.lazarus.freepascal.org/Dialog_Examples#QuestionDlg
> Added a note about having to specify Caption when using IsDefault.
>
>
That is good. Many Thanks.

But I wonder whether this is the desired behaviour.
Shouldn't a single 'IsDefault' string be treated as setting the
button as the default button even when no other caption is specified?
Assigning 'IsDefault' as button caption seems very uncommon to me.


And yet another important fact regarding QuestionDLG ist the abillity
to set keys to answer the dialog (instead of clicking on the buttons).
At least on windows (don't know about other OS'es) you can prepend
one character in each button caption with an ampersand (&) to make
this key answer the dialog too. For example with

QuestionDlg('Writing log file','Stop writing log file?', mtConfirmation,[mrYes,'&Yes',mrNo,'&No','IsDefault'],0)

the Y of 'Yes' and the N of 'No' are shown underlined and Y and N
can be used to answer the dialog in the same way as clicking with the mouse.
For (mainly) keyboard driven applications this is very important IMO.

When I remember my password I will add this to the wiki too.

But the wiki is not the first place where users look for help.
Searching for 'Lazarus QuestionDLG' lets me find
http://lazarus-ccr.sourceforge.net/docs/lcl/dialogs/questiondlg.html
at first and it looks like the official (complete) documentation.
I would not expect to find additional (important) facts somewhere else
(and even when, how long should I search until I give up?).
So all these additional documentation need to be added here too.





More information about the Lazarus mailing list