[Lazarus] Inconsistent results from MessageDlg()
patspiper
patspiper at gmail.com
Sun Apr 29 14:37:36 CEST 2012
On 29/04/12 13:00, zeljko wrote:
>
> On Sunday 29 of April 2012 10:40:18 patspiper wrote:
>
> > On 28/04/12 13:37, Bart wrote:
>
> > > Here's the alternative implementation: Escape will always return
>
> > > mrCancel, both LCL's own CreatemessageDialog and
>
> > > Widgetset.PromptUser().
>
> > >
>
> > > See attached file: msgdlg.alternative.diff
>
> > > (Diff's for the first solution are in the bugtracker)
>
> >
>
> > This alternative implementation seems to be in line with Delphi XE's
>
> > result for MessageDlg('test', mtInformation, [mbOk, mbAbort], 0) when
>
> > Escape key is pressed: mrCancel
>
>
>
> hm...just fixed qt part for EscapeButton, but when testing
> QuestionDlg() seem that Cancel = True maps one button as cancel result
> (Escape or [x]) under gtk2 and qt eg. QuestionDlg('Confirm','Please
> confirm me',[mrYes,'Yes',mrAbort,'Abort'],0) returns mrAbort when
> escape key or [x] is clicked.
>
It could be following the function ModalEscapeValue, ie return the
following in high to low order of preference (assuming the corresponding
button is present):
mrCancel
mrNo
mrAbort
mrIgnore
mrNoToAll
mrYes
mrOK
mrRetry
mrAll
mrYesToAll
If the only button in MessageDlg is mbClose, then return mrCancel.
>
> If we are following behaviour of MessageDlg, QuestionDlg should return
> mrCancel in any case when Escape key is pressed or [x] is clicked.
>
+1
Unifying [x] and Escape key to mrCancel is IMHO the most logical.
>
> Anyone can test what QuestionDlg() is doint under Delphi XE ?
>
I currently don't have access to Delphi to test.
Stephano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20120429/40354887/attachment-0003.html>
More information about the Lazarus
mailing list