aboutsummaryrefslogtreecommitdiff
path: root/body/fltk-widgets-menus-menu_buttons.adb
diff options
context:
space:
mode:
Diffstat (limited to 'body/fltk-widgets-menus-menu_buttons.adb')
-rw-r--r--body/fltk-widgets-menus-menu_buttons.adb42
1 files changed, 19 insertions, 23 deletions
diff --git a/body/fltk-widgets-menus-menu_buttons.adb b/body/fltk-widgets-menus-menu_buttons.adb
index b526e49..c305320 100644
--- a/body/fltk-widgets-menus-menu_buttons.adb
+++ b/body/fltk-widgets-menus-menu_buttons.adb
@@ -17,6 +17,8 @@ package body FLTK.Widgets.Menus.Menu_Buttons is
-- Functions From C --
------------------------
+ -- Allocation --
+
function new_fl_menu_button
(X, Y, W, H : in Interfaces.C.int;
Text : in Interfaces.C.char_array)
@@ -32,6 +34,8 @@ package body FLTK.Widgets.Menus.Menu_Buttons is
+ -- Popup --
+
function fl_menu_button_popup
(M : in Storage.Integer_Address)
return Storage.Integer_Address;
@@ -47,6 +51,8 @@ package body FLTK.Widgets.Menus.Menu_Buttons is
+ -- Drawing, Events --
+
procedure fl_menu_button_draw
(W : in Storage.Integer_Address);
pragma Import (C, fl_menu_button_draw, "fl_menu_button_draw");
@@ -62,6 +68,8 @@ package body FLTK.Widgets.Menus.Menu_Buttons is
+ -- Initialize --
+
function fl_menu_get_item
(M : in Storage.Integer_Address;
I : in Interfaces.C.int)
@@ -82,22 +90,6 @@ package body FLTK.Widgets.Menus.Menu_Buttons is
-- Destructors --
-------------------
- -- More magic
- procedure menu_button_extra_final_hook
- (Ada_Obj : in Storage.Integer_Address);
- pragma Export (C, menu_button_extra_final_hook, "menu_button_extra_final_hook");
-
- procedure menu_button_extra_final_hook
- (Ada_Obj : in Storage.Integer_Address)
- is
- My_Menu_Button : Menu_Button;
- for My_Menu_Button'Address use Storage.To_Address (Ada_Obj);
- pragma Import (Ada, My_Menu_Button);
- begin
- Extra_Final (My_Menu_Button);
- end menu_button_extra_final_hook;
-
-
procedure Extra_Final
(This : in out Menu_Button) is
begin
@@ -174,11 +166,11 @@ package body FLTK.Widgets.Menus.Menu_Buttons is
begin
return This : Menu_Button do
This.Void_Ptr := new_fl_menu_button
- (Interfaces.C.int (X),
- Interfaces.C.int (Y),
- Interfaces.C.int (W),
- Interfaces.C.int (H),
- Interfaces.C.To_C (Text));
+ (Interfaces.C.int (X),
+ Interfaces.C.int (Y),
+ Interfaces.C.int (W),
+ Interfaces.C.int (H),
+ Interfaces.C.To_C (Text));
Extra_Init (This, X, Y, W, H, Text);
end return;
end Create;
@@ -204,11 +196,13 @@ package body FLTK.Widgets.Menus.Menu_Buttons is
-- API Subprograms --
-----------------------
+ -- Popup --
+
function Get_Popup_Kind
(This : in Menu_Button)
return Popup_Buttons
is
- Result : Interfaces.C.unsigned_char := fl_widget_get_type (This.Void_Ptr);
+ Result : constant Interfaces.C.unsigned_char := fl_widget_get_type (This.Void_Ptr);
begin
return Popup_Buttons'Val (Result);
exception
@@ -231,7 +225,7 @@ package body FLTK.Widgets.Menus.Menu_Buttons is
return Extended_Index
is
use type Interfaces.C.int;
- Ptr : Storage.Integer_Address := fl_menu_button_popup (This.Void_Ptr);
+ Ptr : constant Storage.Integer_Address := fl_menu_button_popup (This.Void_Ptr);
begin
return Extended_Index (fl_menu_find_index2 (This.Void_Ptr, Ptr) + 1);
end Popup;
@@ -239,6 +233,8 @@ package body FLTK.Widgets.Menus.Menu_Buttons is
+ -- Drawing, Events --
+
procedure Draw
(This : in out Menu_Button) is
begin