Bart schrieb:

If you have a MessageDlg (without a mrCancel button) and you click the
"Close" border-icon of the dialog then the result now depends on your
OS (on Windows that is)

On Windows Vista (and up) the result will be "EscapeResult" (user
presses Escape key: the result depends on the actual buttons in the
dialog: it will be mrNo if you have [mbYes,mbNo] as buttons).
On lower Windows versions it will be mrCancel always.

Two buttons of an Dialog can have the special properties Default (CR) and Cancel (Esc).

IMO it's perfectly sufficient to also map Close to the Cancel button, and to disallow Close when no button has Cancel=True. This will leave it up to the designer, to specify the intended behaviour and results of the dialog. Adding more actions and implicit return values, than specified by the designer, can cause a misinterpretation of these unexpected results, what is highly undesireable.

DoDi


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to