]> O.S.I.I.S - jp/crow.git/commitdiff
Add ArrangeChildren boolean to ILayoutable
authorjpbruyere <jp.bruyere@hotmail.com>
Mon, 15 Feb 2016 09:36:03 +0000 (10:36 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Mon, 15 Feb 2016 09:36:03 +0000 (10:36 +0100)
src/GraphicObjects/GenericStack.cs
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/ILayoutable.cs
src/GraphicObjects/TabView.cs
src/OpenTKGameWindow.cs

index ed90486d2fe5ef850379345ae5a9ff9c995ccbed..3f2ec8a136535aa55d5309596be92c7ca924767b 100644 (file)
@@ -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 ();
index f2c50e6fef67b077523946a6d43bc4d11f5f7da2..89110ab81e2b4d937eb73d4ed8dab4d5723be020 100644 (file)
@@ -626,8 +626,9 @@ namespace Crow
                }
                /// <summary> By default in groups, LayoutingType.ArrangeChildren is reset </summary>
                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);
index bbf1b4a6a9ef989a1bbbc1d0dc11f21ba7444b50..51abc25dc0ff7147ff8cd2796d942d3d0fd4c707 100644 (file)
@@ -19,6 +19,7 @@ namespace Crow
 
                IGOLibHost HostContainer { get; }
 
+               bool ArrangeChildren { get; }
                LayoutingType RegisteredLayoutings { get; set; }
                void RegisterForLayouting(LayoutingType layoutType);
                void RegisterClip(Rectangle clip);
index 6a18cf26ce7255a4497dbace6aa563ba5e90c30a..3fa3f706734b2d6bc3b718b6951236b076d0ac86 100644 (file)
@@ -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 
index 97695657031601dbcecdd7ee8a0d7def7e210398..140436b52b10ad559c4dded63935802ca4d194d6 100644 (file)
@@ -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 (); }