diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-14 19:27:00 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-14 19:27:00 +0100 |
| commit | 3ee26688eedb549a81b7846eac4698cf9a589519 (patch) | |
| tree | 8a03fe02b459bbf50ff75dfe8c29b9f962c77379 /src/GraphicObjects/GenericStack.cs | |
| parent | c24b7bf6003bcb96f55a71b8744e0f52cbc51b90 (diff) | |
testing tabview, ChildLayoutConstraints
Diffstat (limited to 'src/GraphicObjects/GenericStack.cs')
| -rw-r--r-- | src/GraphicObjects/GenericStack.cs | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs index c8282988..ed90486d 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/src/GraphicObjects/GenericStack.cs @@ -10,12 +10,6 @@ namespace Crow { public class GenericStack : Group { - internal class Page - { - public byte[] bmp; - public int Size; - } - #region CTOR public GenericStack() : base() @@ -28,18 +22,6 @@ namespace Crow Orientation _orientation; #endregion - public override T AddChild<T> (T child) - { - T tmp = base.AddChild (child); - this.RegisterForLayouting (LayoutingType.PositionChildren); - return tmp; - } - public override void RemoveChild (GraphicObject child) - { - base.RemoveChild (child); - this.RegisterForLayouting (LayoutingType.PositionChildren); - } - #region Public Properties [XmlAttributeAttribute()][DefaultValue(2)] public int Spacing @@ -60,6 +42,15 @@ namespace Crow } #endregion + public override void ChildrenLayoutingConstraints (ref LayoutingType layoutType) + { + //Prevent child repositionning in the direction of stacking + if (Orientation == Orientation.Horizontal) + layoutType &= (~LayoutingType.X); + else + layoutType &= (~LayoutingType.Y); + } + #region GraphicObject Overrides protected override Size measureRawSize () { @@ -120,7 +111,7 @@ namespace Crow { RegisteredLayoutings &= (~layoutType); - if (layoutType == LayoutingType.PositionChildren) { + if (layoutType == LayoutingType.ArrangeChildren) { //allow 1 child to have size to 0 if stack has fixed or streched size policy, //this child will occupy remaining space //if stack size policy is Fit, no child may have stretch enabled @@ -221,14 +212,14 @@ namespace Crow if (Orientation == Orientation.Horizontal) { if (this.Bounds.Width < 0) this.RegisterForLayouting (LayoutingType.Width); - this.RegisterForLayouting (LayoutingType.PositionChildren); + this.RegisterForLayouting (LayoutingType.ArrangeChildren); } break; case LayoutingType.Height: if (Orientation == Orientation.Vertical) { if (this.Bounds.Height < 0) this.RegisterForLayouting (LayoutingType.Height); - this.RegisterForLayouting (LayoutingType.PositionChildren); + this.RegisterForLayouting (LayoutingType.ArrangeChildren); } break; } |