aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/GenericStack.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-05 20:38:00 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-05 20:38:00 +0100
commit9e7f05bfc4a9f47bf11ca44842c0dd92def4d5aa (patch)
tree59955d569a318c93851fa107d7ae14da0152407f /src/GraphicObjects/GenericStack.cs
parent759f4f39e3fdde1f9ed8b620af51e05d052d8964 (diff)
new layouting update through events
Diffstat (limited to 'src/GraphicObjects/GenericStack.cs')
-rw-r--r--src/GraphicObjects/GenericStack.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs
index 92e944bb..d4e3ae5d 100644
--- a/src/GraphicObjects/GenericStack.cs
+++ b/src/GraphicObjects/GenericStack.cs
@@ -105,6 +105,7 @@ namespace Crow
c.RegisterForLayouting ((int)LayoutingType.X);
}
}
+ bmp = null;
}
public override void RegisterForLayouting (int layoutType)
@@ -171,6 +172,42 @@ namespace Crow
}else
base.UpdateLayout(layoutType);
}
+ public override void OnLayoutChanges (LayoutingType layoutType)
+ {
+ base.OnLayoutChanges (layoutType);
+
+ if (Orientation == Orientation.Horizontal){
+ if(layoutType == LayoutingType.Width)
+ this.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ }else if (layoutType == LayoutingType.Height)
+ this.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ }
+ public override void OnChildLayoutChanges (object sender, LayoutChangeEventArgs arg)
+ {
+ base.OnChildLayoutChanges (sender, arg);
+
+ GraphicObject g = sender as GraphicObject;
+ switch (arg.LayoutType) {
+ case LayoutingType.X:
+ break;
+ case LayoutingType.Y:
+ break;
+ case LayoutingType.Width:
+ if (Orientation == Orientation.Horizontal) {
+ if (this.Bounds.Width < 0)
+ this.RegisterForLayouting ((int)LayoutingType.Width);
+ this.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ }
+ break;
+ case LayoutingType.Height:
+ if (Orientation == Orientation.Vertical) {
+ if (this.Bounds.Height < 0)
+ this.RegisterForLayouting ((int)LayoutingType.Height);
+ this.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ }
+ break;
+ }
+ }
#endregion