[Lazarus] Inconsistent results from MessageDlg()

Bart bartjunk64 at gmail.com
Wed Apr 25 18:19:49 CEST 2012


Hi,

I have created a patch which behaves like this:
(see: http://bugs.freepascal.org/view.php?id=21801#attachments , file:
msgdlg.diff)


If the widgetset has a (native) PromptUser function, then the
behaviour of the dialog is as follows:
- Escape and [X]-bordericon will return mrCancel

If no widgetset specific PromptDialog is set up, then eventually
TPromptDialog.CreateMessageDialog() is called.
I have changed it's behaviour to be compatible with Delphi:
- [X]-bordericon will return mrCancel
- Escape will only close the dialog if mbOk, mbNo or mbCancel is in Buttons,
  in this case it will return mrCancel, mrNo or mrOk (in that order)
  It does so by setting the Cancel property of the appropriate Button
  (as long as TBitBtn.Cancel works across widgetsets, this should
work, but I can only test this on windows myself)


This behaviour is consistent with both older Delphi's and newer ones
using the new Vista-dialogs (as does Lazarus).

To properly resond to mbClose, the proposed patch from
http://bugs.freepascal.org/view.php?id=0021844 should also be applied.

Can one of the Lazarus devels take a look at my proposed patch and
apply or give feedback?

Bart




More information about the Lazarus mailing list