diff options
Diffstat (limited to 'src/adapad.adb')
-rw-r--r-- | src/adapad.adb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/adapad.adb b/src/adapad.adb index 7ba743e..7440ce9 100644 --- a/src/adapad.adb +++ b/src/adapad.adb @@ -16,6 +16,8 @@ use FLTK.Widgets.Groups.Windows; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; +with Ada.Text_IO; + function Adapad return Integer is @@ -271,6 +273,45 @@ function Adapad return Integer is + -- callbacks for the find/replace windows + + type Do_Find_Callback is new Editor_Windows.Find_Callback with null record; + Do_Find_CB : aliased Do_Find_Callback; + + overriding procedure Call + (This : in Do_Find_Callback; + Item : in String; + Match_Case : in Boolean) is + begin + Ada.Text_IO.Put_Line ("Finding " & Item); + if Match_Case then + Ada.Text_IO.Put_Line ("Matching case"); + end if; + end Call; + + + + + type Do_Replace_Callback is new Editor_Windows.Replace_Callback with null record; + Do_Replace_CB : aliased Do_Replace_Callback; + + overriding procedure Call + (This : in Do_Replace_Callback; + Item, Replace_With : in String; + Match_Case, Replace_All : in Boolean) is + begin + Ada.Text_IO.Put_Line ("Replacing " & Item & " with " & Replace_With); + if Match_Case then + Ada.Text_IO.Put_Line ("Matching case"); + end if; + if Replace_All then + Ada.Text_IO.Put_Line ("Replacing all"); + end if; + end Call; + + + + -- helper functions procedure Set_Title is @@ -404,6 +445,8 @@ begin end; + Find.Set_Find_Callback (Do_Find_CB'Access); + Replace.Set_Replace_Callback (Do_Replace_CB'Access); Buffer.Add_Modify_Callback (Mod_CB'Access); Editor.Set_Callback (Quit_CB'Access); Editor.Set_Buffer (Buffer); |