LCL: fix TTaskDialog.ModalResult if closebutton (in CommonButtons) is clicked. Issue #0036069.

git-svn-id: trunk@61947 -
This commit is contained in:
bart 2019-09-29 10:43:55 +00:00
parent ed3cfadcf4
commit a7be8c9c96
2 changed files with 14 additions and 2 deletions

View File

@ -99,7 +99,19 @@ function TCustomTaskDialog.ButtonIDToModalResult(const AButtonID: Integer
): TModalResult;
begin
if AButtonID<100 then
Result := AButtonID
begin
case AButtonID of
IDOK: Result := mrOK;
IDCANCEL: Result := mrCancel;
IDABORT: Result := mrAbort;
IDRETRY: Result := mrRetry;
IDIGNORE: Result := mrIgnore;
IDYES: Result := mrYes;
IDNO: Result := mrNo;
IDCLOSE: Result := mrClose;
else Result := AButtonID
end;
end
else if (AButtonID-100<Buttons.Count) then
Result := Buttons[AButtonID-100].ModalResult
else

View File

@ -446,7 +446,7 @@ end;
const
TD_BTNMOD: array[TCommonButton] of Integer = (
mrOk, mrYes, mrNo, mrCancel, mrRetry, mrAbort);
mrOk, mrYes, mrNo, mrCancel, mrRetry, mrClose);
function TD_BTNS(button: TCommonButton): pointer;
begin