mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 23:49:28 +02:00
IDE: Simplify and reuse function GetCommand in DebugManager.
git-svn-id: trunk@62727 -
This commit is contained in:
parent
c98da657b9
commit
4fe3c9d4be
@ -2020,24 +2020,14 @@ begin
|
||||
SrcEditMenuInspect.Tag := Ord(ddtInspect);
|
||||
end;
|
||||
|
||||
function GetCommand(ACommand: word): TIDECommand;
|
||||
begin
|
||||
Result:=IDECommandList.FindIDECommand(ACommand);
|
||||
if Result<>nil then
|
||||
RegisterIDEButtonCommand(Result);
|
||||
end;
|
||||
|
||||
procedure TDebugManager.SetupMainBarShortCuts;
|
||||
|
||||
function GetCmdAndBtn(ACommand: word; out ToolButton: TIDEButtonCommand): TIDECommand;
|
||||
begin
|
||||
Result:=IDECommandList.FindIDECommand(ACommand);
|
||||
if Result<>nil then
|
||||
ToolButton := RegisterIDEButtonCommand(Result)
|
||||
else
|
||||
ToolButton := nil;
|
||||
end;
|
||||
|
||||
function GetCommand(ACommand: word): TIDECommand;
|
||||
var
|
||||
ToolButton: TIDEButtonCommand;
|
||||
begin
|
||||
Result:=GetCmdAndBtn(ACommand, ToolButton);
|
||||
end;
|
||||
|
||||
begin
|
||||
with MainIDEBar do
|
||||
begin
|
||||
@ -2064,23 +2054,6 @@ begin
|
||||
end;
|
||||
|
||||
procedure TDebugManager.SetupSourceMenuShortCuts;
|
||||
|
||||
function GetCmdAndBtn(ACommand: word; out ToolButton: TIDEButtonCommand): TIDECommand;
|
||||
begin
|
||||
Result:=IDECommandList.FindIDECommand(ACommand);
|
||||
if Result<>nil then
|
||||
ToolButton := RegisterIDEButtonCommand(Result)
|
||||
else
|
||||
ToolButton := nil;
|
||||
end;
|
||||
|
||||
function GetCommand(ACommand: word): TIDECommand;
|
||||
var
|
||||
ToolButton: TIDEButtonCommand;
|
||||
begin
|
||||
Result:=GetCmdAndBtn(ACommand, ToolButton);
|
||||
end;
|
||||
|
||||
begin
|
||||
SrcEditMenuToggleBreakpoint.Command:=GetCommand(ecToggleBreakPoint);
|
||||
SrcEditMenuRunToCursor.Command:=GetCommand(ecRunToCursor);
|
||||
|
@ -72,7 +72,7 @@ uses
|
||||
// IDE
|
||||
LazConf, LazarusIDEStrConsts, Project, BuildManager, EnvironmentOpts,
|
||||
EditorOptions, CompilerOptions, SourceEditor, SourceSynEditor, FindInFilesDlg,
|
||||
DesktopManager, Splash, MainBar, MainIntf, Designer, Debugger, RunParamsOpts;
|
||||
Splash, MainBar, MainIntf, Designer, Debugger, RunParamsOpts;
|
||||
|
||||
type
|
||||
TResetToolFlag = (
|
||||
|
Loading…
Reference in New Issue
Block a user