aboutsummaryrefslogtreecommitdiff
path: root/src/displays.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/displays.adb')
-rw-r--r--src/displays.adb46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/displays.adb b/src/displays.adb
index 468ca70..6c33171 100644
--- a/src/displays.adb
+++ b/src/displays.adb
@@ -3,15 +3,14 @@
with
FLTK.Screen,
- FLTK.Events,
- Misc;
+ FLTK.Events;
package body Displays is
package WD renames FLTK.Widgets.Groups.Windows.Double;
- package B renames FLTK.Widgets.Boxes;
+ package B renames FLTK.Widgets.Boxes;
@@ -21,25 +20,26 @@ package body Displays is
Text : in String)
return Display
is
- My_Width : Integer := Misc.Max (Message_Box_Width, W);
- My_Height : Integer := Misc.Max (Message_Box_Height + Stat_Box_Height, H);
+ My_Width : constant Integer := Misc.Max (Message_Box_Width, W);
+ My_Height : constant Integer := Misc.Max (Message_Box_Height + Stat_Box_Height, H);
begin
return This : Display :=
- (WD.Double_Window'(WD.Forge.Create (X, Y, My_Width, My_Height, Text)) with
-
- Message_Box => B.Box'(B.Forge.Create
- (0, 0, Message_Box_Width, Message_Box_Height, "")),
- Level_Box => B.Box'(B.Forge.Create
- (0, Message_Box_Height, Stat_Box_Width, Stat_Box_Height, "")),
- Move_Box => B.Box'(B.Forge.Create
- (Stat_Box_Width, Message_Box_Height, Stat_Box_Width, Stat_Box_Height, "")),
- Current_Grid => null,
- Key_Func => null,
- Mouse_Func => null) do
-
+ (WD.Forge.Create (X, Y, My_Width, My_Height, Text)
+ with
+ Message_Box => B.Forge.Create
+ (0, 0, Message_Box_Width, Message_Box_Height, ""),
+ Level_Box => B.Forge.Create
+ (0, Message_Box_Height, Stat_Box_Width, Stat_Box_Height, ""),
+ Move_Box => B.Forge.Create
+ (Stat_Box_Width, Message_Box_Height, Stat_Box_Width, Stat_Box_Height, ""),
+ Current_Grid => null,
+ Key_Func => null,
+ Mouse_Func => null)
+ do
This.Add (This.Message_Box);
This.Add (This.Level_Box);
This.Add (This.Move_Box);
+
This.Message_Box.Set_Label_Size (Text_Size);
This.Level_Box.Set_Label_Size (Text_Size);
This.Move_Box.Set_Label_Size (Text_Size);
@@ -92,11 +92,11 @@ package body Displays is
procedure Ensure_Correct_Size
(This : in out Display)
is
- New_Width : Integer :=
+ New_Width : constant Integer :=
Misc.Max (Message_Box_Width, This.Current_Grid.Get_W);
- New_Height : Integer :=
+ New_Height : constant Integer :=
Message_Box_Height + This.Current_Grid.Get_H + Stat_Box_Height;
- Grid_X : Integer :=
+ Grid_X : constant Integer :=
Misc.Max (0, (Message_Box_Width - This.Current_Grid.Get_W) / 2);
begin
This.Current_Grid.Reposition (Grid_X, 0);
@@ -178,12 +178,11 @@ package body Displays is
This.Key_Func (FLTK.Press (FLTK.Events.Last_Key)) = FLTK.Handled
then
return FLTK.Handled;
-
- elsif This.Mouse_Func /= null and then Event = FLTK.Release and then
+ elsif
+ This.Mouse_Func /= null and then Event = FLTK.Release and then
This.Mouse_Func (FLTK.Events.Mouse_X, FLTK.Events.Mouse_Y) = FLTK.Handled
then
return FLTK.Handled;
-
else
return WD.Double_Window (This).Handle (Event);
end if;
@@ -192,3 +191,4 @@ package body Displays is
end Displays;
+