📄 mydelphi.pas
字号:
unit MyDelphi;
interface
uses
Classes, ExptIntf, Forms, Windows;
type
TMyDelphiWizard = class (TIExpert)
public
function GetStyle: TExpertStyle; override;
function GetName: string; override;
function GetAuthor: string; override;
function GetComment: string; override;
function GetPage: string; override;
function GetGlyph: HICON; override;
function GetState: TExpertState; override;
function GetIDString: string; override;
function GetMenuText: string; override;
procedure Execute; override;
end;
procedure Register;
implementation
uses
MyDeForm, Registry, ComCtrls, Messages;
function TMyDelphiWizard.GetStyle: TExpertStyle;
begin
// show up in the Help menu
Result := esStandard;
end;
function TMyDelphiWizard.GetName: String;
begin
// official name
Result := 'My Delphi Wizard'
end;
function TMyDelphiWizard.GetAuthor: string;
begin
Result := 'Marco and Tim';
end;
function TMyDelphiWizard.GetComment: String;
begin
Result := 'TMyDelphiWizard Expert';
end;
function TMyDelphiWizard.GetPage: string;
begin
Result := '';
end;
function TMyDelphiWizard.GetGlyph: HICON;
begin
Result := 0;
end;
function TMyDelphiWizard.GetState: TExpertState;
begin
Result := [esEnabled];
end;
function TMyDelphiWizard.GetIDString: String;
begin
// must be unique
Result := 'DDHandbook.MyDelphiWizard'
end;
function TMyDelphiWizard.GetMenuText: String;
begin
// the text of the menu item
Result := '&My (Custom) Delphi'
end;
procedure TMyDelphiWizard.Execute;
var
Reg: TRegistry;
Palette: TTabControl;
begin
MyDelphiForm := TMyDelphiForm.Create (Application);
try
MyDelphiForm.ShowModal;
finally
MyDelphiForm.Free;
end;
// saves the status in the registry
Reg := TRegistry.Create;
Reg.OpenKey (ToolServices.GetBaseRegistryKey +
'\MyDelphiWizard', True);
Palette := Application.MainForm.
FindComponent ('TabControl') as TTabControl;
Reg.WriteBool ('Multiline', Palette.Multiline);
Reg.WriteInteger ('PaletteHeight', Palette.Height);
Reg.Free;
end;
procedure Register;
var
Palette: TTabControl;
Reg: TRegistry;
begin
RegisterLibraryExpert(TMyDelphiWizard.Create);
// load the status from the registry
Reg := TRegistry.Create;
Reg.OpenKey (ToolServices.GetBaseRegistryKey +
'\MyDelphiWizard', True);
Palette := Application.MainForm.
FindComponent ('TabControl') as TTabControl;
if Reg.ValueExists ('Multiline') then
Palette.Multiline := Reg.ReadBool ('Multiline');
if Reg.ValueExists ('PaletteHeight') then
Palette.Height := Reg.ReadInteger ('PaletteHeight');
// force resize
SendMessage (Application.MainForm.Handle,
wm_Size, 0, 0);
Reg.Free;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -