ide: assign available key shortcuts to the source editor popup menu items

git-svn-id: trunk@22001 -
This commit is contained in:
paul 2009-10-03 16:47:20 +00:00
parent 62516ce038
commit c94627a628
2 changed files with 32 additions and 4 deletions

View File

@ -1847,8 +1847,7 @@ begin
SourceNotebook.OnViewJumpHistory := @OnSrcNotebookViewJumpHistory;
SourceNotebook.OnShowSearchResultsView := @OnSrcNotebookShowSearchResultsView;
SourceNotebook.OnPopupMenu := @OnSrcNoteBookPopupMenu;
DebugBoss.ConnectSourceNotebookEvents;
DebugBoss.SetupSourceMenuShortCuts;
DebugBoss.ConnectSourceNotebookEvents;
// connect search menu to sourcenotebook
MainIDEBar.itmSearchFind.OnClick := @SourceNotebook.FindClicked;
@ -2412,6 +2411,7 @@ end;
procedure TMainIDE.LoadMenuShortCuts;
begin
inherited LoadMenuShortCuts;
SourceNotebook.SetupShortCuts;
DebugBoss.SetupMainBarShortCuts;
end;

View File

@ -791,6 +791,7 @@ type
procedure FindReplaceDlgKey(Sender: TObject; var Key: Word;
Shift: TShiftState; FindDlgComponent: TFindDlgComponent);
procedure SetupShortCuts;
public
property OnAddJumpPoint: TOnAddJumpPoint
read FOnAddJumpPoint write FOnAddJumpPoint;
@ -5014,6 +5015,33 @@ begin
end;
end;
procedure TSourceNotebook.SetupShortCuts;
function GetCommand(ACommand: Word): TIDECommand; inline;
begin
Result := IDECommandList.FindIDECommand(ACommand);
end;
begin
SrcEditMenuProcedureJump.Command:=GetCommand(ecFindProcedureDefinition);
SrcEditMenuFindinFiles.Command:=GetCommand(ecFindInFiles);
SrcEditMenuCut.Command:=GetCommand(ecCut);
SrcEditMenuCopy.Command:=GetCommand(ecCopy);
SrcEditMenuPaste.Command:=GetCommand(ecPaste);
SrcEditMenuCompleteCode.Command:=GetCommand(ecCompleteCode);
SrcEditMenuRenameIdentifier.Command:=GetCommand(ecRenameIdentifier);
SrcEditMenuFindIdentifierReferences.Command:=GetCommand(ecFindIdentifierRefs);
SrcEditMenuExtractProc.Command:=GetCommand(ecExtractProc);
SrcEditMenuShowAbstractMethods.Command:=GetCommand(ecShowAbstractMethods);
SrcEditMenuShowEmptyMethods.Command:=GetCommand(ecRemoveEmptyMethods);
SrcEditMenuShowUnusedUnits.Command:=GetCommand(ecRemoveUnusedUnits);
SrcEditMenuFindOverloads.Command:=GetCommand(ecFindOverloads);
DebugBoss.SetupSourceMenuShortCuts;
end;
procedure TSourceNotebook.BeginIncrementalFind;
var
TempEditor: TSourceEditor;
@ -5976,9 +6004,9 @@ end;
{This is called from outside to set a bookmark}
procedure TSourceNotebook.SetBookmark(Value: Integer);
Begin
begin
BookMarkSet(Value);
End;
end;
procedure TSourceNotebook.BookmarkGotoNext(GoForward: boolean);
var