]> O.S.I.I.S - jp/crow.git/commitdiff
code clean
authorjpbruyere <jp.bruyere@hotmail.com>
Sun, 7 Feb 2016 15:57:05 +0000 (16:57 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Sun, 7 Feb 2016 15:57:05 +0000 (16:57 +0100)
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/Group.cs
src/GraphicObjects/ListBox.cs
src/LayoutingQueueItem.cs

index d04c94d75ae511da874fc36d47fec7cca9e45246..88af16dd85fa74c0af07f2a39c4e77b05b87459a 100644 (file)
@@ -469,7 +469,7 @@ namespace Crow
                public virtual void registerClipRect()
                {
                        HostContainer.redrawClip.AddRectangle (ScreenCoordinates(Slot));
-                       //this clipping should take only last painted slots in ancestor tree which
+                       //this clipping should take only last painted slots on each level in ancestor tree which
                        //is not the case for now.
                        HostContainer.redrawClip.AddRectangle (ScreenCoordinates(LastPaintedSlot));
                }
@@ -531,6 +531,7 @@ namespace Crow
                        Debug.WriteLine ("RegisterForLayouting => {1}->{0}", layoutType, this.ToString());
                        #endif
 
+                       //enqueue LQI LayoutingTypes separately
                        if (layoutType.HasFlag (LayoutingType.Width))
                                Interface.LayoutingQueue.Enqueue (new LayoutingQueueItem (LayoutingType.Width, this));
                        if (layoutType.HasFlag (LayoutingType.Height))
@@ -728,7 +729,6 @@ namespace Crow
                                        onDraw (gr);
                                }
                                draw.Flush ();
-                               //draw.WriteToPng ("/mnt/data/test.png");
                        }
                }
                /// <summary> Chained painting routine on the parent context of the actual cached version
index 9006191d46408836be2236e2f1fd21960e746be7..8737b86657e9046c0ddbb916642aa01c89d53b99 100644 (file)
@@ -14,9 +14,7 @@ namespace Crow
     {
                #region CTOR
                public Group()
-                       : base()
-               {            
-               }
+                       : base(){}
                #endregion
 
                #region EVENT HANDLERS
@@ -35,7 +33,6 @@ namespace Crow
 
         public virtual List<GraphicObject> Children {
                        get { return children; }
-                       set { children = value; }
                }
                [XmlAttributeAttribute()][DefaultValue(false)]
         public bool MultiSelect
@@ -64,14 +61,12 @@ namespace Crow
         }
                public virtual void ClearChildren()
                {
-                       int cpt = children.Count;
-                       while(cpt > 0){
-                               GraphicObject g = children[cpt-1];
+                       while(children.Count > 0){
+                               GraphicObject g = children[children.Count-1];
                                g.LayoutChanged -= OnChildLayoutChanges;
                                g.ClearBinding ();
                                g.Parent = null;
-                               Children.RemoveAt(cpt-1);
-                               cpt = children.Count;
+                               Children.RemoveAt(children.Count-1);
                        }
                        this.RegisterForLayouting (LayoutingType.Sizing);
                        ChildrenCleared.Raise (this, new EventArgs ());
index 788d835f8ea58f96163288528dac95b4eb6df2c1..dfa248cf2857e869b6a17ec1947d8a802331cf70 100644 (file)
@@ -100,9 +100,9 @@ namespace Crow
                                foreach (var item in data) {
                                        ms.Seek(0,SeekOrigin.Begin);
                                        GraphicObject g = Interface.Load (ms, t);
-                                       g.DataSource = item;
                                        g.MouseClick += itemClick;
                                        _list.addChild (g);
+                                       g.DataSource = item;
                                }
 
                                ms.Dispose ();                  
index ef787d3559afb9844ce7c8cf4044949a5d5c7d60..a263f5fce716136e385417f54e40b0379e37166c 100644 (file)
@@ -51,18 +51,21 @@ namespace Crow
        
                public void ProcessLayouting()
                {
-                       #if DEBUG_LAYOUTING
-                       Debug.WriteLine ("Layouting => " + this.ToString ());
-                       #endif
-
                        if (GraphicObject.Parent == null) {
                                //cancel layouting for object without parent, maybe some were in queue when
                                //removed from a listbox
                                Debug.WriteLine ("ERROR: processLayouting, no parent for: " + this.ToString ());
                                return;
                        }
-                       if (!GraphicObject.UpdateLayout (LayoutType))
-                               Interface.LayoutingQueue.Enqueue(this);
+                       if (!GraphicObject.UpdateLayout (LayoutType)) {
+                               #if DEBUG_LAYOUTING
+                               Debug.WriteLine ("Requeuing => " + this.ToString ());
+                               #endif
+                               Interface.LayoutingQueue.Enqueue (this);
+                       }else
+                               #if DEBUG_LAYOUTING
+                               Debug.WriteLine ("Layouting => " + this.ToString ());
+                               #endif
                }
 
                public static implicit operator GraphicObject(LayoutingQueueItem queueItem)