Unit BtrReg;
interface

Procedure Register;

implementation
Uses
  Classes,
  DsgnIntf,
  DBTables,
  Controls,
  DBConsts,
  SysUtils,
  DSDesign,
  Forms,

  BtrTitan;

Type
  TTitanHook =
  Class( TComponentEditor )
    Procedure HookWork;
    Procedure ExecuteVerb( Index : Integer ); override;
    Function  GetVerb( Index : Integer ) : string; override;
    Function  GetVerbCount : Integer; override;
  end;


Procedure TTitanHook.HookWork;
var
  F : TTitanForm;
begin
  F := TTitanForm.Create( Application );
  Try
    F.ShowModal;
  Finally
    F.Free;
  end;
end;


Procedure TTitanHook.ExecuteVerb( Index : Integer );
begin
  Case Index of
    0 : ShowDatasetDesigner( Designer, TTable( Component ) );
    2 : HookWork;
  end;
end;


Function TTitanHook.GetVerb( Index : Integer ) : string;
begin
  Case Index of
   0 : Result := LoadStr( SDatasetDesigner );
   1 : Result := '-';
   2 : Result := 'About Titan...';
  end;
end;


Function TTitanHook.GetVerbCount: Integer;
begin
  If ( Component is TTable ) then
    Result := 3
  else
    Result := 0;
end;


Procedure Register;
begin
  RegisterComponentEditor( TTable, TTitanHook );
end;


end.
