diff options
Diffstat (limited to 'src/adapad.adb')
-rw-r--r-- | src/adapad.adb | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/src/adapad.adb b/src/adapad.adb index 6a725c3..84ada4e 100644 --- a/src/adapad.adb +++ b/src/adapad.adb @@ -1,22 +1,28 @@ -with FLTK.Widgets.Menus; -with FLTK.Widgets.Groups.Windows; -with FLTK.Text_Buffers; -with FLTK.Dialogs; -with Windows.Editor; -with Windows.About; -with Windows.Find; -with Windows.Replace; -with Windows.Jump; -with Change_Vectors; -with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; +with + + FLTK.Widgets.Menus, + FLTK.Widgets.Groups.Windows, + FLTK.Text_Buffers, + FLTK.Dialogs, + Windows.Editor, + Windows.About, + Windows.Find, + Windows.Replace, + Windows.Jump, + Change_Vectors, + Ada.Strings.Unbounded; + +use + + Ada.Strings.Unbounded; package body Adapad is - -- forward declarations of helper functions + -- Forward declarations of helper functions. procedure Set_Title; function Safe_To_Discard return Boolean; @@ -29,7 +35,7 @@ package body Adapad is - -- global state of the text editor + -- Global state of the text editor. Editor : Windows.Editor.Editor_Window := Windows.Editor.Create (800, 500); Buffer : FLTK.Text_Buffers.Text_Buffer := FLTK.Text_Buffers.Create; @@ -45,7 +51,7 @@ package body Adapad is - -- main program interface + -- Main program interface. procedure Set_Logo (Pic : in out FLTK.Images.RGB.PNG.PNG_Image) is @@ -80,7 +86,7 @@ package body Adapad is - -- callbacks for the menu + -- Callbacks for the menu. procedure New_CB (Item : in out FLTK.Widgets.Widget'Class) is @@ -341,7 +347,7 @@ package body Adapad is (Item : in out FLTK.Widgets.Widget'Class) is begin if FLTK.Widgets.Menus.Menu (Item).Chosen.Value then - -- 50 pixels should be enough for 5 digit line numbers + -- 50 pixels should be enough for 5 digit line numbers. Editor.Set_Linenumber_Width (50); else Editor.Set_Linenumber_Width (0); @@ -361,7 +367,7 @@ package body Adapad is - -- callbacks for the text buffer + -- Callbacks for the text buffer. procedure Mod_CB (Action : in FLTK.Text_Buffers.Modification; @@ -416,7 +422,7 @@ package body Adapad is - -- callbacks for the extra dialog windows + -- Callbacks for the extra dialog windows. procedure Do_Find_CB (Item : in String; @@ -430,7 +436,7 @@ package body Adapad is begin Find.Hide; - -- is it possible to improve this abomination with a modulo type? + -- Is it possible to improve this abomination with a modulo type? if Buffer.Get_Selection (Select_Start, Select_End) then if Facing = Windows.Find.Forward then Current_Position := Select_End; @@ -523,7 +529,7 @@ package body Adapad is - -- helper functions + -- Helper functions. procedure Set_Title is Title : Unbounded_String := To_Unbounded_String (0); |