[Lazarus] TTaskDialog - correct ModalResult for "Close"?

Alexander Hofmann alexander.hofmann at new-h.de
Wed Sep 11 21:30:47 CEST 2019


Hi,

so - your patch indeed fixes it for Windows (where the native common
controls dialog is used for Win 10). But - there's more logic behind it
I think.

For Linux (and Probably other platforms, too), independent of the widget
set, in LCLTaskDialog.pas there's

  TCommonButton = (
    cbOK, cbYes, cbNo, cbCancel, cbRetry, cbClose);  

and

const
  TD_BTNMOD: array[TCommonButton] of Integer = (
    mrOk, mrYes, mrNo, mrCancel, mrRetry, mrAbort); 

TD_BTNMOD is used exactly once again, where it serves to pass the
ModalResult to the Button. So the "Close" button really gets assigned
with "mrAbort" in Linux, where in Windows, the difference in idClose and
mrClose is the culprit?

Also, LCLTaskDialog seems to execute the native Windows Dialog
independently of the selected Widgetset; though I don't think Qt or GTK
is widely used on Windows anyway?

I won't dig further on the latter, but should I file a bug about the
Close/Abort thing?

All the best,
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190911/cb2ecfce/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190911/cb2ecfce/attachment-0001.sig>


More information about the lazarus mailing list