aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/GenericStack.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/GraphicObjects/GenericStack.cs')
-rw-r--r--src/GraphicObjects/GenericStack.cs33
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;
}