mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 22:29:25 +02:00
Improves fpgui menus
git-svn-id: trunk@15294 -
This commit is contained in:
parent
372a450379
commit
867475552a
@ -53,6 +53,7 @@ type
|
||||
public
|
||||
MenuItem: TfpgMenuItem;
|
||||
LCLMenuItem: TMenuItem;
|
||||
procedure HandleOnClick(ASender: TObject);
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -64,5 +65,13 @@ begin
|
||||
fpgCanvas := AfpgCanvas;
|
||||
end;
|
||||
|
||||
{ TFPGUIPrivateMenuItem }
|
||||
|
||||
procedure TFPGUIPrivateMenuItem.HandleOnClick(ASender: TObject);
|
||||
begin
|
||||
if Assigned(LCLMenuItem) and Assigned(LCLMenuItem.OnClick) then
|
||||
LCLMenuItem.OnClick(LCLMenuItem);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
}
|
||||
unit FpGuiWSMenus;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
@ -146,7 +146,7 @@ begin
|
||||
Menu := TFPGUIPrivateMenuItem.Create;
|
||||
Menu.LCLMenuItem := AMenuItem;
|
||||
ParentMenuBar := TfpgMenuBar(AMenuItem.GetParentMenu.Handle);
|
||||
Menu.MenuItem := ParentMenuBar.AddMenuItem(AMenuName, nil);
|
||||
Menu.MenuItem := ParentMenuBar.AddMenuItem(AMenuName, Menu.HandleOnClick);
|
||||
Result := HMENU(Menu);
|
||||
end
|
||||
{ ParentPrivatePopUp := TFPGUIPrivatePopUpMenu(LCLMenuItem.Parent.Handle);
|
||||
@ -159,7 +159,7 @@ begin
|
||||
Menu := TFPGUIPrivateMenuItem.Create;
|
||||
Menu.LCLMenuItem := AMenuItem;
|
||||
ParentPrivateItem := TFPGUIPrivateMenuItem(AMenuItem.Parent.Handle);
|
||||
Menu.MenuItem := ParentPrivateItem.MenuItem.SubMenu.AddMenuItem(AMenuName, '', nil);
|
||||
Menu.MenuItem := ParentPrivateItem.MenuItem.SubMenu.AddMenuItem(AMenuName, '', Menu.HandleOnClick);
|
||||
Result := HMENU(Menu);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user