mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-02 16:39:56 +01:00
IDEIntf: add overloaded FindItemByCommand for IDE tool buttons
git-svn-id: trunk@50501 -
This commit is contained in:
parent
40b4ff88d3
commit
5fc913038b
@ -94,6 +94,7 @@ type
|
||||
function FindItemByName(const aName: string): TIDEButtonCommand;
|
||||
function FindItemByMenuPathOrName(var aName: string): TIDEButtonCommand;
|
||||
function FindItemByCommand(const aCommand: TIDECommand): TIDEButtonCommand;
|
||||
function FindItemByCommand(const aCommand: Word): TIDEButtonCommand;
|
||||
property Items[Index: Integer]: TIDEToolButtonCategory read GetItems; default;
|
||||
end;
|
||||
|
||||
@ -459,6 +460,19 @@ begin
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
function TIDEToolButtonCategories.FindItemByCommand(const aCommand: Word
|
||||
): TIDEButtonCommand;
|
||||
var
|
||||
i, l: Integer;
|
||||
begin
|
||||
for i := 0 to Count-1 do
|
||||
for l := 0 to Items[i].ButtonCount-1 do
|
||||
if Items[i].Buttons[l].Command.Command = aCommand then
|
||||
Exit(Items[i].Buttons[l]);
|
||||
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
function TIDEToolButtonCategories.FindItemByName(const aName: string
|
||||
): TIDEButtonCommand;
|
||||
var
|
||||
|
||||
Loading…
Reference in New Issue
Block a user