summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-inputs-integer.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-05-14 11:13:43 +1000
committerJed Barber <jjbarber@y7mail.com>2017-05-14 11:13:43 +1000
commit371cccdf78fa9aaf49158ea57e598abcd5ff56f0 (patch)
treee2769d0bc627f498e51aad2ef720d0926d0a626a /src/fltk-widgets-inputs-integer.adb
parentf4b68da1d14d39ab4140d8c5e7fbbf45525e7e77 (diff)
File_Input, Float_Input, Integer_Input, Multiline_Input, Output, Multiline_Output, Secret_Input, Input, Menu, Menu_Bar, Menu_Button widgets all now have a Handle method
Diffstat (limited to 'src/fltk-widgets-inputs-integer.adb')
-rw-r--r--src/fltk-widgets-inputs-integer.adb23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/fltk-widgets-inputs-integer.adb b/src/fltk-widgets-inputs-integer.adb
index 92e95ec..5e2eb40 100644
--- a/src/fltk-widgets-inputs-integer.adb
+++ b/src/fltk-widgets-inputs-integer.adb
@@ -12,10 +12,20 @@ package body FLTK.Widgets.Inputs.Integer is
(W, D : in System.Address);
pragma Import (C, int_input_set_draw_hook, "int_input_set_draw_hook");
+ procedure int_input_set_handle_hook
+ (W, H : in System.Address);
+ pragma Import (C, int_input_set_handle_hook, "int_input_set_handle_hook");
+
procedure fl_int_input_draw
(W : in System.Address);
pragma Import (C, fl_int_input_draw, "fl_int_input_draw");
+ function fl_int_input_handle
+ (W : in System.Address;
+ E : in Interfaces.C.int)
+ return Interfaces.C.int;
+ pragma Import (C, fl_int_input_handle, "fl_int_input_handle");
+
function new_fl_int_input
(X, Y, W, H : in Interfaces.C.int;
Text : in Interfaces.C.char_array)
@@ -56,6 +66,18 @@ package body FLTK.Widgets.Inputs.Integer is
+ function Handle
+ (This : in out Integer_Input;
+ Event : in Event_Kind)
+ return Event_Outcome is
+ begin
+ return Event_Outcome'Val
+ (fl_int_input_handle (This.Void_Ptr, Event_Kind'Pos (Event)));
+ end Handle;
+
+
+
+
procedure Finalize
(This : in out Integer_Input) is
begin
@@ -87,6 +109,7 @@ package body FLTK.Widgets.Inputs.Integer is
(This.Void_Ptr,
Widget_Convert.To_Address (This'Unchecked_Access));
int_input_set_draw_hook (This.Void_Ptr, Draw_Hook'Address);
+ int_input_set_handle_hook (This.Void_Ptr, Handle_Hook'Address);
end return;
end Create;