📄 ctdreg.pas
字号:
unit ctdReg;
interface
{$INCLUDE ctdDefs.inc}
uses
{$ifdef D6UP}
DesignIntf, DesignEditors,
{$else}
Dsgnintf,
{$endif D6UP}
Classes, Windows, Forms, ToolsAPI, SysUtils;
type
TCtdEditor = class(TComponentEditor)
public
procedure ExecuteVerb(Index: Integer); override;
function GetVerb(Index: Integer): string; override;
function GetVerbCount: Integer; override;
end;
procedure Register;
implementation
uses Controls, ShellApi, ctdEng, ctdWzrd, ctdAux;
procedure Register;
begin
{$ifdef D6UP}
StartClassGroup(TControl);
GroupDescendentsWith(TCtdEngine, Controls.TControl);
{$endif D6UP}
RegisterComponents('Citadel', [TCtdEngine]);
RegisterComponentEditor(TCtdEngine, TCtdEditor);
end;
procedure TCtdEditor.ExecuteVerb(Index: Integer);
var
MajorVersion,
MinorVersion: Char;
Ident: String;
begin
MajorVersion := CtdVersion[CtdMajorVersionPos];
MinorVersion := CtdVersion[CtdMinorVersionPos];
Assert({$ifdef D12UP}CharInSet(MajorVersion,{$else}(MajorVersion in{$endif D12UP}['0'..'9']));
Assert({$ifdef D12UP}CharInSet(MinorVersion,{$else}(MinorVersion in{$endif D12UP}['0'..'9']));
{$ifdef CtdDoTrial}
Ident := 't2';
{$else}
Ident := 'r2';
{$endif CtdDoTrial}
case Index of
0: begin
FormCtdWizard := TFormCtdWizard.Create(nil);
try
FormCtdWizard.Initialize(Component as TCtdEngine, Designer);
FormCtdWizard.ShowModal;
finally
FormCtdWizard.Free;
end;
end;
2: ShellExecute(Application.MainForm.Handle, nil,
PChar('http://www.billeniumsoft.com?ctd' +
MajorVersion + MinorVersion + Ident), nil, nil, SW_SHOWNORMAL);
3: ShellExecute(Application.MainForm.Handle, nil,
PChar('http://www.billeniumsoft.com/ctd/order.htm?' +
MajorVersion + MinorVersion + Ident), nil, nil, SW_SHOWNORMAL);
end;
end;
function TCtdEditor.GetVerb(Index: Integer): string;
begin
case Index of
0: Result := 'Citadel expert...';
1: Result := CtdVersion;
2: Result := 'www.billeniumsoft.com';
3: Result := 'Buy now';
end;
end;
function TCtdEditor.GetVerbCount: Integer;
begin
{$ifdef CtdDoTrial}
Result := 4;
{$else}
Result := 3;
{$endif CtdDoTrial}
end;
{$ifdef CtdDoTrial}
{$include trial\taux6.inc}
{$endif CtdDoTrial}
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -