TTaskDialog wrong ModalResult when pressing Close button (CommonButtons)
Original Reporter info from Mantis: Bart @flyingsheep
-
Reporter name: Bart Broersma
Original Reporter info from Mantis: Bart @flyingsheep
- Reporter name: Bart Broersma
Description:
Reported by Alexander Hoffmann on ML.
If you place a TTaskDialog on a form and have tcbClose in CommonButtons, then pressing on this Close button sets ModalResult to mrAll (Windows ITaskDialogIndirect) or mrAbort (simulated TTaskDialog).
Steps to reproduce:
Build attached task.zip project (never mind all the unused units, it's a simple botched up test program).
Run, click button1, click Close button of dialog.
Additional information:
Clicking close button (native ITaskDialigIndirect) sets IDButton correctly to 8, but you cannot directly map buttonID to ModalResult like that, since mrClose = 11.
On simulated dialog
TCommonButton = (
cbOK, cbYes, cbNo, cbCancel, cbRetry, <u>cbClose</u>) maps to
TD_BTNMOD: array[TCommonButton] of Integer = (
mrOk, mrYes, mrNo, mrCancel, mrRetry, <u>mrAbort</u>);
Possible patch attached.
Mantis conversion info:
- Mantis ID: 36069
- OS: Windows
- OS Build: 10
- Build: r61683
- Platform: i386
- Version: 2.1 (SVN)
- Fixed in version: 2.0.6
- Fixed in revision: r61947 (#a7be8c9c)
- Target version: 2.0.6