Refactoring TTaskDialog:

- TWSTaskDialog.Execute: Don't cast ADlg to TTaskDialog.
- Adapt signature of function ExecuteLCLTaskDialog accordingly.
- Less debug output
This commit is contained in:
Bart 2023-07-24 11:06:22 +02:00
parent c343cfe0d3
commit b7cc27d3a5
3 changed files with 4 additions and 4 deletions

View File

@ -1867,7 +1867,7 @@ var
begin begin
if IsConsole then writeln('TWin32WSTaskDialog.Execute A'); //if IsConsole then writeln('TWin32WSTaskDialog.Execute A');
//if not Assigned(TaskDialogIndirect) or //if not Assigned(TaskDialogIndirect) or
if not TaskDialogIndirectAvailable or if not TaskDialogIndirectAvailable or
(tfForceNonNative in ADlg.Flags) (tfForceNonNative in ADlg.Flags)

View File

@ -72,7 +72,7 @@ var
TaskDialog_Translate: TTaskDialogTranslate; TaskDialog_Translate: TTaskDialogTranslate;
function ExecuteLCLTaskDialog(const ADlg: TTaskDialog; AParentWnd: HWND; out ARadioRes: Integer): Integer; function ExecuteLCLTaskDialog(const ADlg: TCustomTaskDialog; AParentWnd: HWND; out ARadioRes: Integer): Integer;
type type
@ -236,7 +236,7 @@ end;
{ -------------- } { -------------- }
function ExecuteLCLTaskDialog(const ADlg: TTaskDialog; AParentWnd: HWND; out ARadioRes: Integer): Integer; function ExecuteLCLTaskDialog(const ADlg: TCustomTaskDialog; AParentWnd: HWND; out ARadioRes: Integer): Integer;
var var
DlgForm: TLCLTaskDialog; DlgForm: TLCLTaskDialog;
begin begin

View File

@ -201,7 +201,7 @@ end;
class function TWSTaskDialog.Execute(const ADlg: TCustomTaskDialog; AParentWnd: HWND; out ARadioRes: Integer): Integer; class function TWSTaskDialog.Execute(const ADlg: TCustomTaskDialog; AParentWnd: HWND; out ARadioRes: Integer): Integer;
begin begin
//writeln('TWSTaskDialog.Execute: Assigned(ADlg)=',Assigned(ADlg)); //writeln('TWSTaskDialog.Execute: Assigned(ADlg)=',Assigned(ADlg));
Result := ExecuteLCLTaskDialog(TTaskDialog(ADlg), AParentWnd, ARadiores); Result := ExecuteLCLTaskDialog(ADlg, AParentWnd, ARadiores);
end; end;
{ WidgetSetRegistration } { WidgetSetRegistration }