summaryrefslogtreecommitdiff
path: root/src/adapad.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2016-10-04 00:32:30 +1100
committerJed Barber <jjbarber@y7mail.com>2016-10-04 00:32:30 +1100
commit7a84d0f3d0d181196b24795592a260e05b63fa74 (patch)
treea9801dd8ba035cd20f269d1c713def579b035027 /src/adapad.adb
parentff006c440b90f1fdcfc47f8d809e07fbe54951ac (diff)
Find/Replace marshalling back to Adapad Main done, some Group/Widget_Cursor stuff removed
Diffstat (limited to 'src/adapad.adb')
-rw-r--r--src/adapad.adb43
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);