From 7a84d0f3d0d181196b24795592a260e05b63fa74 Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Tue, 4 Oct 2016 00:32:30 +1100 Subject: Find/Replace marshalling back to Adapad Main done, some Group/Widget_Cursor stuff removed --- src/editor_windows.ads | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) (limited to 'src/editor_windows.ads') diff --git a/src/editor_windows.ads b/src/editor_windows.ads index 6fede6d..3acec25 100644 --- a/src/editor_windows.ads +++ b/src/editor_windows.ads @@ -83,6 +83,13 @@ package Editor_Windows is type Find_Window is new Double_Window with private; + type Find_Callback is interface; + procedure Call + (This : in Find_Callback; + Item : in String; + Match_Case : in Boolean) is abstract; + + function Create return Find_Window; @@ -97,9 +104,9 @@ package Editor_Windows is return Find_Window; - procedure Set_Function + procedure Set_Find_Callback (This : in out Find_Window; - Func : access procedure (Item : in String)); + Func : not null access Find_Callback'Class); @@ -107,6 +114,13 @@ package Editor_Windows is type Replace_Window is new Double_Window with private; + type Replace_Callback is interface; + procedure Call + (This : in Replace_Callback; + Item, Replace_With : in String; + Match_Case, Rep_All : in Boolean) is abstract; + + function Create return Replace_Window; @@ -121,9 +135,9 @@ package Editor_Windows is return Replace_Window; - procedure Set_Function + procedure Set_Replace_Callback (This : in out Replace_Window; - Func : access procedure (Item : in String)); + Func : not null access Replace_Callback'Class); private @@ -161,23 +175,35 @@ private end record; + type Find_Marshaller is new Widget_Callback with null record; + overriding procedure Call + (This : in Find_Marshaller; + Item : in out Widget'Class); + + type Find_Window is new Double_Window with record Find_What : Input; Match_Case : Check_Button; Cancel : Button; Start : Enter_Button; - -- callback + Callback : access Find_Callback'Class; end record; + type Replace_Marshaller is new Widget_Callback with null record; + overriding procedure Call + (This : in Replace_Marshaller; + Item : in out Widget'Class); + + type Replace_Window is new Double_Window with record Find_What, Replace_With : Input; Match_Case, Replace_All : Check_Button; - Cancel : Button; - Start : Enter_Button; - -- callback + Cancel : Button; + Start : Enter_Button; + Callback : access Replace_Callback'Class; end record; -- cgit