]> O.S.I.I.S - jp/crow.git/commitdiff
add fixed width and height to default win style.
authorjpbruyere <jp.bruyere@hotmail.com>
Mon, 1 Aug 2016 07:44:59 +0000 (09:44 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Mon, 1 Aug 2016 07:44:59 +0000 (09:44 +0200)
modifié :         Default.style

Remove redundant drawing Queue (redrawingList)
modifié :         src/GraphicObjects/GenericStack.cs
modifié :         src/GraphicObjects/GraphicObject.cs
modifié :         src/GraphicObjects/Grid.cs
modifié :         src/GraphicObjects/TabView.cs
modifié :         src/Interface.cs

Default.style
src/GraphicObjects/GenericStack.cs
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/Grid.cs
src/GraphicObjects/TabView.cs
src/Interface.cs

index 9e16e38c5db3704b5955defc186e5523d63c57db..77d281f126a019598572a5927f4c1440deffe2f1 100644 (file)
@@ -1,5 +1,5 @@
 Button, CheckBox, RadioButton, ComboBox, Expandable,
-MessageBox, Popper, Slider, Spinner, TextBox, Window  {
+MessageBox, Popper, Slider, Spinner, TextBox {
        Focusable = true;
        Height = Fit;
 }
@@ -33,6 +33,8 @@ TextBox {
        Foreground = Black;
 }
 Window {
+       Focusable = true;
        MinimumSize=50,50;
-       Width = Fit;
+       Width = 150;
+       Height = 150;
 }
\ No newline at end of file
index adf428c5f70fd3088fbf1a5b38d80021b305e095..3ec29fb5aedc7f94bd08528d3574ceb739161b94 100644 (file)
@@ -98,8 +98,8 @@ namespace Crow
                                ComputeChildrenPositions ();
 
                                //if no layouting remains in queue for item, registre for redraw
-                               if (RegisteredLayoutings == LayoutingType.None && bmp==null)
-                                       this.AddToRedrawList ();
+                               if (RegisteredLayoutings == LayoutingType.None && bmp == null)
+                                       RegisterForGraphicUpdate ();
 
                                return true;
                        }
index c181c9acde9d11c5d6ba37c3e03cd3ecdeab6170..8c91824d5b5d3f51e2386d5b9eb263e6c4c9d92e 100644 (file)
@@ -47,6 +47,7 @@ namespace Crow
 
                        if (Interface.CurrentInterface.XmlLoading)
                                return;
+                       loadDefaultValues ();
                }
                public GraphicObject (Rectangle _bounds)
                {
@@ -708,14 +709,6 @@ namespace Crow
                {
                        Interface.RegisterForGraphicUpdate (this);
                }
-               internal bool IsInRedrawList = false;
-               /// <summary>
-               /// Add clipping region in redraw list of interface, dont update cached object content
-               /// </summary>
-               internal void AddToRedrawList ()
-               {
-                       Interface.AddToRedrawList (this);
-               }
 
                #region Layouting
                [XmlIgnore]public int LayoutingTries {
@@ -937,7 +930,7 @@ namespace Crow
 
                        //if no layouting remains in queue for item, registre for redraw
                        if (this.registeredLayoutings == LayoutingType.None && bmp == null)
-                               this.AddToRedrawList ();
+                               RegisterForGraphicUpdate ();
 
                        return true;
                }
index a16deb8cd04cb5e5833dd4781a1aabe0f677b5ae..92b4f906366720be1a8f35ec675733518e9d66ba 100644 (file)
@@ -135,8 +135,8 @@ namespace Crow
                                ComputeChildrenPositions ();
 
                                //if no layouting remains in queue for item, registre for redraw
-                               if (RegisteredLayoutings == LayoutingType.None && bmp==null)
-                                       this.AddToRedrawList ();
+                               if (RegisteredLayoutings == LayoutingType.None && bmp == null)
+                                       this.RegisterForGraphicUpdate ();
                                
                                return true;
                        }
index 8ec50ec9bc7a480af612ab066fe87fcae16d9b74..5afcdaad1853c18523c67cec7628a70d5f8ca088 100644 (file)
@@ -147,8 +147,8 @@ namespace Crow
                                }
 
                                //if no layouting remains in queue for item, registre for redraw
-                               if (RegisteredLayoutings == LayoutingType.None && bmp==null)
-                                       this.AddToRedrawList ();
+                               if (RegisteredLayoutings == LayoutingType.None && bmp == null)
+                                       RegisterForGraphicUpdate ();
 
                                return true;
                        }
index 02b6efaf2d92bf45750f49f9c2703d2b63b7c7cc..dee5e146790228f9939d3d8181946a8062406e64 100644 (file)
@@ -102,15 +102,6 @@ namespace Crow
                                g.IsQueueForGraphicUpdate = true;
                        }
                }
-               public static void AddToRedrawList(GraphicObject g)
-               {
-                       if (g.IsInRedrawList)
-                               return;
-                       if (Interface.CurrentInterface == null)
-                               return;
-                       Interface.CurrentInterface.RedrawList.Add (g);
-                       g.IsInRedrawList = true;
-               }
 
                #region default values loading helpers
                /// Default values of properties from GraphicObjects are retrieve from XML Attributes.
@@ -298,7 +289,6 @@ namespace Crow
                public static Interface CurrentInterface;
 
                Rectangles _redrawClip = new Rectangles();//should find another way to access it from child
-               List<GraphicObject> _gobjsToRedraw = new List<GraphicObject>();
 
                Context ctx;
                Surface surf;
@@ -434,24 +424,16 @@ namespace Crow
                                        GraphicObject g = CurrentInterface.GraphicUpdateQueue.Dequeue ();
                                        g.bmp = null;
                                        g.IsQueueForGraphicUpdate = false;
-                                       AddToRedrawList (g);
-                               }
-                       }
-                       //Debug.WriteLine ("otd:" + gobjsToRedraw.Count.ToString () + "-");
-                       //final redraw clips should be added only when layout is completed among parents,
-                       //that's why it take place in a second pass
-                       foreach (GraphicObject p in RedrawList) {
-                               try {
-                                       p.IsInRedrawList = false;
-                                       if (p.Parent == null)
-                                               continue;
-                                       p.Parent.RegisterClip (p.LastPaintedSlot);
-                                       p.Parent.RegisterClip (p.getSlot ());
-                               } catch (Exception ex) {
-                                       Debug.WriteLine ("Error Register Clip: " + ex.ToString ());
+                                       try {
+                                               if (g.Parent == null)
+                                                       continue;
+                                               g.Parent.RegisterClip (g.LastPaintedSlot);
+                                               g.Parent.RegisterClip (g.getSlot ());
+                                       } catch (Exception ex) {
+                                               Debug.WriteLine ("Error Register Clip: " + ex.ToString ());
+                                       }
                                }
                        }
-                       RedrawList.Clear ();
                        #if MEASURE_TIME
                        clippingTime.Stop ();
                        #endif
@@ -519,10 +501,6 @@ namespace Crow
                        get { return _redrawClip; }
                        set { _redrawClip = value; }
                }
-               public List<GraphicObject> RedrawList {
-                       get { return _gobjsToRedraw; }
-                       set { _gobjsToRedraw = value; }
-               }
                public void AddWidget(GraphicObject g)
                {
                        g.Parent = this;