summaryrefslogtreecommitdiff
path: root/src/windows.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2016-11-09 11:32:47 +1100
committerJed Barber <jjbarber@y7mail.com>2016-11-09 11:36:51 +1100
commit1f35137574691335d63e86bf5d2b2366fc91c1ba (patch)
tree9ef15ab20157b5c10c92819d6a1694287219e1e1 /src/windows.adb
parent87063e50bfb3dd69d0806897d5b0d97b7d48f92a (diff)
Moved code for each window into its own package
Diffstat (limited to 'src/windows.adb')
-rw-r--r--src/windows.adb44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/windows.adb b/src/windows.adb
new file mode 100644
index 0000000..646ffb4
--- /dev/null
+++ b/src/windows.adb
@@ -0,0 +1,44 @@
+
+
+with FLTK.Widgets;
+with FLTK.Widgets.Groups;
+with FLTK.Widgets.Groups.Windows;
+
+
+package body Windows is
+
+
+ package W renames FLTK.Widgets;
+ package G renames FLTK.Widgets.Groups;
+ package WN renames FLTK.Widgets.Groups.Windows;
+
+
+
+
+ -- used to hide about/find/replace/etc windows instead
+ -- of constantly creating and destroying them
+
+ overriding procedure Call
+ (This : in Hide_Callback;
+ Item : in out W.Widget'Class)
+ is
+ P : access G.Group'Class;
+ begin
+ if Item in WN.Window'Class then
+ WN.Window (Item).Hide;
+ else
+ P := Item.Parent;
+ loop
+ if P = null then
+ return;
+ end if;
+ exit when P.all in WN.Window'Class;
+ P := P.Parent;
+ end loop;
+ WN.Window (P.all).Hide;
+ end if;
+ end Call;
+
+
+end Windows;
+