summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2018-03-20 14:21:51 +1100
committerJed Barber <jjbarber@y7mail.com>2018-03-20 14:21:51 +1100
commitc53eec6b06e8a30a8e718d3955892a245f89a2f6 (patch)
tree894702d046c3d561d36ba6a948738cfbe3e8838e /src
parent09d9f2f6fc83af3bdc76717941eb13b77b2b1613 (diff)
Progress updated, Buttons and Menu_Buttons finished
Diffstat (limited to 'src')
-rw-r--r--src/c_fl_button.cpp20
-rw-r--r--src/c_fl_button.h6
-rw-r--r--src/c_fl_menu_button.cpp5
-rw-r--r--src/c_fl_menu_button.h1
-rw-r--r--src/fltk-widgets-buttons.adb57
-rw-r--r--src/fltk-widgets-buttons.ads19
-rw-r--r--src/fltk-widgets-menus-menu_buttons.adb15
-rw-r--r--src/fltk-widgets-menus-menu_buttons.ads9
8 files changed, 132 insertions, 0 deletions
diff --git a/src/c_fl_button.cpp b/src/c_fl_button.cpp
index 5aa06c4..bdd3eb3 100644
--- a/src/c_fl_button.cpp
+++ b/src/c_fl_button.cpp
@@ -82,3 +82,23 @@ void fl_button_set_only(BUTTON b) {
reinterpret_cast<Fl_Button*>(b)->setonly();
}
+
+
+
+int fl_button_get_down_box(BUTTON b) {
+ return reinterpret_cast<Fl_Button*>(b)->down_box();
+}
+
+void fl_button_set_down_box(BUTTON b, int t) {
+ reinterpret_cast<Fl_Button*>(b)->down_box(static_cast<Fl_Boxtype>(t));
+}
+
+int fl_button_get_shortcut(BUTTON b) {
+ return reinterpret_cast<Fl_Button*>(b)->shortcut();
+}
+
+void fl_button_set_shortcut(BUTTON b, int k) {
+ reinterpret_cast<Fl_Button*>(b)->shortcut(k);
+}
+
+
diff --git a/src/c_fl_button.h b/src/c_fl_button.h
index 7209ab6..33120ad 100644
--- a/src/c_fl_button.h
+++ b/src/c_fl_button.h
@@ -30,5 +30,11 @@ extern "C" void fl_button_set_state(BUTTON b, int s);
extern "C" void fl_button_set_only(BUTTON b);
+extern "C" int fl_button_get_down_box(BUTTON b);
+extern "C" void fl_button_set_down_box(BUTTON b, int t);
+extern "C" int fl_button_get_shortcut(BUTTON b);
+extern "C" void fl_button_set_shortcut(BUTTON b, int k);
+
+
#endif
diff --git a/src/c_fl_menu_button.cpp b/src/c_fl_menu_button.cpp
index d4ff176..b08c36f 100644
--- a/src/c_fl_menu_button.cpp
+++ b/src/c_fl_menu_button.cpp
@@ -74,3 +74,8 @@ void fl_menu_button_type(MENUBUTTON m, unsigned int t) {
reinterpret_cast<Fl_Menu_Button*>(m)->type(t);
}
+const void * fl_menu_button_popup(MENUBUTTON m) {
+ return reinterpret_cast<Fl_Menu_Button*>(m)->popup();
+}
+
+
diff --git a/src/c_fl_menu_button.h b/src/c_fl_menu_button.h
index 505723d..8013bf9 100644
--- a/src/c_fl_menu_button.h
+++ b/src/c_fl_menu_button.h
@@ -26,6 +26,7 @@ extern "C" void free_fl_menu_button(MENUBUTTON m);
extern "C" void fl_menu_button_type(MENUBUTTON m, unsigned int t);
+extern "C" const void * fl_menu_button_popup(MENUBUTTON m);
#endif
diff --git a/src/fltk-widgets-buttons.adb b/src/fltk-widgets-buttons.adb
index 5e7e18c..9024f8e 100644
--- a/src/fltk-widgets-buttons.adb
+++ b/src/fltk-widgets-buttons.adb
@@ -54,6 +54,29 @@ package body FLTK.Widgets.Buttons is
+ function fl_button_get_down_box
+ (B : in System.Address)
+ return Interfaces.C.int;
+ pragma Import (C, fl_button_get_down_box, "fl_button_get_down_box");
+
+ procedure fl_button_set_down_box
+ (B : in System.Address;
+ T : in Interfaces.C.int);
+ pragma Import (C, fl_button_set_down_box, "fl_button_set_down_box");
+
+ function fl_button_get_shortcut
+ (B : in System.Address)
+ return Interfaces.C.int;
+ pragma Import (C, fl_button_get_shortcut, "fl_button_get_shortcut");
+
+ procedure fl_button_set_shortcut
+ (B : in System.Address;
+ T : in Interfaces.C.int);
+ pragma Import (C, fl_button_set_shortcut, "fl_button_set_shortcut");
+
+
+
+
procedure fl_button_draw
(W : in System.Address);
pragma Import (C, fl_button_draw, "fl_button_draw");
@@ -134,6 +157,40 @@ package body FLTK.Widgets.Buttons is
+ function Get_Down_Box
+ (This : in Button)
+ return Box_Kind is
+ begin
+ return Box_Kind'Val (fl_button_get_down_box (This.Void_Ptr));
+ end Get_Down_Box;
+
+
+ procedure Set_Down_Box
+ (This : in out Button;
+ To : in Box_Kind) is
+ begin
+ fl_button_set_down_box (This.Void_Ptr, Box_Kind'Pos (To));
+ end Set_Down_Box;
+
+
+ function Get_Shortcut
+ (This : in Button)
+ return Shortcut_Key is
+ begin
+ return C_To_Key (Interfaces.C.unsigned_long (fl_button_get_shortcut (This.Void_Ptr)));
+ end Get_Shortcut;
+
+
+ procedure Set_Shortcut
+ (This : in out Button;
+ Key : in Shortcut_Key) is
+ begin
+ fl_button_set_shortcut (This.Void_Ptr, Interfaces.C.int (Key_To_C (Key)));
+ end Set_Shortcut;
+
+
+
+
procedure Draw
(This : in out Button) is
begin
diff --git a/src/fltk-widgets-buttons.ads b/src/fltk-widgets-buttons.ads
index 55d75c6..f740b32 100644
--- a/src/fltk-widgets-buttons.ads
+++ b/src/fltk-widgets-buttons.ads
@@ -36,6 +36,25 @@ package FLTK.Widgets.Buttons is
+ function Get_Down_Box
+ (This : in Button)
+ return Box_Kind;
+
+ procedure Set_Down_Box
+ (This : in out Button;
+ To : in Box_Kind);
+
+ function Get_Shortcut
+ (This : in Button)
+ return Shortcut_Key;
+
+ procedure Set_Shortcut
+ (This : in out Button;
+ Key : in Shortcut_Key);
+
+
+
+
procedure Draw
(This : in out Button);
diff --git a/src/fltk-widgets-menus-menu_buttons.adb b/src/fltk-widgets-menus-menu_buttons.adb
index 8c39887..9b6d1cb 100644
--- a/src/fltk-widgets-menus-menu_buttons.adb
+++ b/src/fltk-widgets-menus-menu_buttons.adb
@@ -42,6 +42,11 @@ package body FLTK.Widgets.Menus.Menu_Buttons is
T : in Interfaces.C.unsigned);
pragma Import (C, fl_menu_button_type, "fl_menu_button_type");
+ function fl_menu_button_popup
+ (M : in System.Address)
+ return System.Address;
+ pragma Import (C, fl_menu_button_popup, "fl_menu_button_popup");
+
@@ -110,6 +115,16 @@ package body FLTK.Widgets.Menus.Menu_Buttons is
end Set_Popup_Kind;
+ function Popup
+ (This : in out Menu_Button)
+ return FLTK.Menu_Items.Menu_Item is
+ begin
+ return Item : FLTK.Menu_Items.Menu_Item do
+ Wrapper (Item).Void_Ptr := fl_menu_button_popup (This.Void_Ptr);
+ end return;
+ end Popup;
+
+
procedure Draw
diff --git a/src/fltk-widgets-menus-menu_buttons.ads b/src/fltk-widgets-menus-menu_buttons.ads
index fe1092a..f7bba64 100644
--- a/src/fltk-widgets-menus-menu_buttons.ads
+++ b/src/fltk-widgets-menus-menu_buttons.ads
@@ -1,5 +1,10 @@
+with
+
+ FLTK.Menu_Items;
+
+
package FLTK.Widgets.Menus.Menu_Buttons is
@@ -30,6 +35,10 @@ package FLTK.Widgets.Menus.Menu_Buttons is
(This : in out Menu_Button;
Pop : in Popup_Buttons);
+ function Popup
+ (This : in out Menu_Button)
+ return FLTK.Menu_Items.Menu_Item;
+