From 371cccdf78fa9aaf49158ea57e598abcd5ff56f0 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Sun, 14 May 2017 11:13:43 +1000 Subject: 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 --- src/fltk-widgets-inputs-integer.adb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/fltk-widgets-inputs-integer.adb') 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; -- cgit