diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-03-04 11:28:09 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-03-04 11:28:09 +0100 |
| commit | 27a85f2d4e9987ac1809199e280e17a36d68c783 (patch) | |
| tree | 48a15efb23c45724f0d44a0c01582f037c3acaee /src/GraphicObjects/Group.cs | |
| parent | 5bcd45c3ccc34edc68188a3acdb09e742b21aef3 (diff) | |
crowIde wip, docker wip, stack remove child debug
Diffstat (limited to 'src/GraphicObjects/Group.cs')
| -rw-r--r-- | src/GraphicObjects/Group.cs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/GraphicObjects/Group.cs b/src/GraphicObjects/Group.cs index 0eb1ece2..11bf16fb 100644 --- a/src/GraphicObjects/Group.cs +++ b/src/GraphicObjects/Group.cs @@ -114,6 +114,8 @@ namespace Crow childrenRWLock.EnterWriteLock (); Children.Remove(child); + child.Parent = null; + //child.ResetSlots (); childrenRWLock.ExitWriteLock (); @@ -142,6 +144,9 @@ namespace Crow g.LayoutChanged += OnChildLayoutChanges; g.RegisterForLayouting (LayoutingType.Sizing | LayoutingType.ArrangeChildren); } + public virtual void RemoveChild (int idx) { + RemoveChild (children[idx]); + } public virtual void DeleteChild (int idx) { DeleteChild (children[idx]); } @@ -263,7 +268,7 @@ namespace Crow switch (layoutType) { case LayoutingType.Width: foreach (GraphicObject c in Children) { - if (c.Width.Units == Unit.Percent) + if (c.Width.IsRelativeToParent) c.RegisterForLayouting (LayoutingType.Width); else c.RegisterForLayouting (LayoutingType.X); @@ -271,7 +276,7 @@ namespace Crow break; case LayoutingType.Height: foreach (GraphicObject c in Children) { - if (c.Height.Units == Unit.Percent) + if (c.Height.IsRelativeToParent) c.RegisterForLayouting (LayoutingType.Height); else c.RegisterForLayouting (LayoutingType.Y); @@ -294,9 +299,9 @@ namespace Crow childrenRWLock.EnterReadLock (); - foreach (GraphicObject g in Children) { - g.Paint (ref gr); - } + foreach (GraphicObject g in Children) { + g.Paint (ref gr); + } childrenRWLock.ExitReadLock (); gr.Restore (); |