diff options
author | Jed Barber <jjbarber@y7mail.com> | 2017-07-28 00:03:19 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2017-07-28 00:03:19 +1000 |
commit | ede7482f170d498d0a2129da6e81ff4764e366e2 (patch) | |
tree | 793de3ccbc1e2045e52ce6bb7402e08dfe1ec14f /src | |
parent | bfa8e44514a6d0e597123aa701dbe29a461c1ed6 (diff) |
Logo file now better integrated
Diffstat (limited to 'src')
-rw-r--r-- | src/adapad.adb | 13 | ||||
-rw-r--r-- | src/adapad.ads | 7 | ||||
-rw-r--r-- | src/main.adb | 13 | ||||
-rw-r--r-- | src/windows-about.adb | 13 | ||||
-rw-r--r-- | src/windows-about.ads | 9 | ||||
-rw-r--r-- | src/windows-editor.adb | 1 | ||||
-rw-r--r-- | src/windows-editor.ads | 4 | ||||
-rw-r--r-- | src/windows-find.adb | 1 | ||||
-rw-r--r-- | src/windows-find.ads | 4 | ||||
-rw-r--r-- | src/windows-jump.adb | 1 | ||||
-rw-r--r-- | src/windows-jump.ads | 4 | ||||
-rw-r--r-- | src/windows-replace.adb | 1 | ||||
-rw-r--r-- | src/windows-replace.ads | 4 | ||||
-rw-r--r-- | src/windows.adb | 10 | ||||
-rw-r--r-- | src/windows.ads | 12 |
15 files changed, 77 insertions, 20 deletions
diff --git a/src/adapad.adb b/src/adapad.adb index c9ff4e3..6a725c3 100644 --- a/src/adapad.adb +++ b/src/adapad.adb @@ -47,6 +47,19 @@ package body Adapad is -- main program interface + procedure Set_Logo + (Pic : in out FLTK.Images.RGB.PNG.PNG_Image) is + begin + Editor.Set_Logo (Pic); + About.Set_Logo (Pic); + Find.Set_Logo (Pic); + Replace.Set_Logo (Pic); + Jump.Set_Logo (Pic); + end Set_Logo; + + + + procedure Show is begin Editor.Show; diff --git a/src/adapad.ads b/src/adapad.ads index 0695315..850b760 100644 --- a/src/adapad.ads +++ b/src/adapad.ads @@ -1,8 +1,15 @@ +with FLTK.Images.RGB.PNG; + + package Adapad is + procedure Set_Logo + (Pic : in out FLTK.Images.RGB.PNG.PNG_Image); + + procedure Show; procedure Hide; diff --git a/src/main.adb b/src/main.adb index 7f31554..f917081 100644 --- a/src/main.adb +++ b/src/main.adb @@ -1,11 +1,20 @@ -with FLTK; +with FLTK.Images.RGB.PNG; with Adapad; +with Ada.Command_Line; +with Ada.Directories; -function Main return Integer is +function Main return Integer +is + Containing_Dir : String := + Ada.Directories.Containing_Directory + (Ada.Directories.Full_Name (Ada.Command_Line.Command_Name)); + Logo : FLTK.Images.RGB.PNG.PNG_Image := + FLTK.Images.RGB.PNG.Create (Containing_Dir & "/../share/adapad/logo.png"); begin + Adapad.Set_Logo (Logo); Adapad.Show; return FLTK.Run; end Main; diff --git a/src/windows-about.adb b/src/windows-about.adb index a09a41b..12f9c17 100644 --- a/src/windows-about.adb +++ b/src/windows-about.adb @@ -57,7 +57,6 @@ package body Windows.About is 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 (FLTK.Widgets.Font_Size (Heading_Size)); This.Add (This.Blurb); @@ -66,7 +65,6 @@ package body Windows.About is This.Dismiss.Set_Callback (Hide_CB'Access); This.Set_Callback (Hide_CB'Access); - This.Set_Icon (Logo); This.Set_Modal; end return; end Create; @@ -93,5 +91,16 @@ package body Windows.About is end Create; + + + procedure Set_Logo + (This : in out About_Window; + Logo : in out FLTK.Images.RGB.PNG.PNG_Image) is + begin + Window (This).Set_Logo (Logo); + This.Picture.Set_Image (Logo); + end Set_Logo; + + end Windows.About; diff --git a/src/windows-about.ads b/src/windows-about.ads index 0d605f9..f27ad26 100644 --- a/src/windows-about.ads +++ b/src/windows-about.ads @@ -8,7 +8,7 @@ private with FLTK.Widgets.Buttons.Enter; package Windows.About is - type About_Window is new FLTK.Widgets.Groups.Windows.Double.Double_Window with private; + type About_Window is new Window with private; function Create @@ -26,10 +26,15 @@ package Windows.About is return About_Window; + procedure Set_Logo + (This : in out About_Window; + Logo : in out FLTK.Images.RGB.PNG.PNG_Image); + + private - type About_Window is new FLTK.Widgets.Groups.Windows.Double.Double_Window with + type About_Window is new Window with record Picture : FLTK.Widgets.Boxes.Box; Heading : FLTK.Widgets.Boxes.Box; diff --git a/src/windows-editor.adb b/src/windows-editor.adb index 81e5633..f8f15eb 100644 --- a/src/windows-editor.adb +++ b/src/windows-editor.adb @@ -60,7 +60,6 @@ package body Windows.Editor is This.Set_Resizable (This.Editor); This.Set_Size_Range (Min_Editor_Width, Min_Editor_Height); - This.Set_Icon (Logo); This.Editor.Remove_Key_Binding (Mod_Ctrl + 'z'); end return; diff --git a/src/windows-editor.ads b/src/windows-editor.ads index e3d36e0..079638c 100644 --- a/src/windows-editor.ads +++ b/src/windows-editor.ads @@ -12,7 +12,7 @@ private with FLTK.Widgets.Menus.Menu_Buttons; package Windows.Editor is - type Editor_Window is new FLTK.Widgets.Groups.Windows.Double.Double_Window with private; + type Editor_Window is new Window with private; type Wrap_Mode is new FLTK.Widgets.Groups.Text_Displays.Wrap_Mode; @@ -109,7 +109,7 @@ package Windows.Editor is private - type Editor_Window is new FLTK.Widgets.Groups.Windows.Double.Double_Window with + type Editor_Window is new Window with record Bar : aliased FLTK.Widgets.Menus.Menu_Bars.Menu_Bar; Popup : aliased FLTK.Widgets.Menus.Menu_Buttons.Menu_Button; diff --git a/src/windows-find.adb b/src/windows-find.adb index 394ce2d..87acd04 100644 --- a/src/windows-find.adb +++ b/src/windows-find.adb @@ -84,7 +84,6 @@ package body Windows.Find is This.Start.Set_Callback (Find_M'Access); This.Set_Callback (Hide_CB'Access); - This.Set_Icon (Logo); This.Set_Modal; end return; end Create; diff --git a/src/windows-find.ads b/src/windows-find.ads index 82895e7..adcb9c8 100644 --- a/src/windows-find.ads +++ b/src/windows-find.ads @@ -9,7 +9,7 @@ private with FLTK.Widgets.Buttons.Light.Check; package Windows.Find is - type Find_Window is new FLTK.Widgets.Groups.Windows.Double.Double_Window with private; + type Find_Window is new Window with private; type Direction is (Forward, Backward); @@ -49,7 +49,7 @@ package Windows.Find is private - type Find_Window is new FLTK.Widgets.Groups.Windows.Double.Double_Window with + type Find_Window is new Window with record Find_What : FLTK.Widgets.Inputs.Input; Match_Case : FLTK.Widgets.Buttons.Light.Check.Check_Button; diff --git a/src/windows-jump.adb b/src/windows-jump.adb index 13f9cd0..bed3669 100644 --- a/src/windows-jump.adb +++ b/src/windows-jump.adb @@ -70,7 +70,6 @@ package body Windows.Jump is This.Go_Jump.Set_Callback (Jump_M'Access); This.Set_Callback (Hide_CB'Access); - This.Set_Icon (Logo); This.Set_Modal; end return; end Create; diff --git a/src/windows-jump.ads b/src/windows-jump.ads index f47db24..d458a8d 100644 --- a/src/windows-jump.ads +++ b/src/windows-jump.ads @@ -8,7 +8,7 @@ private with FLTK.Widgets.Inputs.Integer; package Windows.Jump is - type Jump_Window is new FLTK.Widgets.Groups.Windows.Double.Double_Window with private; + type Jump_Window is new Window with private; type Jump_Callback is access procedure @@ -38,7 +38,7 @@ package Windows.Jump is private - type Jump_Window is new FLTK.Widgets.Groups.Windows.Double.Double_Window with + type Jump_Window is new Window with record To_Line : FLTK.Widgets.Inputs.Integer.Integer_Input; Cancel : FLTK.Widgets.Buttons.Button; diff --git a/src/windows-replace.adb b/src/windows-replace.adb index 83e328d..8a48e0e 100644 --- a/src/windows-replace.adb +++ b/src/windows-replace.adb @@ -96,7 +96,6 @@ package body Windows.Replace is This.Start.Set_Callback (Replace_M'Access); This.Set_Callback (Hide_CB'Access); - This.Set_Icon (Logo); This.Set_Modal; end return; end Create; diff --git a/src/windows-replace.ads b/src/windows-replace.ads index 64ff562..48c3a73 100644 --- a/src/windows-replace.ads +++ b/src/windows-replace.ads @@ -9,7 +9,7 @@ private with FLTK.Widgets.Buttons.Light.Check; package Windows.Replace is - type Replace_Window is new FLTK.Widgets.Groups.Windows.Double.Double_Window with private; + type Replace_Window is new Window with private; type Replace_Callback is access procedure @@ -40,7 +40,7 @@ package Windows.Replace is private - type Replace_Window is new FLTK.Widgets.Groups.Windows.Double.Double_Window with + type Replace_Window is new Window with record Find_What, Replace_With : FLTK.Widgets.Inputs.Input; Match_Case, Replace_All : FLTK.Widgets.Buttons.Light.Check.Check_Button; diff --git a/src/windows.adb b/src/windows.adb index 3c2020d..eff387d 100644 --- a/src/windows.adb +++ b/src/windows.adb @@ -12,6 +12,16 @@ package body Windows is + procedure Set_Logo + (This : in out Window; + Logo : in out FLTK.Images.RGB.PNG.PNG_Image) is + begin + This.Set_Icon (Logo); + end Set_Logo; + + + + -- used to hide about/find/replace/etc windows instead -- of constantly creating and destroying them diff --git a/src/windows.ads b/src/windows.ads index b187b7b..64a8823 100644 --- a/src/windows.ads +++ b/src/windows.ads @@ -1,18 +1,26 @@ +with FLTK.Widgets.Groups.Windows.Double; with FLTK.Images.RGB.PNG; -private with FLTK.Widgets; package Windows is - Logo : FLTK.Images.RGB.PNG.PNG_Image := FLTK.Images.RGB.PNG.Create ("logo.png"); + type Window is new FLTK.Widgets.Groups.Windows.Double.Double_Window with private; + + + procedure Set_Logo + (This : in out Window; + Logo : in out FLTK.Images.RGB.PNG.PNG_Image); private + type Window is new FLTK.Widgets.Groups.Windows.Double.Double_Window with null record; + + procedure Hide_CB (Item : in out FLTK.Widgets.Widget'Class); |