LCL: Fix TBitBTn behavior with Kind=bkClose and ModalResult=mrClose. Issue #21844, patch from Bart Broersma

git-svn-id: trunk@37064 -
This commit is contained in:
juha 2012-04-28 14:26:39 +00:00
parent 6d94b077c7
commit 24cd5e93cd

View File

@ -48,7 +48,9 @@ procedure TCustomBitBtn.Click;
var
Form : TCustomForm;
begin
if FKind = bkClose then begin
//Contrary to other buttons with ModalResult = mrNone
//a TBitBtn must close ParentForm if Kind = bkClose
if (FKind = bkClose) and (ModalResult = mrNone) then begin
Form := GetParentForm(Self);
if Form <> nil then begin
Form.Close;