summaryrefslogtreecommitdiff
path: root/src/windows-about.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/windows-about.adb')
-rw-r--r--src/windows-about.adb99
1 files changed, 99 insertions, 0 deletions
diff --git a/src/windows-about.adb b/src/windows-about.adb
new file mode 100644
index 0000000..a0845b8
--- /dev/null
+++ b/src/windows-about.adb
@@ -0,0 +1,99 @@
+
+
+with FLTK.Widgets;
+with FLTK.Widgets.Groups.Windows.Double;
+with FLTK.Widgets.Boxes;
+with FLTK.Widgets.Buttons.Enter;
+
+
+package body Windows.About is
+
+
+ package W renames FLTK.Widgets;
+ package WD renames FLTK.Widgets.Groups.Windows.Double;
+ package BX renames FLTK.Widgets.Boxes;
+ package EN renames FLTK.Widgets.Buttons.Enter;
+
+
+
+
+ function Create
+ return About_Window
+ is
+ My_Width : Integer := 350;
+ My_Height : Integer := 250;
+
+ Logo_Line : Integer := 30;
+ Logo_Width : Integer := 50;
+ Logo_Height : Integer := 50;
+
+ Button_Width : Integer := 140;
+ Button_Height : Integer := 40;
+
+ Heading_Line : Integer := 90;
+ Blurb_Line : Integer := 132;
+ Author_Line : Integer := 157;
+ Button_Line : Integer := 190;
+
+ Heading_Size : Integer := 22;
+ Text_Size : Integer := 12;
+
+ Heading_Text : String := "Adapad 0.5";
+ Blurb_Text : String := "FLTK based simple text editor written in Ada";
+ Author_Text : String := "Programmed by Jed Barber";
+ begin
+ return This : About_Window :=
+ (WD.Double_Window'(WD.Create (0, 0, My_Width, My_Height, "About Adapad")) with
+
+ Picture => BX.Box'(BX.Create
+ ((My_Width - Logo_Width) / 2,
+ Logo_Line, Logo_Width, Logo_Height, "")),
+ Heading => BX.Box'(BX.Create
+ (0, Heading_Line, My_Width, Heading_Size, Heading_Text)),
+ Blurb => BX.Box'(BX.Create
+ (0, Blurb_Line, My_Width, Text_Size, Blurb_Text)),
+ Author => BX.Box'(BX.Create
+ (0, Author_Line, My_Width, Text_Size, Author_Text)),
+ Dismiss => EN.Enter_Button'(EN.Create
+ ((My_Width - Button_Width) / 2,
+ Button_Line, Button_Width, Button_Height, "Close"))) do
+
+ This.Add (This.Picture);
+ This.Picture.Set_Image (Logo);
+ This.Add (This.Heading);
+ This.Heading.Set_Label_Size (W.Font_Size (Heading_Size));
+ This.Add (This.Blurb);
+ This.Add (This.Author);
+ This.Add (This.Dismiss);
+ This.Dismiss.Set_Callback (Hide_CB'Access);
+
+ This.Set_Callback (Hide_CB'Access);
+ This.Set_Icon (Logo);
+ This.Set_Modal;
+ end return;
+ end Create;
+
+
+
+
+ function Create
+ (X, Y, W, H : in Integer;
+ Label_Text : in String)
+ return About_Window is
+ begin
+ return Create;
+ end Create;
+
+
+
+
+ function Create
+ (W, H : in Integer)
+ return About_Window is
+ begin
+ return Create;
+ end Create;
+
+
+end Windows.About;
+