]> O.S.I.I.S - jp/crow.git/commitdiff
close win in group debug
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 4 Mar 2018 12:06:13 +0000 (13:06 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 4 Mar 2018 12:06:13 +0000 (13:06 +0100)
Default.style
Templates/DockWindow.template
Tests/Interfaces/Experimental/testDock.crow
Tests/Interfaces/Experimental/testDock2.crow [new file with mode: 0644]
Tests/Tests.csproj
src/GraphicObjects/DockStack.cs
src/GraphicObjects/DockWindow.cs
src/GraphicObjects/Window.cs

index 70278cc935ce4de91cc1eded11833340d52af215..3714b922fc1d711a8e9fb8040cbfa312fbf0e0b2 100644 (file)
@@ -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";
index 192c6f0966c7831c44c74476bffde4e118dba0cc..62facf06e304dcf72cf0365f8b73e5d5d709910a 100755 (executable)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
-<GraphicObject Background="{./Background}"/>
-<!--<Border BorderWidth="1" Foreground="White" CornerRadius="{./CornerRadius}"
+<!--<GraphicObject Background="{./Background}"/>-->
+<Border BorderWidth="1" Foreground="White" CornerRadius="{./CornerRadius}"
                                Background="{./Background}"
                                MouseEnter="./onBorderMouseEnter"
                                MouseLeave="./onBorderMouseLeave">
@@ -19,4 +19,4 @@
                </HorizontalStack>
                <Container Name="Content" MinimumSize="50,50" Background="0.5,0.5,0.5,0.5"/>
        </VerticalStack>
-</Border>-->
+</Border>
index 71301686b7522c7caa36a382d5f2bf0e9b7cb623..38727e281c4ce6b574e34419623ff2ddcf894747 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
-<Docker >
-       <DockWindow Left="100" Top="100" Width="150" Height="150" Background="DarkRed"/>
+<Docker Background="Onyx">
+       <DockWindow Left="100" Top="100" Width="150" Height="150" Background="DarkRed" />
        <DockWindow Left="200" Top="200" Width="150" Height="150" Background="DarkGreen"/>
        <DockWindow Left="300" Top="300" Width="150" Height="150" Background="Blue"/>
        <DockWindow Left="400" Top="400" Width="150" Height="150" Background="DarkYellow"/>
diff --git a/Tests/Interfaces/Experimental/testDock2.crow b/Tests/Interfaces/Experimental/testDock2.crow
new file mode 100644 (file)
index 0000000..7130168
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<Docker >
+       <DockWindow Left="100" Top="100" Width="150" Height="150" Background="DarkRed"/>
+       <DockWindow Left="200" Top="200" Width="150" Height="150" Background="DarkGreen"/>
+       <DockWindow Left="300" Top="300" Width="150" Height="150" Background="Blue"/>
+       <DockWindow Left="400" Top="400" Width="150" Height="150" Background="DarkYellow"/>
+       <DockWindow Left="500" Top="500" Width="150" Height="150" Background="Yellow"/>
+</Docker>
+<!--<Group Background="Jet" Margin = "0" Focusable="true" >
+       <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Gray}" MouseLeave="{Background=Green}"/></Window>
+       <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></Window>
+       <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></Window>
+       <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></Window>
+</Group>-->
+<!--<Docker >
+       <DockWindow Resizable = "true" Top="100" Left="100" Caption="View 1" Width="300" Height="300">
+               <VerticalStack Background="DarkGreen" Focusable="true">
+                       <Label Text="{../../Left}" Background="Black" Width="Stretched"/>
+                       <Label Text="{../../Top}" Background="Black"/>
+                       <Label Text="{../../LogicalParent}" Background="Black"/>
+               </VerticalStack>
+       </DockWindow>
+       <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></DockWindow>
+       <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></DockWindow>
+       <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></DockWindow>
+</Docker>-->
\ No newline at end of file
index 30fe50c3e5077b5cb42ac3985e2800f156884cad..c9b6860397d148aa37e80fe27ac3e9c89e373220 100644 (file)
     <None Include="Interfaces\Experimental\testStack.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Include="Interfaces\Experimental\testDock2.crow">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Interfaces\" />
index 4800c0aaaa9211de8d27c3dd4ee3e884a3c3db5e..bb5bf3a49b7adc6ff5d08fee755df7a006ec8487 100644 (file)
@@ -297,7 +297,7 @@ namespace Crow
                                return;
                        instStack = IFace.CreateITorFromIMLFragment (@"<DockStack/>");
                        instSplit = IFace.CreateITorFromIMLFragment (@"<Splitter/>");
-                       instSpacer = IFace.CreateITorFromIMLFragment (@"<GraphicObject Background='DarkCyan' IsEnabled='false'/>");
+                       instSpacer = IFace.CreateITorFromIMLFragment (@"<GraphicObject Background='Transparent' IsEnabled='false'/>");
                }
 
        }
index 7924588e1920f4636f413939b6c4fa77b58d37c5..3617f5b91faabeea8593df326be8e5f646d3c921 100644 (file)
@@ -183,6 +183,12 @@ namespace Crow
                                target.Dock (this);
                        }
                }
+               protected override void close ()
+               {
+                       if (isDocked)
+                               Undock ();
+                       base.close ();
+               }
        }
 }
 
index 4eef9696fbc3eeb3ce24fa5281804b2f8fc64f6b..6a15d0163fdcbc9a82d91c8ce847f0f5506e6644 100644 (file)
@@ -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;
+                       }
                }
        }
 }