diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2015-05-02 09:19:19 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2015-05-02 09:19:19 +0200 |
| commit | 40392cc3bcaee5b67d85b0aabfd42d2881823bd6 (patch) | |
| tree | 809bc55854f13cb031d26129e7db24076119bca0 /src | |
| parent | c88d3c2e0b3e9e69df5f1879b9d8935d3ae0d390 (diff) | |
Layouting queue, debug
test4 validated
Diffstat (limited to 'src')
| -rw-r--r-- | src/GraphicObjects/Border.cs | 4 | ||||
| -rw-r--r-- | src/GraphicObjects/Container.cs | 141 | ||||
| -rw-r--r-- | src/GraphicObjects/GenericStack.cs | 15 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/GraphicObjects/GraphicObject.cs | 170 | ||||
| -rw-r--r-- | src/GraphicObjects/Group.cs | 59 | ||||
| -rwxr-xr-x | src/GraphicObjects/Label.cs | 3 | ||||
| -rw-r--r-- | src/GraphicObjects/NumericControl.cs | 8 | ||||
| -rw-r--r-- | src/GraphicObjects/Scroller.cs | 6 | ||||
| -rw-r--r-- | src/LayoutingQueue.cs | 11 | ||||
| -rw-r--r-- | src/LayoutingQueueItem.cs | 2 |
10 files changed, 147 insertions, 272 deletions
diff --git a/src/GraphicObjects/Border.cs b/src/GraphicObjects/Border.cs index 281db215..e2451582 100644 --- a/src/GraphicObjects/Border.cs +++ b/src/GraphicObjects/Border.cs @@ -48,9 +48,9 @@ namespace go Size raw = Bounds.Size; if (child != null) { - if (Bounds.Width < 0 && child.WIsValid) + if (Bounds.Width < 0) raw.Width = child.Slot.Width + 2 * (Margin+BorderWidth); - if (Bounds.Height < 0 && child.HIsValid) + if (Bounds.Height < 0) raw.Height = child.Slot.Height + 2 * (Margin+BorderWidth); } diff --git a/src/GraphicObjects/Container.cs b/src/GraphicObjects/Container.cs index 862f7947..0d0ad5b3 100644 --- a/src/GraphicObjects/Container.cs +++ b/src/GraphicObjects/Container.cs @@ -66,107 +66,58 @@ namespace go return child == null ? Bounds.Size : new Size(child.Slot.Width + 2 * (Margin),child.Slot.Height + 2 * (Margin));
}
- public override void UpdateLayout (LayoutingType layoutType)
+ protected override void OnLayoutChanges (LayoutingType layoutType)
{
- {
- switch (layoutType) {
- case LayoutingType.X:
- if (Bounds.X == 0) {
- switch (HorizontalAlignment) {
- case HorizontalAlignment.Left:
- Slot.X = 0;
- break;
- case HorizontalAlignment.Right:
- Slot.X = Parent.ClientRectangle.Width - Slot.Width;
- break;
- case HorizontalAlignment.Center:
- Slot.X = Parent.ClientRectangle.Width / 2 - Slot.Width / 2;
- break;
- }
- } else
- Slot.X = Bounds.X;
- if (LastSlots.X == Slot.X)
- break;
- //register layouting here for objects depending on this.x
- LastSlots.X = Slot.X;
- break;
- case LayoutingType.Y:
- if (Bounds.Y == 0) {
- switch (VerticalAlignment) {
- case VerticalAlignment.Top:
- Slot.Y = 0;
- break;
- case VerticalAlignment.Bottom:
- Slot.Y = Parent.ClientRectangle.Height - Slot.Height;
- break;
- case VerticalAlignment.Center:
- Slot.Y = Parent.ClientRectangle.Height / 2 - Slot.Height / 2;
- break;
- }
- }else
- Slot.Y = Bounds.Y;
- if (LastSlots.Y == Slot.Y)
- break;
- //register layouting here for objects depending on this.x
- LastSlots.Y = Slot.Y;
- break;
- case LayoutingType.Width:
- if (Width > 0)
- Slot.Width = Width;
- else if (Width < 0)
- Slot.Width = measureRawSize ().Width;
+ switch (layoutType) {
+ case LayoutingType.Width:
+ base.OnLayoutChanges (layoutType);
+ if (child != null) {
+ if (child.getBounds ().Width == 0)
+ child.RegisterForLayouting ((int)LayoutingType.Width);
else
- Slot.Width = Parent.ClientRectangle.Width;
-
- if (LastSlots.Width == Slot.Width)
- break;
-
- if (Parent.getBounds ().Width < 0)
- this.Parent.RegisterForLayouting ((int)LayoutingType.Width);
- else if (Width != 0) //update position in parent
- this.RegisterForLayouting ((int)LayoutingType.X);
-
- if (child != null) {
- if (child.getBounds ().Width == 0)
- child.RegisterForLayouting ((int)LayoutingType.Width);
- else
- child.RegisterForLayouting ((int)LayoutingType.X);
- }
- LastSlots.Width = Slot.Width;
- break;
- case LayoutingType.Height:
- if (Height > 0)
- Slot.Height = Height;
- else if (Height < 0)
- Slot.Height = measureRawSize ().Height;
+ child.RegisterForLayouting ((int)LayoutingType.X);
+ }
+ break;
+ case LayoutingType.Height:
+ base.OnLayoutChanges (layoutType);
+ if (child != null) {
+ if (child.getBounds ().Height == 0)
+ child.RegisterForLayouting ((int)LayoutingType.Height);
else
- Slot.Height = Parent.ClientRectangle.Height;
-
- if (LastSlots.Height == Slot.Height)
- break;
-
- if (Parent.getBounds().Height < 0)
- this.Parent.RegisterForLayouting((int)LayoutingType.Height);
- else if (Height != 0) //update position in parent
- this.RegisterForLayouting ((int)LayoutingType.Y);
-
- if (child != null) {
- if (child.getBounds ().Height == 0)
- child.RegisterForLayouting ((int)LayoutingType.Height);
- else
- child.RegisterForLayouting ((int)LayoutingType.Y);
- }
-
- LastSlots.Height = Slot.Height;
- break;
+ child.RegisterForLayouting ((int)LayoutingType.Y);
}
-
- //if no layouting remains in queue for item, registre for redraw
- if (Interface.LayoutingQueue.Where (lq => lq.GraphicObject == this).Count () <= 0)
- this.RegisterForRedraw ();
- }
+ break;
+ }
}
+// public override void RegisterForLayouting(int layoutType)
+// {
+// Interface.LayoutingQueue.RemoveAll (lq => lq.GraphicObject == this && (layoutType & (int)lq.LayoutType) > 0);
+//
+// if ((layoutType & (int)LayoutingType.Width) > 0) {
+// if (Bounds.Width == 0) //stretch in parent
+// Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Width, this);
+// else //fit ou fixed
+// Interface.LayoutingQueue.Enqueue (LayoutingType.Width, this);
+// }
+//
+// if ((layoutType & (int)LayoutingType.Height) > 0) {
+// if (Bounds.Height == 0) //stretch in parent
+// Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Height, this);
+// else//fit ou fixed
+// Interface.LayoutingQueue.Enqueue (LayoutingType.Height, this);
+// }
+//
+// if ((layoutType & (int)LayoutingType.X) > 0)
+// //for x positionning, sizing of parent and this have to be done
+// Interface.LayoutingQueue.EnqueueAfterThisAndParentSizing (LayoutingType.X, this);
+//
+// if ((layoutType & (int)LayoutingType.Y) > 0)
+// //for x positionning, sizing of parent and this have to be done
+// Interface.LayoutingQueue.EnqueueAfterThisAndParentSizing (LayoutingType.Y, this);
+//
+// }
+
public override Rectangle ContextCoordinates (Rectangle r)
{
return
diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs index 04e63d15..f34e13d3 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/src/GraphicObjects/GenericStack.cs @@ -24,8 +24,9 @@ namespace go public override T addChild<T> (T child)
{
+ T tmp = base.addChild (child);
this.RegisterForLayouting ((int)LayoutingType.PositionChildren);
- return base.addChild (child);
+ return tmp;
}
public override void removeChild (GraphicObject child)
{
@@ -96,17 +97,7 @@ namespace go }
}
}
-// public void RegisterForLayouting ()
-// {
-// base.RegisterForLayouting ();
-//
-// int idx = Interface.LayoutingQueue.IndexOf (Interface.LayoutingQueue.Where (lq => lq.GraphicObject.Parent == this).LastOrDefault ());
-// if (idx < 0)
-// return;
-// Interface.LayoutingQueue.Insert (
-// idx+1,
-// new LayoutingQueueItem (LayoutingType.PositionChildren, this));
-// }
+
public override void RegisterForLayouting (int layoutType)
{
base.RegisterForLayouting (layoutType);
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 9317f409..a7b9e93e 100755..100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -66,49 +66,6 @@ namespace go get { return _parent; }
set { _parent = value; }
}
- [XmlIgnore]public virtual bool SizeIsValid {
- get { return hIsValid & wIsValid; }
- set {
- hIsValid = value;
- wIsValid = value;
- }
- }
- [XmlIgnore]public virtual bool WIsValid {
- get { return wIsValid; }
- set { wIsValid = value; }
- }
- [XmlIgnore]public virtual bool HIsValid {
- get { return hIsValid; }
- set { hIsValid = value; }
- }
- [XmlIgnore]public virtual bool XIsValid {
- get { return xIsValid; }
- set { xIsValid = value; }
- }
- [XmlIgnore]public virtual bool YIsValid {
- get { return yIsValid; }
- set { yIsValid = value; }
- }
- [XmlIgnore]public virtual bool PositionIsValid {
- get { return xIsValid & yIsValid; }
- set {
- xIsValid = value;
- yIsValid = value;
- }
- }
- [XmlIgnore]public virtual bool LayoutIsValid {
- get { return SizeIsValid & PositionIsValid; }
- set {
- if (value == SizeIsValid & PositionIsValid)
- return;
-
- SizeIsValid = value;
- PositionIsValid = value;
-
- //if (!layoutIsValid && Parent != null)
- // Parent.layoutIsValid = false;
- }
- }
[XmlIgnore]public virtual Rectangle ClientRectangle {
get {
Rectangle cb = Slot.Size;
@@ -119,11 +76,6 @@ namespace go [XmlIgnore]public virtual IGOLibHost TopContainer {
get { return Parent == null ? null : Parent.TopContainer; }
}
- public virtual void InvalidateLayout ()
- {
- bmp = null;
- LayoutIsValid = false;
- }
public virtual Rectangle ContextCoordinates(Rectangle r){
return
Parent.ContextCoordinates (r);// + ClientRectangle.Position;
@@ -190,7 +142,7 @@ namespace go Bounds.X = value;
- Interface.LayoutingQueue.Enqueue (LayoutingType.X, this);
+ this.RegisterForLayouting ((int)LayoutingType.X);
}
}
[XmlAttributeAttribute()][DefaultValue(0)]
@@ -202,7 +154,7 @@ namespace go Bounds.Y = value;
- Interface.LayoutingQueue.Enqueue (LayoutingType.Y, this);
+ this.RegisterForLayouting ((int)LayoutingType.Y);
}
}
[XmlAttributeAttribute()][DefaultValue(0)]
@@ -214,7 +166,7 @@ namespace go Bounds.Width = value;
- InvalidateLayout ();
+ this.RegisterForLayouting ((int)LayoutingType.Width);
}
}
[XmlAttributeAttribute()][DefaultValue(0)]
@@ -226,7 +178,7 @@ namespace go Bounds.Height = value;
- InvalidateLayout ();
+ this.RegisterForLayouting ((int)LayoutingType.Height);
}
}
[XmlAttributeAttribute()][DefaultValue(false)]
@@ -237,7 +189,6 @@ namespace go return;
Bounds.Width = Bounds.Height = -1;
- InvalidateLayout ();
}
}
[XmlAttributeAttribute()][DefaultValue(false)]
@@ -399,19 +350,36 @@ namespace go public virtual void RegisterForLayouting(int layoutType)
{
+ if (Parent == null)
+ return;
+
Interface.LayoutingQueue.RemoveAll (lq => lq.GraphicObject == this && (layoutType & (int)lq.LayoutType) > 0);
if ((layoutType & (int)LayoutingType.Width) > 0) {
+
+ //force sizing to fit if parent is sizing on children
+ if (Parent.getBounds ().Width < 0 && Width == 0)
+ Width = -1;
+
if (Bounds.Width == 0) //stretch in parent
Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Width, this);
- else //fit ou fixed
+ else if (Bounds.Width < 0) //fit
+ Interface.LayoutingQueue.EnqueueBeforeParentSizing (LayoutingType.Width, this);
+ else
Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Width, this));
}
if ((layoutType & (int)LayoutingType.Height) > 0) {
+
+ //force sizing to fit if parent is sizing on children
+ if (Parent.getBounds ().Height < 0 && Height == 0)
+ Height = -1;
+
if (Bounds.Height == 0) //stretch in parent
Interface.LayoutingQueue.EnqueueAfterParentSizing (LayoutingType.Height, this);
- else//fit ou fixed
+ else if (Bounds.Height < 0) //fit
+ Interface.LayoutingQueue.EnqueueBeforeParentSizing (LayoutingType.Height, this);
+ else
Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Height, this));
}
@@ -425,42 +393,31 @@ namespace go }
-// public virtual void RegisterForLayouting()
-// {
-// //clear previous layouting for item
-// Interface.LayoutingQueue.RemoveAll (lq => lq.GraphicObject == this);
-//
-// if (Bounds.Width == 0) { //stretch in parent
-// int idxParentW = Interface.LayoutingQueue.IndexOf (Interface.LayoutingQueue.Where(lq => lq.GraphicObject == this.Parent && lq.LayoutType == LayoutingType.Width).FirstOrDefault());
-// if (idxParentW < 0)
-// Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Width, this));
-// else//insert after parent sizing
-// Interface.LayoutingQueue.Insert (idxParentW + 1, new LayoutingQueueItem (LayoutingType.Width, this));
-// } else {//fit ou fixed
-// Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Width, this));
-// //for x positionning, sizing of obj and parent have to be done
-//// int idxParentW = Interface.LayoutingQueue.IndexOf (Interface.LayoutingQueue.Where(lq => lq.GraphicObject == this.Parent && lq.LayoutType == LayoutingType.Width).FirstOrDefault());
-//// if (idxParentW < 0)
-//// Interface.LayoutingQueue.Insert (1, new LayoutingQueueItem (LayoutingType.X, this));
-//// else//insert after parent sizing
-//// Interface.LayoutingQueue.Insert (idxParentW + 1, new LayoutingQueueItem (LayoutingType.X, this));
-// }
-// if (Bounds.Height == 0) { //stretch
-// int idxParentH = Interface.LayoutingQueue.IndexOf (Interface.LayoutingQueue.Where(lq => lq.GraphicObject == this.Parent && lq.LayoutType == LayoutingType.Height).FirstOrDefault());
-// if (idxParentH < 0)
-// Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Height, this));
-// else
-// Interface.LayoutingQueue.Insert (idxParentH + 1, new LayoutingQueueItem (LayoutingType.Height, this));
-// } else {
-// Interface.LayoutingQueue.Insert (0, new LayoutingQueueItem (LayoutingType.Height, this));
-//// int idxParentH = Interface.LayoutingQueue.IndexOf (Interface.LayoutingQueue.Where(lq => lq.GraphicObject == this.Parent && lq.LayoutType == LayoutingType.Height).FirstOrDefault());
-//// if (idxParentH < 0)
-//// Interface.LayoutingQueue.Insert (1, new LayoutingQueueItem (LayoutingType.Y, this));
-//// else//insert after parent sizing
-//// Interface.LayoutingQueue.Insert (idxParentH + 1, new LayoutingQueueItem (LayoutingType.Y, this));
-// }
-// }
-//
+ protected virtual void OnLayoutChanges(LayoutingType layoutType)
+ {
+ switch (layoutType) {
+ case LayoutingType.Width:
+ if (Parent.getBounds ().Width < 0)
+ this.Parent.RegisterForLayouting ((int)LayoutingType.Width);
+ else if (Width != 0) //update position in parent
+ this.RegisterForLayouting ((int)LayoutingType.X);
+ if (!(Parent is GenericStack))
+ break;
+ if ((Parent as GenericStack).Orientation == Orientation.Horizontal)
+ this.Parent.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ break;
+ case LayoutingType.Height:
+ if (Parent.getBounds().Height < 0)
+ this.Parent.RegisterForLayouting((int)LayoutingType.Height);
+ else if (Height != 0) //update position in parent
+ this.RegisterForLayouting ((int)LayoutingType.Y);
+ if (!(Parent is GenericStack))
+ break;
+ if ((Parent as GenericStack).Orientation == Orientation.Vertical)
+ this.Parent.RegisterForLayouting ((int)LayoutingType.PositionChildren);
+ break;
+ }
+ }
public virtual void UpdateLayout (LayoutingType layoutType)
{
switch (layoutType) {
@@ -479,9 +436,14 @@ namespace go }
} else
Slot.X = Bounds.X;
+
if (LastSlots.X == Slot.X)
break;
- //register layouting here for objects depending on this.x
+
+ bmp = null;
+
+ OnLayoutChanges (layoutType);
+
LastSlots.X = Slot.X;
break;
case LayoutingType.Y:
@@ -499,9 +461,14 @@ namespace go }
}else
Slot.Y = Bounds.Y;
+
if (LastSlots.Y == Slot.Y)
break;
- //register layouting here for objects depending on this.x
+
+ bmp = null;
+
+ OnLayoutChanges (layoutType);
+
LastSlots.Y = Slot.Y;
break;
case LayoutingType.Width:
@@ -514,11 +481,10 @@ namespace go if (LastSlots.Width == Slot.Width)
break;
-
- if (Parent.getBounds().Width < 0)
- this.Parent.RegisterForLayouting((int)LayoutingType.Width);
- else if (Width != 0) //update position in parent
- this.RegisterForLayouting ((int)LayoutingType.X);
+
+ bmp = null;
+
+ OnLayoutChanges (layoutType);
LastSlots.Width = Slot.Width;
break;
@@ -533,10 +499,9 @@ namespace go if (LastSlots.Height == Slot.Height)
break;
- if (Parent.getBounds().Height < 0)
- this.Parent.RegisterForLayouting((int)LayoutingType.Height);
- else if (Height != 0) //update position in parent
- this.RegisterForLayouting ((int)LayoutingType.Y);
+ bmp = null;
+
+ OnLayoutChanges (layoutType);
LastSlots.Height = Slot.Height;
break;
@@ -569,6 +534,7 @@ namespace go onDraw (gr);
}
draw.Flush ();
+ //draw.WriteToPng ("/mnt/data/test.png");
}
}
diff --git a/src/GraphicObjects/Group.cs b/src/GraphicObjects/Group.cs index e1639533..7b63156f 100644 --- a/src/GraphicObjects/Group.cs +++ b/src/GraphicObjects/Group.cs @@ -46,6 +46,7 @@ namespace go child.Parent = null;
this.RegisterForLayouting ((int)LayoutingType.Sizing);
}
+
public void putWidgetOnTop(GraphicObject w)
{
if (Children.Contains(w))
@@ -104,12 +105,6 @@ namespace go }
return false;
}
- public override void InvalidateLayout()
- {
- base.InvalidateLayout();
- foreach (GraphicObject w in Children)
- w.InvalidateLayout();
- }
protected override Size measureRawSize ()
{
Size tmp = new Size ();
@@ -125,39 +120,7 @@ namespace go return tmp;
}
-// public override void UpdateLayout (LayoutingType layoutType)
-// {
-// if (LayoutIsValid)
-// return;
-//
-// bool atLeastOneChildHasWNotDependingOnParent = false;
-// bool atLeastOneChildHasHNotDependingOnParent = false;
-//
-//// foreach (GraphicObject c in Children) {
-//// if (c.LayoutIsValid)
-//// continue;
-////
-//// if (Width < 0 && c.WIsValid) {
-//// if (!atLeastOneChildHasWNotDependingOnParent && !(this is GenericStack))
-//// c.XIsValid = true;
-//// atLeastOneChildHasWNotDependingOnParent = true;
-//// }
-//// if (Height < 0 && c.HIsValid) {
-//// if (!atLeastOneChildHasHNotDependingOnParent && !(this is GenericStack))
-//// c.YIsValid = true;
-//// atLeastOneChildHasHNotDependingOnParent = true;
-//// }
-////
-//// c.UpdateLayout ();
-//// }
-//
-//// if (Width < 0 && !atLeastOneChildHasWNotDependingOnParent)
-//// Debug.WriteLine ("ERROR: no child has fixed width and parent width is set to content!");
-//// if (Height < 0 && !atLeastOneChildHasHNotDependingOnParent)
-//// Debug.WriteLine ("ERROR: no child has fixed height and parent height is set to content!");
-//
-// //base.UpdateLayout ();
-// }
+
public override Rectangle ContextCoordinates(Rectangle r){
return r + ClientRectangle.Position;
@@ -246,15 +209,15 @@ namespace go }
#endregion
- public override string ToString()
- {
- string tmp = base.ToString();
- foreach (GraphicObject w in Children)
- {
- tmp += "\n" + w.ToString();
- }
- return tmp;
- }
+// public override string ToString()
+// {
+// string tmp = base.ToString();
+// foreach (GraphicObject w in Children)
+// {
+// tmp += "\n" + w.ToString();
+// }
+// return tmp;
+// }
#region IXmlSerializable
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs index ee62a266..1f6048d1 100755 --- a/src/GraphicObjects/Label.cs +++ b/src/GraphicObjects/Label.cs @@ -86,7 +86,8 @@ namespace go return;
registerForGraphicUpdate();
- InvalidateLayout();
+ this.RegisterForLayouting ((int)LayoutingType.Sizing);
+
_text = value;
diff --git a/src/GraphicObjects/NumericControl.cs b/src/GraphicObjects/NumericControl.cs index 51a3fdc5..93aadc84 100644 --- a/src/GraphicObjects/NumericControl.cs +++ b/src/GraphicObjects/NumericControl.cs @@ -43,8 +43,6 @@ namespace go _minValue = value; - LayoutIsValid = false; - registerForGraphicUpdate (); } } [XmlAttributeAttribute()][DefaultValue(10.0)] @@ -57,8 +55,6 @@ namespace go _maxValue = value; - LayoutIsValid = false; - registerForGraphicUpdate (); } } [XmlAttributeAttribute()][DefaultValue(0.5)] @@ -71,8 +67,6 @@ namespace go _smallStep = value; - LayoutIsValid = false; - registerForGraphicUpdate (); } } [XmlAttributeAttribute()][DefaultValue(2.0)] @@ -85,8 +79,6 @@ namespace go _bigStep = value; - LayoutIsValid = false; - registerForGraphicUpdate (); } } [XmlAttributeAttribute()][DefaultValue(0)] diff --git a/src/GraphicObjects/Scroller.cs b/src/GraphicObjects/Scroller.cs index 6855e924..19b93cd8 100644 --- a/src/GraphicObjects/Scroller.cs +++ b/src/GraphicObjects/Scroller.cs @@ -115,8 +115,8 @@ namespace go {
TopContainer.redrawClip.AddRectangle (base.ScreenCoordinates(Slot));
}
- public override void UpdateLayout (LayoutingType layoutType)
- {
+// public override void UpdateLayout (LayoutingType layoutType)
+// {
// base.UpdateLayout ();
//
// if (!LayoutIsValid)
@@ -130,7 +130,7 @@ namespace go // child.Slot.Y = 0;
// if (HorizontalScrolling)
// child.Slot.X = 0;
- }
+ //}
public override void Paint(ref Cairo.Context ctx, Rectangles clip = null)
{
if (!Visible)//check if necessary??
diff --git a/src/LayoutingQueue.cs b/src/LayoutingQueue.cs index 142a3079..2d96788f 100644 --- a/src/LayoutingQueue.cs +++ b/src/LayoutingQueue.cs @@ -43,6 +43,17 @@ namespace go Interface.LayoutingQueue.Insert (idxParentSz + 1, lqi); } + public void EnqueueBeforeParentSizing (LayoutingType _lt, ILayoutable _object) + { + LayoutingQueueItem lqi = new LayoutingQueueItem (_lt, _object); + int idxParentSz = Interface.LayoutingQueue.IndexOf + (Interface.LayoutingQueue.Where(lq => lq.GraphicObject == _object.Parent && lq.LayoutType == _lt).FirstOrDefault()); + + if (idxParentSz < 0) + Interface.LayoutingQueue.Enqueue (_lt, _object); + else + Interface.LayoutingQueue.Insert (idxParentSz, lqi); + } public void EnqueueAfterThisAndParentSizing (LayoutingType _lt, ILayoutable _object) { LayoutingQueueItem lqi = new LayoutingQueueItem (_lt, _object); diff --git a/src/LayoutingQueueItem.cs b/src/LayoutingQueueItem.cs index e1d21792..b028fb83 100644 --- a/src/LayoutingQueueItem.cs +++ b/src/LayoutingQueueItem.cs @@ -47,7 +47,7 @@ namespace go } public void ProcessLayouting() { - Debug.WriteLine ("Layouting => " + this.ToString ()); + //Debug.WriteLine ("Layouting => " + this.ToString ()); try { GraphicObject.UpdateLayout (LayoutType); } catch (Exception ex) { |