unit uDMActionManager;

interface

uses
  System.SysUtils, System.Classes, Vcl.PlatformDefaultStyleActnCtrls, System.Actions, Vcl.ActnList, Vcl.ActnMan,
  System.ImageList, Vcl.ImgList, Vcl.Controls,uTreeView;

type
  TDMActionManager = class(TDataModule)
    ActionManager: TActionManager;
    aInsertFolder: TAction;
    ilActionPics: TImageList;
    Action1: TAction;
    aEditNodeText: TAction;
    aNodeDown: TAction;
    aNodeUp: TAction;
    aDelete: TAction;
    aCopy: TAction;
    aCut: TAction;
    aPaste: TAction;
    aUpdateDynamic: TAction;
    procedure aInsertFolderExecute(Sender: TObject);
    procedure Action1Execute(Sender: TObject);
    procedure aEditNodeTextExecute(Sender: TObject);
    procedure aNodeDownExecute(Sender: TObject);
    procedure aDeleteExecute(Sender: TObject);
    procedure aCopyExecute(Sender: TObject);
    procedure aCutExecute(Sender: TObject);
    procedure aUpdateDynamicExecute(Sender: TObject);
  private


   FDBTreeView:TDBTreeView;

    { Private declarations }
  public


   property DBTreeView:TDBTreeView read FDBTreeView write FDBTreeView;

    { Public declarations }
  end;

//var
//  DMActionManager: TDMActionManager;

implementation

{%CLASSGROUP 'Vcl.Controls.TControl'}



{$R *.dfm}

procedure TDMActionManager.aCopyExecute(Sender: TObject);
begin
if not Assigned(FDBTreeView) then exit;

FDBTreeView.CopyNodes;
end;

procedure TDMActionManager.Action1Execute(Sender: TObject);
begin
if not Assigned(FDBTreeView) then exit;
FDBTreeView.InsertFolder;
end;

procedure TDMActionManager.aCutExecute(Sender: TObject);
begin
if not Assigned(FDBTreeView) then exit;
FDBTreeView.CutNodes;
end;

procedure TDMActionManager.aDeleteExecute(Sender: TObject);
begin
if not Assigned(FDBTreeView) then exit;
FDBTreeView.DeleteNodes;
end;

procedure TDMActionManager.aEditNodeTextExecute(Sender: TObject);
begin
if not Assigned(FDBTreeView) then exit;
FDBTreeView.EditNodeText;
end;

procedure TDMActionManager.aInsertFolderExecute(Sender: TObject);
begin
if not Assigned(FDBTreeView) then exit;
FDBTreeView.InsertFolder;
end;

procedure TDMActionManager.aNodeDownExecute(Sender: TObject);
begin
if not Assigned(FDBTreeView) then exit;
FDBTreeView.NodeDown;
end;

procedure TDMActionManager.aUpdateDynamicExecute(Sender: TObject);
begin
FDBTreeView.InitialUpdate;
end;



end.
