<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
On 29/04/12 13:00, zeljko wrote:
<blockquote cite="mid:201204291200.38158.zeljko@holobit.net"
type="cite">
<meta name="qrichtext" content="1">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">On Sunday 29 of April 2012 10:40:18 patspiper
wrote:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> On 28/04/12 13:37, Bart wrote:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> > Here's the alternative
implementation: Escape will always return</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> > mrCancel, both LCL's own
CreatemessageDialog and</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> > Widgetset.PromptUser().</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> > </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> > See attached file:
msgdlg.alternative.diff</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> > (Diff's for the first solution are
in the bugtracker)</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> This alternative implementation seems to
be in line with Delphi XE's</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> result for MessageDlg('test',
mtInformation, [mbOk, mbAbort], 0) when</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">> Escape key is pressed: mrCancel</p>
<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px;
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br>
</p>
<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px;
-qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br>
</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">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.</p>
</blockquote>
It could be following the function ModalEscapeValue, ie return the
following in high to low order of preference (assuming the
corresponding button is present):<br>
mrCancel<br>
mrNo<br>
mrAbort<br>
mrIgnore<br>
mrNoToAll<br>
mrYes<br>
mrOK<br>
mrRetry<br>
mrAll<br>
mrYesToAll<br>
<br>
If the only button in MessageDlg is mbClose, then return mrCancel.<br>
<blockquote cite="mid:201204291200.38158.zeljko@holobit.net"
type="cite">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">If we are following behaviour of MessageDlg,
QuestionDlg should return mrCancel in any case when Escape key
is pressed or [x] is clicked.</p>
</blockquote>
+1<br>
Unifying [x] and Escape key to mrCancel is IMHO the most logical.<br>
<blockquote cite="mid:201204291200.38158.zeljko@holobit.net"
type="cite">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;">Anyone can test what QuestionDlg() is doint
under Delphi XE ?</p>
</blockquote>
I currently don't have access to Delphi to test.<br>
<br>
Stephano<br>
</body>
</html>