From 18df3ae84c00c5a951e1d0ff1ccabe2e6102bfb0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sun, 4 Mar 2018 13:06:13 +0100 Subject: [PATCH] close win in group debug --- Default.style | 6 ++--- Templates/DockWindow.template | 6 ++--- Tests/Interfaces/Experimental/testDock.crow | 4 +-- Tests/Interfaces/Experimental/testDock2.crow | 26 ++++++++++++++++++++ Tests/Tests.csproj | 3 +++ src/GraphicObjects/DockStack.cs | 2 +- src/GraphicObjects/DockWindow.cs | 6 +++++ src/GraphicObjects/Window.cs | 17 +++++++++---- 8 files changed, 56 insertions(+), 14 deletions(-) create mode 100644 Tests/Interfaces/Experimental/testDock2.crow diff --git a/Default.style b/Default.style index 70278cc9..3714b922 100644 --- a/Default.style +++ b/Default.style @@ -118,9 +118,9 @@ DockStack { Margin="1"; AllowDrop = "true"; Focusable="true"; - DragEnter="{Background=DarkBlue}"; - DragLeave="{Background=Jet}"; - EndDrag="{Background=Jet}"; + //DragEnter="{Background=DarkBlue}"; + //DragLeave="{Background=Jet}"; + //EndDrag="{Background=Jet}"; } DockWindow { Focusable = "true"; diff --git a/Templates/DockWindow.template b/Templates/DockWindow.template index 192c6f09..62facf06 100755 --- a/Templates/DockWindow.template +++ b/Templates/DockWindow.template @@ -1,6 +1,6 @@ - - + @@ -19,4 +19,4 @@ ---> + diff --git a/Tests/Interfaces/Experimental/testDock.crow b/Tests/Interfaces/Experimental/testDock.crow index 71301686..38727e28 100644 --- a/Tests/Interfaces/Experimental/testDock.crow +++ b/Tests/Interfaces/Experimental/testDock.crow @@ -1,6 +1,6 @@  - - + + diff --git a/Tests/Interfaces/Experimental/testDock2.crow b/Tests/Interfaces/Experimental/testDock2.crow new file mode 100644 index 00000000..71301686 --- /dev/null +++ b/Tests/Interfaces/Experimental/testDock2.crow @@ -0,0 +1,26 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 30fe50c3..c9b68603 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -376,6 +376,9 @@ PreserveNewest + + PreserveNewest + diff --git a/src/GraphicObjects/DockStack.cs b/src/GraphicObjects/DockStack.cs index 4800c0aa..bb5bf3a4 100644 --- a/src/GraphicObjects/DockStack.cs +++ b/src/GraphicObjects/DockStack.cs @@ -297,7 +297,7 @@ namespace Crow return; instStack = IFace.CreateITorFromIMLFragment (@""); instSplit = IFace.CreateITorFromIMLFragment (@""); - instSpacer = IFace.CreateITorFromIMLFragment (@""); + instSpacer = IFace.CreateITorFromIMLFragment (@""); } } diff --git a/src/GraphicObjects/DockWindow.cs b/src/GraphicObjects/DockWindow.cs index 7924588e..3617f5b9 100644 --- a/src/GraphicObjects/DockWindow.cs +++ b/src/GraphicObjects/DockWindow.cs @@ -183,6 +183,12 @@ namespace Crow target.Dock (this); } } + protected override void close () + { + if (isDocked) + Undock (); + base.close (); + } } } diff --git a/src/GraphicObjects/Window.cs b/src/GraphicObjects/Window.cs index 4eef9696..6a15d016 100644 --- a/src/GraphicObjects/Window.cs +++ b/src/GraphicObjects/Window.cs @@ -437,14 +437,21 @@ namespace Crow close (); } - protected void close(){ + protected virtual void close(){ Closing.Raise (this, null); if (Parent is Interface) (Parent as Interface).DeleteWidget (this); - else if (Parent is Group) - (Parent as Group).DeleteChild (this); - else if (Parent is PrivateContainer) - (Parent as Container).Child = null; + else { + GraphicObject p = Parent as GraphicObject; + if (p is Group) { + lock (IFace.UpdateMutex) { + RegisterClip (p.ScreenCoordinates (p.LastPaintedSlot)); + (p as Group).DeleteChild (this); + } + //(Parent as Group).RegisterForRedraw (); + } else if (Parent is PrivateContainer) + (Parent as Container).Child = null; + } } } } -- 2.47.3