diff options
author | Jed Barber <jjbarber@y7mail.com> | 2016-07-20 15:45:15 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2016-07-20 15:45:15 +1000 |
commit | 501151d99cc8ec71eae7a3770ee3ba71c34cab18 (patch) | |
tree | dd4ccafe4b7fe9e65c83b12498802575e8b9e42c /fltk-menu_items.adb | |
parent | ab25b51036a810c326b51a230700971c0f431f74 (diff) |
Menu shortcut keys and flags
Diffstat (limited to 'fltk-menu_items.adb')
-rw-r--r-- | fltk-menu_items.adb | 63 |
1 files changed, 59 insertions, 4 deletions
diff --git a/fltk-menu_items.adb b/fltk-menu_items.adb index 6620a64..b72d8c3 100644 --- a/fltk-menu_items.adb +++ b/fltk-menu_items.adb @@ -8,6 +8,61 @@ use type System.Address; package body FLTK.Menu_Items is + function Create + (Key : Pressable_Key) + return Shortcut_Key is + begin + return This : Shortcut_Key do + This.Modifiers := Mod_None; + This.Keypress := Key; + end return; + end Create; + + + function "+" + (Left, Right : in Modifer_Key) + return Modifier_Key is + begin + return Left or Right; + end "+"; + + + function "+" + (Left : in Modifier_Key; + Right : in Pressable_Key) + return Shortcut_Key is + begin + return This : Shortcut_Key do + This.Modifiers := Left; + This.Keypress := Right; + end return; + end "+"; + + + function "+" + (Left : in Modifer_Key; + Right : in Shortcut_Key) + return Shortcut_Key is + begin + return This : Shortcut_Key do + This.Modifiers := Left or Right.Modifiers; + This.Keypress := Right.Keypress; + end return; + end "+"; + + + + + function "+" + (Left, Right : in Menu_Flag) + return Menu_Flag is + begin + return Left or Right; + end "+"; + + + + procedure Finalize (This : in out Menu_Item) is begin @@ -18,10 +73,10 @@ package body FLTK.Menu_Items is function Create - (Text : in String; - Shortcut : in Shortcut_Key; - Action : in FLTK.Callbacks.Callback; - Flags : Menu_Flag) + (Text : in String; + Action : in FLTK.Callbacks.Callback; + Shortcut : in Shortcut_Key := No_Key; + Flags : in Menu_Flag := Flag_Normal) return Menu_Item is begin return This : Menu_Item do |