summaryrefslogtreecommitdiff
path: root/src/displays.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/displays.adb')
-rw-r--r--src/displays.adb26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/displays.adb b/src/displays.adb
index 6931db9..0a3df2b 100644
--- a/src/displays.adb
+++ b/src/displays.adb
@@ -3,7 +3,8 @@
with
FLTK.Screen,
- FLTK.Event;
+ FLTK.Event,
+ Misc;
package body Displays is
@@ -15,26 +16,13 @@ package body Displays is
- function Max (A, B : in Integer) return Integer is
- begin
- if B > A then return B; else return A; end if;
- end Max;
-
- function Min (A, B : in Integer) return Integer is
- begin
- if B < A then return B; else return A; end if;
- end Min;
-
-
-
-
function Create
(X, Y, W, H : in Integer;
Text : in String)
return Display
is
- My_Width : Integer := Max (Message_Box_Width, W);
- My_Height : Integer := Max (Message_Box_Height + Stat_Box_Height, H);
+ My_Width : Integer := Misc.Max (Message_Box_Width, W);
+ My_Height : Integer := Misc.Max (Message_Box_Height + Stat_Box_Height, H);
begin
return This : Display :=
(WD.Double_Window'(WD.Create (X, Y, My_Width, My_Height, Text)) with
@@ -55,6 +43,8 @@ package body Displays is
This.Message_Box.Set_Label_Size (Text_Size);
This.Level_Box.Set_Label_Size (Text_Size);
This.Move_Box.Set_Label_Size (Text_Size);
+
+ This.Set_Icon (Logo);
end return;
end Create;
@@ -103,11 +93,11 @@ package body Displays is
(This : in out Display)
is
New_Width : Integer :=
- Max (Message_Box_Width, This.Current_Grid.Get_W);
+ Misc.Max (Message_Box_Width, This.Current_Grid.Get_W);
New_Height : Integer :=
Message_Box_Height + This.Current_Grid.Get_H + Stat_Box_Height;
Grid_X : Integer :=
- Max (0, (Message_Box_Width - This.Current_Grid.Get_W) / 2);
+ Misc.Max (0, (Message_Box_Width - This.Current_Grid.Get_W) / 2);
begin
This.Current_Grid.Reposition (Grid_X, 0);
This.Message_Box.Resize (New_Width, This.Message_Box.Get_H);