]> O.S.I.I.S - jp/crow.git/commitdiff
remove docker, floating dockingwin should be added to iface
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 14 Mar 2018 23:25:23 +0000 (00:25 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 14 Mar 2018 23:25:23 +0000 (00:25 +0100)
Crow.csproj
Default.style
Templates/FileDialog.template
Tests/BasicTests.cs
Tests/Interfaces/Experimental/testDock.crow
src/GraphicObjects/DockStack.cs
src/GraphicObjects/DockWindow.cs
src/GraphicObjects/Docker.cs [deleted file]
src/GraphicObjects/Image.cs

index db3da7bb91261ee14fb32cb66872d90d43fa7d85..1b5b3406bf82884fd9a7d1531c6027a3043bc311 100644 (file)
     <Compile Include="src\ObservableList.cs" />
     <Compile Include="src\GraphicObjects\IMLContainer.cs" />
     <Compile Include="src\DragDropEventArgs.cs" />
-    <Compile Include="src\GraphicObjects\Docker.cs" />
     <Compile Include="src\GraphicObjects\DockWindow.cs" />
     <Compile Include="src\ParsingException.cs" />
     <Compile Include="src\IMLAttributes.cs" />
index f1445fe5c10a77240ba7ed0ca9ee0171424ab3f3..5b36bc2d9275d1d4629191d1052571d2f53a78c8 100644 (file)
@@ -131,6 +131,7 @@ DockWindow {
        Background = "Onyx";
        Focusable = "true";
        AllowDrag = "true";
+       AlwaysOnTop = "true";
        Margin="0";
        Width="200";
        Height="200";
index 6fae49c5992cf07cc0a24225910926172845a565..42b5ec0c52c6709319cc38fd707575ec1b1d0c66 100644 (file)
@@ -16,7 +16,7 @@
                        </Border>
                        <GraphicObject Width="5"/>
                </HorizontalStack>
-               <Container Name="Content" MinimumSize="50,50" Background="DimGray">
+               <Container Name="Content" MinimumSize="50,50" Background="Jet">
                        <VerticalStack Margin="1">
                                <HorizontalStack Height="Fit">
                                        <Button Fit="true" Caption="Up" MouseClick="./goUpDirClick">
                                                        SelectedItemChanged="./onSelectedItemChanged">
                                                        <Template>
                                                                <HorizontalStack>
-                                                                       <Scroller ScrollX="{../scrollbar1.Value}"  Name="scroller1">
+                                                                       <Scroller Name="scroller1">
                                                                                <VerticalStack Height="Fit" VerticalAlignment="Top"
                                                                                        Name="ItemsContainer" Margin="0" Spacing="1"/>
                                                                        </Scroller>
-                                                                       <ScrollBar Name="scrollbar1" Value="{²../scroller1.ScrollY}"
-                                                                               LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30"
+                                                                       <ScrollBar Name="scrollbar1" Orientation="Vertical"
+                                                                               Value="{²../scroller1.ScrollY}"        Maximum="{../scroller1.MaxScrollY}" 
                                                                                CursorSize="{../scroller1.ChildHeightRatio}"
-                                                                               Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
+                                                                               LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30"
                                                                                Width="14" />
                                                                </HorizontalStack>
                                                        </Template>
index 09db62314f8015ebb17d84f51c07f5c1f532c590..149ff4a9ebc0c6f0a32b2e4707c76ffe5b591474 100644 (file)
@@ -177,7 +177,8 @@ namespace Tests
 
                        this.KeyDown += KeyboardKeyDown1;
 
-                       testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
+                       testFiles = new string [] { @"Interfaces/Experimental/testDock.crow" };
+                       //testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
                        //testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" };
                        testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
                        testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
@@ -193,6 +194,13 @@ namespace Tests
                        //testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Experimental", "*.crow")).ToArray ();
 
                        Load(testFiles[idx]).DataSource = this;
+
+                       LoadIMLFragment (@"<DockWindow Width=""150"" Height=""150"" Background=""DarkRed"" />", 0);
+                       LoadIMLFragment (@"<DockWindow Width=""200"" Height=""150"" Background=""DarkGreen"" />", 0);
+                       LoadIMLFragment (@"<DockWindow Width=""250"" Height=""150"" Background=""Brown"" />", 0);
+                       LoadIMLFragment (@"<DockWindow Width=""300"" Height=""150"" Background=""DarkBlue"" />", 0);
+
+
                }
                void KeyboardKeyDown1 (object sender, OpenTK.Input.KeyboardKeyEventArgs e)
                {
index 22e2dc06474f8a2a8a12c0970931f6b4b4bc10f8..94a936a6fb8a83280e02f3684801ac3dca6484c5 100644 (file)
@@ -1,18 +1,11 @@
 <?xml version="1.0"?>
-<VerticalStack>
-       <Docker>
-               <DockStack Background="DimGray"/>
-               <DockWindow Width="150" Height="150" Background="DarkRed" />
-               <DockWindow Width="150" Height="150" Background="DarkGreen"/>
-               <DockWindow Width="150" Height="150" Background="Blue"/>
-               <DockWindow Width="150" Height="150" Background="DarkYellow"/>
-               <DockWindow Width="150" Height="150" Background="Yellow"/>
-               <DockWindow Width="150" Height="150" Background="BrownWeb"/>
-       </Docker>
+<Window Height="50%" Width="60%">
+       <DockStack Background="#60101050" Margin="10"/>
+</Window>
 <!---          <DockWindow Left="400" Top="400" Width="150" Height="150" Background="MediumSeaGreen"/>
                <DockWindow Left="450" Top="450" Width="150" Height="150" Background="Maize"/>-->
        
-</VerticalStack>
+
 <!--<Group Background="DimGray" 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>
index caefb2ec3b4588b465d1e60f5dcefe4b97e06c23..cdd43d80f609b33a7b5ea0d607180f38464a207b 100644 (file)
@@ -30,9 +30,7 @@ namespace Crow
 {
        [DesignIgnore]
        public class DockStack : GenericStack
-       {
-               Docker rootDock { get { return LogicalParent as Docker; }}
-
+       {               
                #region CTor
                public DockStack ()     {}
                public DockStack (Interface iface) : base (iface) {}
@@ -41,7 +39,10 @@ namespace Crow
                public override void AddChild (GraphicObject g)
                {
                        base.AddChild (g);
-                       g.LogicalParent = this.LogicalParent;
+                       if (localLogicalParentIsNull)
+                               g.LogicalParent = this;
+                       else
+                               g.LogicalParent = this.LogicalParent;
                }
                public override void InsertChild (int idx, GraphicObject g)
                {
index e3dc2b9fbe156f3a4c5027ab961d08575fb3d153..ca4b93f4bbc006946e2c7edf5f28fdf685184201 100644 (file)
@@ -44,8 +44,6 @@ namespace Crow
                Rectangle savedSlot;    //last undocked slot recalled when view is undocked
                bool wasResizable;
 
-               public Docker RootDock { get { return LogicalParent as Docker; }}
-
                public bool IsDocked {
                        get { return isDocked; }
                        set {
@@ -137,7 +135,7 @@ namespace Crow
                                DockStack ds = Parent as DockStack;
                                ds.Undock (this);
 
-                               RootDock.AddChild (this);
+                               IFace.AddWidget (this);
 
                                this.Left = savedSlot.Left;
                                this.Top = savedSlot.Top;
@@ -160,8 +158,7 @@ namespace Crow
                                LastSlots = LastPaintedSlot = Slot = default(Rectangle);
                                Left = Top = 0;
 
-                               Group g = Parent as Group;
-                               g.RemoveChild (this);
+                               IFace.RemoveWidget (this);
 
                                target.Dock (this);
                        }
diff --git a/src/GraphicObjects/Docker.cs b/src/GraphicObjects/Docker.cs
deleted file mode 100644 (file)
index 1aa4fa3..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//
-// DocksView.cs
-//
-// Author:
-//       Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Xml.Serialization;
-using System.ComponentModel;
-using Crow.IML;
-using System.Collections.Generic;
-using System.Diagnostics;
-
-namespace Crow
-{
-       public class Docker : Group
-       {               
-               #region CTOR
-               static Docker () {
-               }
-               public Docker () : base ()
-               {
-               }
-               #endregion
-
-               int dockingThreshold;
-
-
-               [XmlAttributeAttribute][DefaultValue(10)]
-               public virtual int DockingThreshold {
-                       get { return dockingThreshold; }
-                       set {
-                               if (dockingThreshold == value)
-                                       return;
-                               dockingThreshold = value; 
-                               NotifyValueChanged ("DockingThreshold", dockingThreshold);
-                       }
-               }
-
-               public override void AddChild (GraphicObject g)
-               {                               
-                       base.AddChild (g);
-                       g.LogicalParent = this;
-               }
-
-               public override void onMouseMove (object sender, MouseMoveEventArgs e)
-               {                       
-                       if (IFace.DragAndDropOperation?.DragSource as DockWindow != null) {
-                               DockWindow dw = IFace.DragAndDropOperation.DragSource as DockWindow;
-                               if (!dw.IsDocked) {
-                                       Rectangle r = dw.ScreenCoordinates (dw.Slot);
-                                       Point p = ScreenPointToLocal (e.Position);
-                                       dw.Left = p.X - r.Width / 2;
-                                       dw.Top = p.Y - r.Height / 2;
-                               }
-                       }
-                       base.onMouseMove (sender, e);
-               }
-
-               public string ExportWinConfigs () {
-                       return "";      
-               }
-       }
-}
-
index c59abca8417279b924b7475afc01c08f362a9a24..e83183c003c34ee423b6279791e052b3aa2896da 100644 (file)
@@ -93,9 +93,9 @@ namespace Crow
                                        if (string.IsNullOrEmpty(value))
                                                Picture = null;
                                        else {
-                                               lock(IFace.LayoutMutex){
+                                               //lock(IFace.LayoutMutex){
                                                        LoadImage (value);
-                                               }
+                                               //}
                                        }
                                } catch (Exception ex) {
                                        Debug.WriteLine (ex.Message);