type
TCodeHelper = class(TNotifierObject, IOTAKeyboardBinding)
private
public
function GetBindingType: TBindingType;
function GetDisplayName: string;
function GetName: string;
procedure BindKeyboard(const BindingServices: IOTAKeyBindingServices);
procedure CodeHelp(const Context: IOTAKeyContext; KeyCode: TShortcut; var BindingResult: TKeyBindingResult);
end;
procedure Register;
begin
(BorlandIDEServices as IOTAKeyBoardServices).AddKeyboardBinding(TCodeHelper.Create);
end;
procedure TCodeHelper.BindKeyboard(const BindingServices: IOTAKeyBindingServices);
begin
BindingServices.AddKeyBinding([TextToShortCut('Ctrl+H')], CodeHelp, nil);
end;
procedure TCodeHelper.CodeHelp(const Context: IOTAKeyContext; KeyCode: TShortcut; var BindingResult: TKeyBindingResult);
var
i, CurrentCol, BeginCol, CurrentRow, CurrentTopRow: integer;
SearchKeyString: string;
begin
showmessage('代码助手');
end;
function TCodeHelper.GetBindingType: TBindingType;
begin
result := btPartial;
end;
h
function TCodeHelper.GetDisplayName: string;
begin
result := '代码助手';
end;
function TCodeHelper.GetName: string;
begin
result := 'CodeHelper';
end;