mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-17 07:28:19 +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);
|
SrcEditMenuInspect.Tag := Ord(ddtInspect);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDebugManager.SetupMainBarShortCuts;
|
function GetCommand(ACommand: word): TIDECommand;
|
||||||
|
|
||||||
function GetCmdAndBtn(ACommand: word; out ToolButton: TIDEButtonCommand): TIDECommand;
|
|
||||||
begin
|
begin
|
||||||
Result:=IDECommandList.FindIDECommand(ACommand);
|
Result:=IDECommandList.FindIDECommand(ACommand);
|
||||||
if Result<>nil then
|
if Result<>nil then
|
||||||
ToolButton := RegisterIDEButtonCommand(Result)
|
RegisterIDEButtonCommand(Result);
|
||||||
else
|
|
||||||
ToolButton := nil;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function GetCommand(ACommand: word): TIDECommand;
|
|
||||||
var
|
|
||||||
ToolButton: TIDEButtonCommand;
|
|
||||||
begin
|
|
||||||
Result:=GetCmdAndBtn(ACommand, ToolButton);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TDebugManager.SetupMainBarShortCuts;
|
||||||
begin
|
begin
|
||||||
with MainIDEBar do
|
with MainIDEBar do
|
||||||
begin
|
begin
|
||||||
@ -2064,23 +2054,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDebugManager.SetupSourceMenuShortCuts;
|
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
|
begin
|
||||||
SrcEditMenuToggleBreakpoint.Command:=GetCommand(ecToggleBreakPoint);
|
SrcEditMenuToggleBreakpoint.Command:=GetCommand(ecToggleBreakPoint);
|
||||||
SrcEditMenuRunToCursor.Command:=GetCommand(ecRunToCursor);
|
SrcEditMenuRunToCursor.Command:=GetCommand(ecRunToCursor);
|
||||||
|
@ -72,7 +72,7 @@ uses
|
|||||||
// IDE
|
// IDE
|
||||||
LazConf, LazarusIDEStrConsts, Project, BuildManager, EnvironmentOpts,
|
LazConf, LazarusIDEStrConsts, Project, BuildManager, EnvironmentOpts,
|
||||||
EditorOptions, CompilerOptions, SourceEditor, SourceSynEditor, FindInFilesDlg,
|
EditorOptions, CompilerOptions, SourceEditor, SourceSynEditor, FindInFilesDlg,
|
||||||
DesktopManager, Splash, MainBar, MainIntf, Designer, Debugger, RunParamsOpts;
|
Splash, MainBar, MainIntf, Designer, Debugger, RunParamsOpts;
|
||||||
|
|
||||||
type
|
type
|
||||||
TResetToolFlag = (
|
TResetToolFlag = (
|
||||||
|
Loading…
Reference in New Issue
Block a user