From 57e13c67d3a6714f7eacc3dc98cdd25d7b552cd5 Mon Sep 17 00:00:00 2001 From: Bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Mon, 17 Jul 2023 12:43:04 +0200 Subject: [PATCH] TWSTaskDialog: change signature of Execute method. Reason: TTaskDialog is not related to TCommonDialog. Eventually we need to cast the parameter to TCustomTaskDialog in the Win32 implementation. Because of the (Delhi compatible) signature of TTaskDialog.DoExcute, it seems that TCustomTaskDialog cannot inherit from TCommonDialog, since this method (TCustomTaskDialog.DoExecute) must be dynamic, so it cannot also be "override" as well. --- lcl/interfaces/win32/win32wsdialogs.pp | 6 +++--- lcl/widgetset/wsdialogs.pp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lcl/interfaces/win32/win32wsdialogs.pp b/lcl/interfaces/win32/win32wsdialogs.pp index 4949080dee..5616a59206 100644 --- a/lcl/interfaces/win32/win32wsdialogs.pp +++ b/lcl/interfaces/win32/win32wsdialogs.pp @@ -161,7 +161,7 @@ type TWin32WSTaskDialog = class(TWSTaskDialog) public - class function Execute(const ACommonDialog: TCommonDialog): Boolean; override; + class function Execute(const ADlg: TCustomTaskDialog): Boolean; override; end; function OpenFileDialogCallBack(Wnd: HWND; uMsg: UINT; {%H-}wParam: WPARAM; @@ -1574,9 +1574,9 @@ end; { TWin32WSTaskDialog } -class function TWin32WSTaskDialog.Execute(const ACommonDialog: TCommonDialog): Boolean; +class function TWin32WSTaskDialog.Execute(const ADlg: TCustomTaskDialog): Boolean; begin - Result := inherited Execute(ACommonDialog); + Result := inherited Execute(ADlg); end; initialization diff --git a/lcl/widgetset/wsdialogs.pp b/lcl/widgetset/wsdialogs.pp index e788ea0cbb..99394f6b17 100644 --- a/lcl/widgetset/wsdialogs.pp +++ b/lcl/widgetset/wsdialogs.pp @@ -106,7 +106,7 @@ type TWSTaskDialog = class(TWSCommonDialog) published - class function Execute(const ACommonDialog: TCommonDialog): Boolean; virtual; + class function Execute(const ADlg: TCustomTaskDialog): Boolean; virtual; end; { WidgetSetRegistration } @@ -198,7 +198,7 @@ end; { TWSTaskDialog } -class function TWSTaskDialog.Execute(const ACommonDialog: TCommonDialog): Boolean; +class function TWSTaskDialog.Execute(const ADlg: TCustomTaskDialog): Boolean; begin //ToDo call new LCLTaskDialog.Execute Result := False;