summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2013-04-08 01:41:02 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2013-04-08 01:41:02 +0100
commit274c52a488fe61036ed8cb520c7d2c15412bc827 (patch)
treed2f25bcdc77ad0d9c4a3354bedfd420928e04d26
parent4a16290513e9719cf71987da9b325d0534dde54f (diff)
downloadfpGUI-274c52a488fe61036ed8cb520c7d2c15412bc827.tar.xz
popupmenu: Adds a convenience function AddSeparator()
I like less typing. ;-)
-rw-r--r--src/gui/fpg_menu.pas6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/fpg_menu.pas b/src/gui/fpg_menu.pas
index 8da9302f..91db5992 100644
--- a/src/gui/fpg_menu.pas
+++ b/src/gui/fpg_menu.pas
@@ -135,6 +135,7 @@ type
destructor Destroy; override;
procedure Close; override;
function AddMenuItem(const AMenuName: TfpgString; const hotkeydef: string; OnClickProc: TNotifyEvent): TfpgMenuItem;
+ procedure AddSeparator;
function MenuItemByName(const AMenuName: TfpgString): TfpgMenuItem;
function MenuItem(const AMenuPos: integer): TfpgMenuItem; // added to allow for localization
property BeforeShow: TNotifyEvent read FBeforeShow write FBeforeShow;
@@ -1406,6 +1407,11 @@ begin
end;
end;
+procedure TfpgPopupMenu.AddSeparator;
+begin
+ AddMenuitem('-', '', nil);
+end;
+
function TfpgPopupMenu.MenuItemByName(const AMenuName: TfpgString): TfpgMenuItem;
var
i: integer;