Skip to content

Commit

Permalink
py menu api- fix for bottompane
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed Nov 4, 2016
1 parent d033409 commit 8f3c946
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/formmain_py.inc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ end;
function Py_MenuItemFromId(Str: string): TMenuItem;
const
cPrefixSidebar = 'side:';
cPrefixBottom = 'btm:';
cPrefixToolmenu = 'toolmenu:';
var
N: PtrInt;
Expand Down Expand Up @@ -85,6 +86,14 @@ begin
exit(FAppSidePanels[N].ItemMenu.Items);
end;

if SBeginsWith(Str, cPrefixBottom) then
begin
Delete(Str, 1, Length(cPrefixBottom));
N:= fmMain.DoBottom_CaptionToPanelsIndex(Str);
if N>=0 then
exit(FAppBottomPanels[N].ItemMenu.Items);
end;

if SBeginsWith(Str, cPrefixToolmenu) then
begin
for N:= 0 to fmMain.Toolbar.ButtonCount-1 do
Expand Down

0 comments on commit 8f3c946

Please sign in to comment.