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 | 7b43c1dc40b498e884cb2de96d5d7436c577a510 (patch) | |
tree | f26bc21a56ad34f513faea0c0f5ef244433a1069 /src/fltk_binding/fltk-menu_items.adb | |
parent | 21c86679217e38ecbd0ec933e006e508a1a42be1 (diff) |
Menu shortcut keys and flags
Diffstat (limited to 'src/fltk_binding/fltk-menu_items.adb')
-rw-r--r-- | src/fltk_binding/fltk-menu_items.adb | 63 |
1 files changed, 59 insertions, 4 deletions
diff --git a/src/fltk_binding/fltk-menu_items.adb b/src/fltk_binding/fltk-menu_items.adb index 6620a64..b72d8c3 100644 --- a/src/fltk_binding/fltk-menu_items.adb +++ b/src/fltk_binding/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 |