On 29/04/12 13:00, zeljko wrote:
It could be following the function ModalEscapeValue, ie return the following in high to low order of preference (assuming the corresponding button is present):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: mrCancelhm...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.
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
-- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
