mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 10:10:31 +02:00
TCustomTaskDialog: inherit form TLCLComponent and register the widgetset class.
This commit is contained in:
parent
6fb319fae8
commit
fc6bbcc936
@ -613,7 +613,9 @@ type
|
||||
property Items[Index: Integer]: TTaskDialogBaseButtonItem read GetItem write SetItem; default;
|
||||
end;
|
||||
|
||||
TCustomTaskDialog = class(TComponent)
|
||||
{ TCustomTaskDialog }
|
||||
|
||||
TCustomTaskDialog = class(TLCLComponent)
|
||||
private
|
||||
FButton: TTaskDialogButtonItem;
|
||||
FButtons: TTaskDialogButtons;
|
||||
@ -640,6 +642,7 @@ type
|
||||
procedure SetRadioButtons(const Value: TTaskDialogButtons);
|
||||
function ButtonIDToModalResult(const AButtonID: Integer): TModalResult;
|
||||
protected
|
||||
class procedure WSRegisterClass; override;
|
||||
function DoExecute(ParentWnd: HWND): Boolean; dynamic;
|
||||
procedure DoOnButtonClicked(AModalResult: Integer; var ACanClose: Boolean); dynamic;
|
||||
public
|
||||
|
@ -118,6 +118,13 @@ begin
|
||||
Result := mrNone;
|
||||
end;
|
||||
|
||||
class procedure TCustomTaskDialog.WSRegisterClass;
|
||||
begin
|
||||
inherited WSRegisterClass;
|
||||
RegisterTaskDialog;
|
||||
end;
|
||||
|
||||
|
||||
destructor TCustomTaskDialog.Destroy;
|
||||
begin
|
||||
FButtons.Free;
|
||||
|
@ -1576,6 +1576,7 @@ end;
|
||||
|
||||
class function TWin32WSTaskDialog.Execute(const ADlg: TCustomTaskDialog): Boolean;
|
||||
begin
|
||||
//writeln('TWin32WSTaskDialog.Execute');
|
||||
Result := inherited Execute(ADlg);
|
||||
end;
|
||||
|
||||
|
@ -16,6 +16,7 @@ implementation
|
||||
|
||||
function ExecuteLCLTaskDialog(const ADlg: TTaskDialog): Boolean;
|
||||
begin
|
||||
//writeln('ExecuteLCLTaskDialog');
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
|
@ -103,8 +103,8 @@ type
|
||||
end;
|
||||
|
||||
{ TWSTaskDialog }
|
||||
|
||||
TWSTaskDialog = class(TWSCommonDialog)
|
||||
TWSTaskDialogClass = class of TWSTaskDialog;
|
||||
TWSTaskDialog = class(TWSLCLComponent)
|
||||
published
|
||||
class function Execute(const ADlg: TCustomTaskDialog): Boolean; virtual;
|
||||
end;
|
||||
@ -200,6 +200,7 @@ end;
|
||||
|
||||
class function TWSTaskDialog.Execute(const ADlg: TCustomTaskDialog): Boolean;
|
||||
begin
|
||||
//writeln('TWSTaskDialog.Execute');
|
||||
Result := ExecuteLCLTaskDialog(TTaskDialog(ADlg));
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user