summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-buttons-repeat.adb
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2025-01-12 01:14:58 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2025-01-12 01:14:58 +1300
commite93b9bbc02e2791f3a35b6f077fcbb8514c28aed (patch)
tree3661530027db6809a9cbad7b2477416009e00787 /src/fltk-widgets-buttons-repeat.adb
parent53aa8144851913994b963ed611cca8885b8f9a9e (diff)
Refactored draw/handle methods in Widgets hierarchy, improved docs, added a few minor method bindings here and there
Diffstat (limited to 'src/fltk-widgets-buttons-repeat.adb')
-rw-r--r--src/fltk-widgets-buttons-repeat.adb59
1 files changed, 38 insertions, 21 deletions
diff --git a/src/fltk-widgets-buttons-repeat.adb b/src/fltk-widgets-buttons-repeat.adb
index 9446a22..e3d2d69 100644
--- a/src/fltk-widgets-buttons-repeat.adb
+++ b/src/fltk-widgets-buttons-repeat.adb
@@ -12,18 +12,9 @@ with
package body FLTK.Widgets.Buttons.Repeat is
- procedure repeat_button_set_draw_hook
- (W, D : in Storage.Integer_Address);
- pragma Import (C, repeat_button_set_draw_hook, "repeat_button_set_draw_hook");
- pragma Inline (repeat_button_set_draw_hook);
-
- procedure repeat_button_set_handle_hook
- (W, H : in Storage.Integer_Address);
- pragma Import (C, repeat_button_set_handle_hook, "repeat_button_set_handle_hook");
- pragma Inline (repeat_button_set_handle_hook);
-
-
-
+ ------------------------
+ -- Functions From C --
+ ------------------------
function new_fl_repeat_button
(X, Y, W, H : in Interfaces.C.int;
@@ -40,6 +31,14 @@ package body FLTK.Widgets.Buttons.Repeat is
+ procedure fl_repeat_button_deactivate
+ (B : in Storage.Integer_Address);
+ pragma Import (C, fl_repeat_button_deactivate, "fl_repeat_button_deactivate");
+ pragma Inline (fl_repeat_button_deactivate);
+
+
+
+
procedure fl_repeat_button_draw
(W : in Storage.Integer_Address);
pragma Import (C, fl_repeat_button_draw, "fl_repeat_button_draw");
@@ -55,6 +54,10 @@ package body FLTK.Widgets.Buttons.Repeat is
+ -------------------
+ -- Destructors --
+ -------------------
+
procedure Extra_Final
(This : in out Repeat_Button) is
begin
@@ -75,6 +78,10 @@ package body FLTK.Widgets.Buttons.Repeat is
+ --------------------
+ -- Constructors --
+ --------------------
+
procedure Extra_Init
(This : in out Repeat_Button;
X, Y, W, H : in Integer;
@@ -84,6 +91,14 @@ package body FLTK.Widgets.Buttons.Repeat is
end Extra_Init;
+ procedure Initialize
+ (This : in out Repeat_Button) is
+ begin
+ This.Draw_Ptr := fl_repeat_button_draw'Address;
+ This.Handle_Ptr := fl_repeat_button_handle'Address;
+ end Initialize;
+
+
package body Forge is
function Create
@@ -99,10 +114,6 @@ package body FLTK.Widgets.Buttons.Repeat is
Interfaces.C.int (H),
Interfaces.C.To_C (Text));
Extra_Init (This, X, Y, W, H, Text);
- repeat_button_set_draw_hook
- (This.Void_Ptr, Storage.To_Integer (Draw_Hook'Address));
- repeat_button_set_handle_hook
- (This.Void_Ptr, Storage.To_Integer (Handle_Hook'Address));
end return;
end Create;
@@ -111,11 +122,17 @@ package body FLTK.Widgets.Buttons.Repeat is
- procedure Draw
+ -----------------------
+ -- API Subprograms --
+ -----------------------
+
+ procedure Deactivate
(This : in out Repeat_Button) is
begin
- fl_repeat_button_draw (This.Void_Ptr);
- end Draw;
+ fl_repeat_button_deactivate (This.Void_Ptr);
+ end Deactivate;
+
+
function Handle
@@ -123,10 +140,10 @@ package body FLTK.Widgets.Buttons.Repeat is
Event : in Event_Kind)
return Event_Outcome is
begin
- return Event_Outcome'Val
- (fl_repeat_button_handle (This.Void_Ptr, Event_Kind'Pos (Event)));
+ return Button (This).Handle (Event);
end Handle;
end FLTK.Widgets.Buttons.Repeat;
+