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

Bart bartjunk64 at gmail.com
Wed Sep 11 14:24:49 CEST 2019


On Wed, Sep 11, 2019 at 1:53 PM Bart <bartjunk64 at gmail.com> wrote:

Possible fix:

function TCustomTaskDialog.ButtonIDToModalResult(const AButtonID: Integer
  ): TModalResult;
begin
  if AButtonID<100 then
    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
    Result := mrNone;
end;

--
Bart


More information about the lazarus mailing list