diff options
Diffstat (limited to 'src/windows-jump.adb')
-rw-r--r-- | src/windows-jump.adb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/windows-jump.adb b/src/windows-jump.adb index f19315e..baa4171 100644 --- a/src/windows-jump.adb +++ b/src/windows-jump.adb @@ -7,7 +7,7 @@ package body Windows.Jump is package WD renames FLTK.Widgets.Groups.Windows.Double; package BU renames FLTK.Widgets.Buttons; package EN renames FLTK.Widgets.Buttons.Enter; - package IT renames FLTK.Widgets.Inputs.Integer; + package IT renames FLTK.Widgets.Inputs.Text.Whole_Number; @@ -18,10 +18,16 @@ package body Windows.Jump is type Jump_Window_Access is access all Jump_Window; Dialog : access Jump_Window := Jump_Window_Access (Item.Parent); - Line : Integer := Dialog.To_Line.Get_Value; + Line : Long_Integer := Dialog.To_Line.Get_Value; begin - if Dialog.Callback /= null and Line > 0 then - Dialog.Callback.all (Line); + if Dialog.Callback /= null then + if Line <= 0 then + Dialog.Callback (1); + elsif Line > Long_Integer (Integer'Last) then + Dialog.Callback (Integer'Last); + else + Dialog.Callback (Integer (Line)); + end if; end if; end Jump_M; |