aboutsummaryrefslogtreecommitdiff
path: root/body/fltk-widgets-valuators.adb
diff options
context:
space:
mode:
Diffstat (limited to 'body/fltk-widgets-valuators.adb')
-rw-r--r--body/fltk-widgets-valuators.adb32
1 files changed, 25 insertions, 7 deletions
diff --git a/body/fltk-widgets-valuators.adb b/body/fltk-widgets-valuators.adb
index 0cf8d65..c762fe4 100644
--- a/body/fltk-widgets-valuators.adb
+++ b/body/fltk-widgets-valuators.adb
@@ -26,6 +26,8 @@ package body FLTK.Widgets.Valuators is
-- Functions From C --
------------------------
+ -- Allocation --
+
function new_fl_valuator
(X, Y, W, H : in Interfaces.C.int;
Text : in Interfaces.C.char_array)
@@ -41,6 +43,8 @@ package body FLTK.Widgets.Valuators is
+ -- Formatting --
+
function fl_valuator_format
(V : in Storage.Integer_Address;
B : out Interfaces.C.char_array)
@@ -51,6 +55,8 @@ package body FLTK.Widgets.Valuators is
+ -- Calculation --
+
function fl_valuator_clamp
(V : in Storage.Integer_Address;
D : in Interfaces.C.double)
@@ -76,6 +82,8 @@ package body FLTK.Widgets.Valuators is
+ -- Settings, Value --
+
function fl_valuator_get_minimum
(V : in Storage.Integer_Address)
return Interfaces.C.double;
@@ -158,6 +166,8 @@ package body FLTK.Widgets.Valuators is
+ -- Drawing, Events --
+
procedure fl_valuator_value_damage
(V : in Storage.Integer_Address);
pragma Import (C, fl_valuator_value_damage, "fl_valuator_value_damage");
@@ -200,7 +210,7 @@ package body FLTK.Widgets.Valuators is
declare
-- God this whole Format method is sketchy as hell.
-- ...what? This is the area to declare things and that needed declaring.
- String_Result : String := Ada_Obj.Format;
+ String_Result : constant String := Ada_Obj.Format;
begin
if String_Result'Length <= FLTK.Buffer_Size then
Interfaces.C.Strings.Update (Buffer, 0, Interfaces.C.To_C (String_Result), False);
@@ -273,11 +283,11 @@ package body FLTK.Widgets.Valuators is
begin
return This : Valuator do
This.Void_Ptr := new_fl_valuator
- (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;
@@ -303,13 +313,15 @@ package body FLTK.Widgets.Valuators is
-- API Subprograms --
-----------------------
+ -- Formatting --
+
function Format
(This : in Valuator)
return String
is
Buffer : Interfaces.C.char_array :=
(1 .. Interfaces.C.size_t (FLTK.Buffer_Size) => Interfaces.C.To_C (Character'Val (0)));
- Result : Interfaces.C.int := fl_valuator_format (This.Void_Ptr, Buffer);
+ Result : constant Interfaces.C.int := fl_valuator_format (This.Void_Ptr, Buffer);
begin
return Interfaces.C.To_Ada (Buffer (1 .. Interfaces.C.size_t (Result)), False);
end Format;
@@ -317,6 +329,8 @@ package body FLTK.Widgets.Valuators is
+ -- Calculation --
+
function Clamp
(This : in Valuator;
Input : in Long_Float)
@@ -350,6 +364,8 @@ package body FLTK.Widgets.Valuators is
+ -- Settings, Value --
+
function Get_Minimum
(This : in Valuator)
return Long_Float is
@@ -470,6 +486,8 @@ package body FLTK.Widgets.Valuators is
+ -- Drawing --
+
procedure Value_Damage
(This : in out Valuator) is
begin