diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-03-15 00:25:23 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-03-15 00:25:23 +0100 |
| commit | c6da15c4ffed4fd9a54a4c3668853e2564150326 (patch) | |
| tree | 1b3b108409d1ba39f8cfeebcdb8378662779bcb8 /src/GraphicObjects | |
| parent | 709e0b82e0f5445082b7efb67bdc24d2cf6df6ba (diff) | |
remove docker, floating dockingwin should be added to iface
Diffstat (limited to 'src/GraphicObjects')
| -rw-r--r-- | src/GraphicObjects/DockStack.cs | 9 | ||||
| -rw-r--r-- | src/GraphicObjects/DockWindow.cs | 7 | ||||
| -rw-r--r-- | src/GraphicObjects/Docker.cs | 84 | ||||
| -rw-r--r-- | src/GraphicObjects/Image.cs | 4 |
4 files changed, 9 insertions, 95 deletions
diff --git a/src/GraphicObjects/DockStack.cs b/src/GraphicObjects/DockStack.cs index caefb2ec..cdd43d80 100644 --- a/src/GraphicObjects/DockStack.cs +++ b/src/GraphicObjects/DockStack.cs @@ -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) { diff --git a/src/GraphicObjects/DockWindow.cs b/src/GraphicObjects/DockWindow.cs index e3dc2b9f..ca4b93f4 100644 --- a/src/GraphicObjects/DockWindow.cs +++ b/src/GraphicObjects/DockWindow.cs @@ -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 index 1aa4fa37..00000000 --- a/src/GraphicObjects/Docker.cs +++ /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 ""; - } - } -} - diff --git a/src/GraphicObjects/Image.cs b/src/GraphicObjects/Image.cs index c59abca8..e83183c0 100644 --- a/src/GraphicObjects/Image.cs +++ b/src/GraphicObjects/Image.cs @@ -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); |