From: jpbruyere Date: Mon, 15 Feb 2016 09:36:03 +0000 (+0100) Subject: Add ArrangeChildren boolean to ILayoutable X-Git-Tag: v0.4~127^2~25 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=60542beb36347b4af6070c2c5db580700755698f;p=jp%2Fcrow.git Add ArrangeChildren boolean to ILayoutable --- diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs index ed90486d..3f2ec8a1 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/src/GraphicObjects/GenericStack.cs @@ -42,6 +42,8 @@ namespace Crow } #endregion + #region GraphicObject Overrides + public override bool ArrangeChildren { get { return true; } } public override void ChildrenLayoutingConstraints (ref LayoutingType layoutType) { //Prevent child repositionning in the direction of stacking @@ -50,8 +52,6 @@ namespace Crow else layoutType &= (~LayoutingType.Y); } - - #region GraphicObject Overrides protected override Size measureRawSize () { Size tmp = new Size (); diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index f2c50e6f..89110ab8 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -626,8 +626,9 @@ namespace Crow } /// By default in groups, LayoutingType.ArrangeChildren is reset public virtual void ChildrenLayoutingConstraints(ref LayoutingType layoutType){ - layoutType &= (~LayoutingType.ArrangeChildren); - } + + } + public virtual bool ArrangeChildren { get { return false; } } public virtual void RegisterForLayouting(LayoutingType layoutType){ if (Parent == null) return; @@ -637,6 +638,9 @@ namespace Crow if (Height == 0) layoutType &= (~LayoutingType.Y); + if (!ArrangeChildren) + layoutType &= (~LayoutingType.ArrangeChildren); + //apply constraints depending on parent type if (Parent is GraphicObject) (Parent as GraphicObject).ChildrenLayoutingConstraints (ref layoutType); diff --git a/src/GraphicObjects/ILayoutable.cs b/src/GraphicObjects/ILayoutable.cs index bbf1b4a6..51abc25d 100644 --- a/src/GraphicObjects/ILayoutable.cs +++ b/src/GraphicObjects/ILayoutable.cs @@ -19,6 +19,7 @@ namespace Crow IGOLibHost HostContainer { get; } + bool ArrangeChildren { get; } LayoutingType RegisteredLayoutings { get; set; } void RegisterForLayouting(LayoutingType layoutType); void RegisterClip(Rectangle clip); diff --git a/src/GraphicObjects/TabView.cs b/src/GraphicObjects/TabView.cs index 6a18cf26..3fa3f706 100644 --- a/src/GraphicObjects/TabView.cs +++ b/src/GraphicObjects/TabView.cs @@ -79,7 +79,7 @@ namespace Crow return base.AddChild (child); } - + public override bool ArrangeChildren { get { return true; } } public override void ChildrenLayoutingConstraints (ref LayoutingType layoutType) { // //Prevent child repositionning in the direction of diff --git a/src/OpenTKGameWindow.cs b/src/OpenTKGameWindow.cs index 97695657..140436b5 100644 --- a/src/OpenTKGameWindow.cs +++ b/src/OpenTKGameWindow.cs @@ -577,6 +577,7 @@ namespace Crow public void RegisterClip(Rectangle r){ clipping.AddRectangle (r); } + public bool ArrangeChildren { get { return false; }} public int LayoutingTries { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); }