A BitButton with Kind bkClose doesn't close the main form.
Original Reporter info from Mantis: giuliano
-
Reporter name: G. Colla
Original Reporter info from Mantis: giuliano
- Reporter name: G. Colla
Description:
If in a form is inserted a BitButton of kind bkClose, clicking on it, or typing enter or space when the button has focus doesn't close the form.
Additional information:
in bitbtn.inc
TCustomBitBtn.Click
performs the following check:
if (FKind = bkClose) and (ModalResult = mrNone) then begin
Form := GetParentForm(Self);
if Form <> nil then begin
Form.Close;
[...]
but setting the button kind to bkClose now sets ModalResult to mrClose, and this makes the test fail.
The fix can be either to revert the ModalResult for bkClose to mrNone, as it was, or to modify the test into:
if (FKind = bkClose) or (ModalResult = mrClose)
Mantis conversion info:
- Mantis ID: 21942
- Version: 1.1 (SVN)
- Fixed in revision: 37299 (#5d26cd24)
- Monitored by: » luizamerico (Luiz Americo)
- Target version: 1.0.0