From 1f9e7a15d9414b1a96691111069523a70e107f16 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Tue, 4 Oct 2016 18:52:32 +1100 Subject: Basic find functionality working --- src/editor_windows.adb | 47 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) (limited to 'src/editor_windows.adb') diff --git a/src/editor_windows.adb b/src/editor_windows.adb index dffad97..20ccbbd 100644 --- a/src/editor_windows.adb +++ b/src/editor_windows.adb @@ -138,6 +138,35 @@ package body Editor_Windows is + function Get_Insert_Position + (This : in Editor_Window) + return Natural is + begin + return This.Editor.Get_Insert_Position; + end Get_Insert_Position; + + + + + procedure Set_Insert_Position + (This : in out Editor_Window; + Pos : in Natural) is + begin + This.Editor.Set_Insert_Position (Pos); + end Set_Insert_Position; + + + + + procedure Show_Insert_Position + (This : in out Editor_Window) is + begin + This.Editor.Show_Insert_Position; + end Show_Insert_Position; + + + + -- used to hide about/find/replace/etc windows instead -- of constantly creating and destroying them @@ -245,11 +274,13 @@ package body Editor_Windows is Item : in out Widget'Class) is type Find_Window_Access is access all Find_Window; - The_Window : access Find_Window := Find_Window_Access (Item.Parent); + Dialog : access Find_Window := Find_Window_Access (Item.Parent); begin - if The_Window.Callback /= null then - The_Window.Callback.Call ("Hello", True); + if Dialog.Callback /= null then + Dialog.Callback.Call + (Dialog.Find_What.Get_Value, + Dialog.Match_Case.Get_State = On); end if; end Call; @@ -348,11 +379,15 @@ package body Editor_Windows is Item : in out Widget'Class) is type Replace_Window_Access is access all Replace_Window; - The_Window : access Replace_Window := Replace_Window_Access (Item.Parent); + Dialog : access Replace_Window := Replace_Window_Access (Item.Parent); begin - if The_Window.Callback /= null then - The_Window.Callback.Call ("Hello", "There", True, True); + if Dialog.Callback /= null then + Dialog.Callback.Call + (Dialog.Find_What.Get_Value, + Dialog.Replace_With.Get_Value, + Dialog.Match_Case.Get_State = On, + Dialog.Replace_All.Get_State = On); end if; end Call; -- cgit