From: jpbruyere Date: Mon, 1 Aug 2016 07:44:59 +0000 (+0200) Subject: add fixed width and height to default win style. X-Git-Tag: v0.4~22 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=fd5b776826028a0c12a92f11d1daf4065d4c6024;p=jp%2Fcrow.git add fixed width and height to default win style. 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 --- diff --git a/Default.style b/Default.style index 9e16e38c..77d281f1 100644 --- a/Default.style +++ b/Default.style @@ -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 diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs index adf428c5..3ec29fb5 100644 --- a/src/GraphicObjects/GenericStack.cs +++ b/src/GraphicObjects/GenericStack.cs @@ -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; } diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index c181c9ac..8c91824d 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -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; - /// - /// Add clipping region in redraw list of interface, dont update cached object content - /// - 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; } diff --git a/src/GraphicObjects/Grid.cs b/src/GraphicObjects/Grid.cs index a16deb8c..92b4f906 100644 --- a/src/GraphicObjects/Grid.cs +++ b/src/GraphicObjects/Grid.cs @@ -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; } diff --git a/src/GraphicObjects/TabView.cs b/src/GraphicObjects/TabView.cs index 8ec50ec9..5afcdaad 100644 --- a/src/GraphicObjects/TabView.cs +++ b/src/GraphicObjects/TabView.cs @@ -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; } diff --git a/src/Interface.cs b/src/Interface.cs index 02b6efaf..dee5e146 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -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 _gobjsToRedraw = new List(); 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 RedrawList { - get { return _gobjsToRedraw; } - set { _gobjsToRedraw = value; } - } public void AddWidget(GraphicObject g) { g.Parent = this;