diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-07 17:08:39 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-07 17:08:39 +0100 |
| commit | 31a67ec22a1d083ffaee818ad18b6b1ab26426fb (patch) | |
| tree | 83102735e34afe6bea2e6d1bbd94ecb68e7fae2c /src/GraphicObjects/Grid.cs | |
| parent | 96eae258f27ffbaadb5eafb0e7f8750c210c523a (diff) | |
| parent | b4da579b1bf48573c90b2a8a0d12d883fa71e773 (diff) | |
Merge SimplerLayoutingQueue
Diffstat (limited to 'src/GraphicObjects/Grid.cs')
| -rw-r--r-- | src/GraphicObjects/Grid.cs | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/GraphicObjects/Grid.cs b/src/GraphicObjects/Grid.cs index 1981fc60..fc3d8988 100644 --- a/src/GraphicObjects/Grid.cs +++ b/src/GraphicObjects/Grid.cs @@ -32,13 +32,13 @@ namespace Crow public override T addChild<T> (T child) { T tmp = base.addChild (child); - this.RegisterForLayouting ((int)LayoutingType.PositionChildren); + this.RegisterForLayouting (LayoutingType.PositionChildren); return tmp; } public override void removeChild (GraphicObject child) { base.removeChild (child); - this.RegisterForLayouting ((int)LayoutingType.PositionChildren); + this.RegisterForLayouting (LayoutingType.PositionChildren); } #region Public Properties @@ -59,7 +59,7 @@ namespace Crow _columnCount = value; NotifyValueChanged ("ColumnCount", ColumnCount); - this.RegisterForLayouting ((int)LayoutingType.PositionChildren); + this.RegisterForLayouting (LayoutingType.PositionChildren); } } [XmlAttributeAttribute()][DefaultValue(1)] @@ -73,7 +73,7 @@ namespace Crow _rowCount = value; NotifyValueChanged ("RowCount", RowCount); - this.RegisterForLayouting ((int)LayoutingType.PositionChildren); + this.RegisterForLayouting (LayoutingType.PositionChildren); } } public virtual int CaseWidth { @@ -125,22 +125,23 @@ namespace Crow } } - public override void RegisterForLayouting (int layoutType) - { - base.RegisterForLayouting (layoutType); - if ((layoutType & (int)LayoutingType.PositionChildren) > 0) - Interface.LayoutingQueue.Enqueue (LayoutingType.PositionChildren, this); - } - public override void UpdateLayout (LayoutingType layoutType) - { + public override bool UpdateLayout (LayoutingType layoutType) + { + RegisteredLayoutings &= (~layoutType); + if (layoutType == LayoutingType.PositionChildren) { + ComputeChildrenPositions (); + //if no layouting remains in queue for item, registre for redraw - if (RegisteredLQINodes.Count () <= 0 && bmp==null) + if (RegisteredLayoutings == LayoutingType.None && bmp==null) this.RegisterForRedraw (); - }else - base.UpdateLayout(layoutType); + + return true; + } + + return base.UpdateLayout(layoutType); } #endregion |