mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 05:39:14 +02:00
examples: codetools: register shortcut, issue #27094
git-svn-id: trunk@46994 -
This commit is contained in:
parent
e563b55f2c
commit
6c3808768e
@ -27,7 +27,8 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, MenuIntf, LazIDEIntf, Controls, SrcEditorIntf,
|
Classes, SysUtils, MenuIntf, LazIDEIntf, Controls, SrcEditorIntf,
|
||||||
CodeToolManager, CodeTree, CodeCache, CodeAtom, CustomCodeTool;
|
CodeToolManager, CodeTree, CodeCache, CustomCodeTool, IDECommands,
|
||||||
|
LCLType;
|
||||||
|
|
||||||
procedure JumpIDEToImplementationKeyword(Sender: TObject);
|
procedure JumpIDEToImplementationKeyword(Sender: TObject);
|
||||||
|
|
||||||
@ -91,9 +92,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Register;
|
procedure Register;
|
||||||
|
var
|
||||||
|
Key: TIDEShortCut;
|
||||||
|
Cat: TIDECommandCategory;
|
||||||
|
CmdMyTool: TIDECommand;
|
||||||
begin
|
begin
|
||||||
|
// register IDE shortcut and menu item
|
||||||
|
Key := IDEShortCut(VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||||
|
Cat:=IDECommandList.FindCategoryByName(CommandCategoryCodeTools);
|
||||||
|
CmdMyTool := RegisterIDECommand(Cat,'JumpToImplementation', 'Jump to implementation keyword', Key, nil, @JumpIDEToImplementationKeyword);
|
||||||
|
|
||||||
RegisterIDEMenuCommand(itmCodeToolSearches,'JumpToImplementation',
|
RegisterIDEMenuCommand(itmCodeToolSearches,'JumpToImplementation',
|
||||||
'Jump to implementation keyword',nil,@JumpIDEToImplementationKeyword);
|
'Jump to implementation keyword',nil,@JumpIDEToImplementationKeyword, CmdMyTool);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user