aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects
diff options
context:
space:
mode:
Diffstat (limited to 'src/GraphicObjects')
-rw-r--r--src/GraphicObjects/Border.cs5
-rw-r--r--src/GraphicObjects/GenericStack.cs41
-rw-r--r--src/GraphicObjects/GraphicObject.cs111
-rw-r--r--src/GraphicObjects/Grid.cs2
-rw-r--r--src/GraphicObjects/Group.cs4
-rw-r--r--src/GraphicObjects/Label.cs24
-rw-r--r--src/GraphicObjects/ListBox.cs2
-rw-r--r--src/GraphicObjects/NumericControl.cs8
-rw-r--r--src/GraphicObjects/PrivateContainer.cs10
-rw-r--r--src/GraphicObjects/Scroller.cs4
-rw-r--r--src/GraphicObjects/Slider.cs3
-rw-r--r--src/GraphicObjects/TabView.cs8
-rw-r--r--src/GraphicObjects/TextBox.cs10
-rw-r--r--src/GraphicObjects/TextRun.cs6
-rw-r--r--src/GraphicObjects/Trend.cs12
15 files changed, 141 insertions, 109 deletions
diff --git a/src/GraphicObjects/Border.cs b/src/GraphicObjects/Border.cs
index c6355726..6c1ed6a1 100644
--- a/src/GraphicObjects/Border.cs
+++ b/src/GraphicObjects/Border.cs
@@ -24,11 +24,6 @@ namespace Crow
RegisterForGraphicUpdate ();
}
}
- [XmlAttributeAttribute()][DefaultValue("White")]
- public override Fill Foreground {
- get { return base.Foreground;}
- set {base.Foreground = value;}
- }
#endregion
#region GraphicObject override
diff --git a/src/GraphicObjects/GenericStack.cs b/src/GraphicObjects/GenericStack.cs
index 3ec29fb5..efa98d1a 100644
--- a/src/GraphicObjects/GenericStack.cs
+++ b/src/GraphicObjects/GenericStack.cs
@@ -1,6 +1,7 @@
using System.ComponentModel;
using System.Diagnostics;
using System.Xml.Serialization;
+using System;
namespace Crow
{
@@ -99,7 +100,7 @@ namespace Crow
//if no layouting remains in queue for item, registre for redraw
if (RegisteredLayoutings == LayoutingType.None && bmp == null)
- RegisterForGraphicUpdate ();
+ Interface.CurrentInterface.EnqueueForRepaint (this);
return true;
}
@@ -126,15 +127,22 @@ namespace Crow
contentSize.Width += go.Slot.Width - go.LastSlots.Width;
if (stretchedGO != null) {
- stretchedGO.Slot.Width = this.ClientRectangle.Width - contentSize.Width - Spacing * (Children.Count - 1);
- stretchedGO.bmp = null;
+ int newW = Math.Max (
+ this.ClientRectangle.Width - contentSize.Width - Spacing * (Children.Count - 1),
+ stretchedGO.MinimumSize.Width);
+ if (stretchedGO.MaximumSize.Width > 0)
+ newW = Math.Min (newW, stretchedGO.MaximumSize.Width);
+ if (newW != stretchedGO.Slot.Width) {
+ stretchedGO.Slot.Width = newW;
+ stretchedGO.bmp = null;
#if DEBUG_LAYOUTING
Debug.WriteLine ("\tAdjusting Width of " + stretchedGO.ToString());
#endif
- stretchedGO.LayoutChanged -= OnChildLayoutChanges;
- stretchedGO.OnLayoutChanges (LayoutingType.Width);
- stretchedGO.LayoutChanged += OnChildLayoutChanges;
- stretchedGO.LastSlots.Width = stretchedGO.Slot.Width;
+ stretchedGO.LayoutChanged -= OnChildLayoutChanges;
+ stretchedGO.OnLayoutChanges (LayoutingType.Width);
+ stretchedGO.LayoutChanged += OnChildLayoutChanges;
+ stretchedGO.LastSlots.Width = stretchedGO.Slot.Width;
+ }
}
if (Width == Measure.Fit)
@@ -158,15 +166,22 @@ namespace Crow
contentSize.Height += go.Slot.Height - go.LastSlots.Height;
if (stretchedGO != null) {
- stretchedGO.Slot.Height = this.ClientRectangle.Height - contentSize.Height - Spacing * (Children.Count -1);
- stretchedGO.bmp = null;
+ int newH = Math.Max (
+ this.ClientRectangle.Height - contentSize.Height - Spacing * (Children.Count - 1),
+ stretchedGO.MinimumSize.Height);
+ if (stretchedGO.MaximumSize.Height > 0)
+ newH = Math.Min (newH, stretchedGO.MaximumSize.Height);
+ if (newH != stretchedGO.Slot.Height) {
+ stretchedGO.Slot.Height = newH;
+ stretchedGO.bmp = null;
#if DEBUG_LAYOUTING
Debug.WriteLine ("\tAdjusting Width of " + stretchedGO.ToString());
#endif
- stretchedGO.LayoutChanged -= OnChildLayoutChanges;
- stretchedGO.OnLayoutChanges (LayoutingType.Height);
- stretchedGO.LayoutChanged += OnChildLayoutChanges;
- stretchedGO.LastSlots.Height = stretchedGO.Slot.Height;
+ stretchedGO.LayoutChanged -= OnChildLayoutChanges;
+ stretchedGO.OnLayoutChanges (LayoutingType.Height);
+ stretchedGO.LayoutChanged += OnChildLayoutChanges;
+ stretchedGO.LastSlots.Height = stretchedGO.Slot.Height;
+ }
}
if (Height == Measure.Fit)
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index 8c91824d..7a2e8ec5 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -241,10 +241,22 @@ namespace Crow
if (value < MinimumSize.Width || (value > MaximumSize.Width && MaximumSize.Width > 0))
return;
}
-
+ Measure lastWP = WidthPolicy;
_width = value;
NotifyValueChanged ("Width", _width);
- NotifyValueChanged ("WidthPolicy", WidthPolicy);
+ if (WidthPolicy != lastWP) {
+ NotifyValueChanged ("WidthPolicy", WidthPolicy);
+ //contentSize in Stacks are only update on childLayoutChange, and the single stretched
+ //child of the stack is not counted in contentSize, so when changing size policy of a child
+ //we should adapt contentSize
+ //TODO:check case when child become stretched, and another stretched item already exists.
+ if (_parent is GenericStack) {//TODO:check if I should test Group instead
+ if (lastWP == Measure.Fit)
+ (_parent as GenericStack).contentSize.Width -= this.LastSlots.Width;
+ else
+ (_parent as GenericStack).contentSize.Width += this.LastSlots.Width;
+ }
+ }
this.RegisterForLayouting (LayoutingType.Width);
}
@@ -259,10 +271,18 @@ namespace Crow
if (value < MinimumSize.Height || (value > MaximumSize.Height && MaximumSize.Height > 0))
return;
}
-
+ Measure lastHP = HeightPolicy;
_height = value;
NotifyValueChanged ("Height", _height);
- NotifyValueChanged ("HeightPolicy", HeightPolicy);
+ if (HeightPolicy != lastHP) {
+ NotifyValueChanged ("HeightPolicy", HeightPolicy);
+ if (_parent is GenericStack) {
+ if (lastHP == Measure.Fit)
+ (_parent as GenericStack).contentSize.Height -= this.LastSlots.Height;
+ else
+ (_parent as GenericStack).contentSize.Height += this.LastSlots.Height;
+ }
+ }
this.RegisterForLayouting (LayoutingType.Height);
}
@@ -342,7 +362,7 @@ namespace Crow
return;
_background = value;
NotifyValueChanged ("Background", _background);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue("White")]
@@ -353,7 +373,7 @@ namespace Crow
return;
_foreground = value;
NotifyValueChanged ("Foreground", _foreground);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue("sans,10")]
@@ -375,7 +395,7 @@ namespace Crow
return;
_cornerRadius = value;
NotifyValueChanged ("CornerRadius", _cornerRadius);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(0)]
@@ -402,8 +422,8 @@ namespace Crow
return;
//ensure main win doesn't keep hidden childrens ref
- if (!_isVisible && this.Contains (Interface.CurrentInterface.hoverWidget))
- Interface.CurrentInterface.hoverWidget = null;
+ if (!_isVisible && this.Contains (Interface.CurrentInterface.HoverWidget))
+ Interface.CurrentInterface.HoverWidget = null;
if (Parent is GraphicObject)
(Parent as GraphicObject).RegisterForLayouting (LayoutingType.Sizing);
@@ -412,7 +432,7 @@ namespace Crow
if (_isVisible)
RegisterForLayouting (LayoutingType.Sizing);
- RegisterForGraphicUpdate ();
+ Interface.CurrentInterface.EnqueueForRepaint (this);
NotifyValueChanged ("Visible", _isVisible);
}
@@ -497,14 +517,16 @@ namespace Crow
Interface.DefaultValuesLoader [Style] (this);
return;
}
- }
- if (Interface.DefaultValuesLoader.ContainsKey (thisType.FullName)) {
- Interface.DefaultValuesLoader [thisType.FullName] (this);
- return;
- }
- if (Interface.DefaultValuesLoader.ContainsKey (thisType.Name)) {
- Interface.DefaultValuesLoader [thisType.Name] (this);
- return;
+ } else {
+ if (Interface.DefaultValuesLoader.ContainsKey (thisType.FullName)) {
+ Interface.DefaultValuesLoader [thisType.FullName] (this);
+ return;
+ } else if (!Interface.Styling.ContainsKey (thisType.FullName)) {
+ if (Interface.DefaultValuesLoader.ContainsKey (thisType.Name)) {
+ Interface.DefaultValuesLoader [thisType.Name] (this);
+ return;
+ }
+ }
}
List<Dictionary<string, object>> styling = new List<Dictionary<string, object>>();
@@ -516,17 +538,17 @@ namespace Crow
// those files being placed in a Styles folder
string styleKey = Style;
if (!string.IsNullOrEmpty (Style)) {
- if (Interface.CurrentInterface.Styling.ContainsKey (Style)) {
- styling.Add (Interface.CurrentInterface.Styling [Style]);
+ if (Interface.Styling.ContainsKey (Style)) {
+ styling.Add (Interface.Styling [Style]);
}
}
- if (Interface.CurrentInterface.Styling.ContainsKey (thisType.FullName)) {
- styling.Add (Interface.CurrentInterface.Styling [thisType.FullName]);
+ if (Interface.Styling.ContainsKey (thisType.FullName)) {
+ styling.Add (Interface.Styling [thisType.FullName]);
if (string.IsNullOrEmpty (styleKey))
styleKey = thisType.FullName;
}
- if (Interface.CurrentInterface.Styling.ContainsKey (thisType.Name)) {
- styling.Add (Interface.CurrentInterface.Styling [thisType.Name]);
+ if (Interface.Styling.ContainsKey (thisType.Name)) {
+ styling.Add (Interface.Styling [thisType.Name]);
if (string.IsNullOrEmpty (styleKey))
styleKey = thisType.Name;
}
@@ -582,7 +604,10 @@ namespace Crow
}
}
if (styleIndex >= 0){
- defaultValue = styling[styleIndex] [name];
+ if (pi.PropertyType.IsEnum)//maybe should be in parser..
+ defaultValue = Enum.Parse(pi.PropertyType, (string)styling[styleIndex] [name], true);
+ else
+ defaultValue = styling[styleIndex] [name];
}else {
DefaultValueAttribute dv = (DefaultValueAttribute)pi.GetCustomAttribute (typeof (DefaultValueAttribute));
if (dv == null)
@@ -685,8 +710,12 @@ namespace Crow
il.Emit(OpCodes.Ret);
#endregion
- Interface.DefaultValuesLoader[styleKey] = (Interface.loadDefaultInvoker)dm.CreateDelegate(typeof(Interface.loadDefaultInvoker));
- Interface.DefaultValuesLoader[styleKey] (this);
+ try {
+ Interface.DefaultValuesLoader[styleKey] = (Interface.loadDefaultInvoker)dm.CreateDelegate(typeof(Interface.loadDefaultInvoker));
+ Interface.DefaultValuesLoader[styleKey] (this);
+ } catch (Exception ex) {
+ throw new Exception ("Error applying style <" + styleKey + ">:", ex);
+ }
}
public virtual GraphicObject FindByName(string nameToFind){
@@ -701,21 +730,29 @@ namespace Crow
if (Parent != null)
Parent.RegisterClip (clip + Slot.Position + ClientRectangle.Position);
}
- public bool IsQueueForGraphicUpdate = false;
- /// <summary>
- /// Clear chached object and add clipping region in redraw list of interface
- /// </summary>
+ public bool IsQueueForRedraw = false;
+ /// <summary> Full update, taking care of sizing policy </summary>
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void RegisterForGraphicUpdate ()
{
- Interface.RegisterForGraphicUpdate (this);
+ bmp = null;
+ if (Width == Measure.Fit || Height == Measure.Fit)
+ RegisterForLayouting (LayoutingType.Sizing);
+ Interface.CurrentInterface.EnqueueForRepaint (this);
+ }
+ /// <summary> query an update of the content, a redraw </summary>
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
+ public void RegisterForRedraw ()
+ {
+ bmp = null;
+ Interface.CurrentInterface.EnqueueForRepaint (this);
}
-
#region Layouting
[XmlIgnore]public int LayoutingTries {
get { return layoutingTries; }
set { layoutingTries = value; }
}
- protected Size contentSize;
+ internal Size contentSize;
/// <summary> return size of content + margins </summary>
protected virtual int measureRawSize (LayoutingType lt) {
return lt == LayoutingType.Width ?
@@ -930,7 +967,7 @@ namespace Crow
//if no layouting remains in queue for item, registre for redraw
if (this.registeredLayoutings == LayoutingType.None && bmp == null)
- RegisterForGraphicUpdate ();
+ Interface.CurrentInterface.EnqueueForRepaint (this);
return true;
}
@@ -1044,8 +1081,8 @@ namespace Crow
}
public virtual void checkHoverWidget(MouseMoveEventArgs e)
{
- if (Interface.CurrentInterface.hoverWidget != this) {
- Interface.CurrentInterface.hoverWidget = this;
+ if (Interface.CurrentInterface.HoverWidget != this) {
+ Interface.CurrentInterface.HoverWidget = this;
onMouseEnter (this, e);
}
diff --git a/src/GraphicObjects/Grid.cs b/src/GraphicObjects/Grid.cs
index 92b4f906..525827e0 100644
--- a/src/GraphicObjects/Grid.cs
+++ b/src/GraphicObjects/Grid.cs
@@ -136,7 +136,7 @@ namespace Crow
//if no layouting remains in queue for item, registre for redraw
if (RegisteredLayoutings == LayoutingType.None && bmp == null)
- this.RegisterForGraphicUpdate ();
+ Interface.CurrentInterface.EnqueueForRepaint (this);
return true;
}
diff --git a/src/GraphicObjects/Group.cs b/src/GraphicObjects/Group.cs
index 2b440ac1..48f835ac 100644
--- a/src/GraphicObjects/Group.cs
+++ b/src/GraphicObjects/Group.cs
@@ -290,8 +290,8 @@ namespace Crow
#region Mouse handling
public override void checkHoverWidget (MouseMoveEventArgs e)
{
- if (Interface.CurrentInterface.hoverWidget != this) {
- Interface.CurrentInterface.hoverWidget = this;
+ if (Interface.CurrentInterface.HoverWidget != this) {
+ Interface.CurrentInterface.HoverWidget = this;
onMouseEnter (this, e);
}
for (int i = Children.Count - 1; i >= 0; i--) {
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs
index 505bd69e..2f5798ee 100644
--- a/src/GraphicObjects/Label.cs
+++ b/src/GraphicObjects/Label.cs
@@ -79,7 +79,7 @@ namespace Crow
return;
selColor = value;
NotifyValueChanged ("SelectionBackground", selColor);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute][DefaultValue("White")]
@@ -90,7 +90,7 @@ namespace Crow
return;
selFontColor = value;
NotifyValueChanged ("SelectionForeground", selFontColor);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute][DefaultValue(Alignment.Left)]
@@ -101,8 +101,7 @@ namespace Crow
if (value == _textAlignment)
return;
_textAlignment = value;
- RegisterForGraphicUpdate ();
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
NotifyValueChanged ("TextAlignment", _textAlignment);
}
}
@@ -113,7 +112,7 @@ namespace Crow
if (horizontalStretch == value)
return;
horizontalStretch = value;
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
NotifyValueChanged ("HorizontalStretch", horizontalStretch);
}
}
@@ -124,8 +123,8 @@ namespace Crow
if (verticalStretch == value)
return;
verticalStretch = value;
+ RegisterForRedraw ();
NotifyValueChanged ("VerticalStretch", verticalStretch);
-
}
}
[XmlAttributeAttribute][DefaultValue("label")]
@@ -147,9 +146,8 @@ namespace Crow
lines = getLines;
- this.RegisterForGraphicUpdate ();
- this.RegisterForLayouting (LayoutingType.Sizing);
NotifyValueChanged ("Text", _text);
+ RegisterForGraphicUpdate ();
}
}
[XmlAttributeAttribute][DefaultValue(false)]
@@ -598,7 +596,7 @@ namespace Crow
SelBegin = new Point(0,0);
SelRelease = new Point (lines.LastOrDefault ().Length, lines.Count-1);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
public override void onUnfocused (object sender, EventArgs e)
{
@@ -606,7 +604,7 @@ namespace Crow
SelBegin = -1;
SelRelease = -1;
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
public override void onMouseMove (object sender, MouseMoveEventArgs e)
{
@@ -617,7 +615,7 @@ namespace Crow
updatemouseLocalPos (e.Position);
- RegisterForGraphicUpdate();
+ RegisterForRedraw();
}
public override void onMouseDown (object sender, MouseButtonEventArgs e)
{
@@ -626,7 +624,7 @@ namespace Crow
SelBegin = -1;
SelRelease = -1;
SelectionInProgress = true;
- RegisterForGraphicUpdate();//TODO:should put it in properties
+ RegisterForRedraw();//TODO:should put it in properties
}
//done at the end to set 'hasFocus' value after testing it
@@ -641,7 +639,7 @@ namespace Crow
updatemouseLocalPos (e.Position);
SelectionInProgress = false;
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
#endregion
diff --git a/src/GraphicObjects/ListBox.cs b/src/GraphicObjects/ListBox.cs
index 34834b8d..79efac33 100644
--- a/src/GraphicObjects/ListBox.cs
+++ b/src/GraphicObjects/ListBox.cs
@@ -141,7 +141,7 @@ namespace Crow
using (Stream stream = Interface.GetStreamFromPath (ItemTemplate))
stream.CopyTo (templateStream);
}
- templateBaseType = Interface.GetTopContainerOfGOMLStream (templateStream);
+ templateBaseType = Interface.GetTopContainerOfXMLStream (templateStream);
}
lock (Interface.CurrentInterface.UpdateMutex) {
diff --git a/src/GraphicObjects/NumericControl.cs b/src/GraphicObjects/NumericControl.cs
index 0f74eb2d..b1b097c6 100644
--- a/src/GraphicObjects/NumericControl.cs
+++ b/src/GraphicObjects/NumericControl.cs
@@ -30,7 +30,7 @@ namespace Crow
minValue = value;
NotifyValueChanged ("Minimum", minValue);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(100.0)]
@@ -43,7 +43,7 @@ namespace Crow
maxValue = value;
NotifyValueChanged ("Maximum", maxValue);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(1.0)]
@@ -56,7 +56,7 @@ namespace Crow
smallStep = value;
NotifyValueChanged ("SmallIncrement", smallStep);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(5.0)]
@@ -69,7 +69,7 @@ namespace Crow
bigStep = value;
NotifyValueChanged ("LargeIncrement", bigStep);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(0.0)]
diff --git a/src/GraphicObjects/PrivateContainer.cs b/src/GraphicObjects/PrivateContainer.cs
index 16a797d7..08abf95a 100644
--- a/src/GraphicObjects/PrivateContainer.cs
+++ b/src/GraphicObjects/PrivateContainer.cs
@@ -126,21 +126,19 @@ namespace Crow
LayoutingType ltChild = LayoutingType.None;
if (layoutType == LayoutingType.Width) {
- if (Width == Measure.Fit)
- return;
if (child.Width.Units == Unit.Percent) {
ltChild |= LayoutingType.Width;
if (child.Width.Value < 100 && child.Left == 0)
ltChild |= LayoutingType.X;
- }
+ } else if (child.Left == 0)
+ ltChild |= LayoutingType.X;
} else if (layoutType == LayoutingType.Height) {
- if (Height == Measure.Fit)
- return;
if (child.Height.Units == Unit.Percent) {
ltChild |= LayoutingType.Height;
if (child.Height.Value < 100 && child.Top == 0)
ltChild |= LayoutingType.Y;
- }
+ } else if (child.Top == 0)
+ ltChild |= LayoutingType.Y;
}
if (ltChild == LayoutingType.None)
return;
diff --git a/src/GraphicObjects/Scroller.cs b/src/GraphicObjects/Scroller.cs
index 22b36fd2..0d57cdb3 100644
--- a/src/GraphicObjects/Scroller.cs
+++ b/src/GraphicObjects/Scroller.cs
@@ -70,7 +70,7 @@ namespace Crow
else
_scrollX = value;
NotifyValueChanged("ScrollX", _scrollX);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
Scrolled.Raise (this, new ScrollingEventArgs (Orientation.Horizontal));
}
}
@@ -89,7 +89,7 @@ namespace Crow
else
_scrollY = value;
NotifyValueChanged("ScrollY", _scrollY);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
Scrolled.Raise (this, new ScrollingEventArgs (Orientation.Vertical));
}
}
diff --git a/src/GraphicObjects/Slider.cs b/src/GraphicObjects/Slider.cs
index bce74971..526c2759 100644
--- a/src/GraphicObjects/Slider.cs
+++ b/src/GraphicObjects/Slider.cs
@@ -65,7 +65,7 @@ namespace Crow
if (_cursorColor == value)
return;
_cursorColor = value;
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
NotifyValueChanged ("CursorColor", _cursorColor);
}
}
@@ -76,7 +76,6 @@ namespace Crow
if (_cursorSize == value)
return;
_cursorSize = value;
- RegisterForLayouting (LayoutingType.Sizing);
RegisterForGraphicUpdate ();
NotifyValueChanged ("CursorSize", _cursorSize);
}
diff --git a/src/GraphicObjects/TabView.cs b/src/GraphicObjects/TabView.cs
index 5afcdaad..d616ffc6 100644
--- a/src/GraphicObjects/TabView.cs
+++ b/src/GraphicObjects/TabView.cs
@@ -78,7 +78,7 @@ namespace Crow
(Children [selectedTab] as TabItem).IsSelected = true;
NotifyValueChanged ("SelectedTab", selectedTab);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(22)]
@@ -148,7 +148,7 @@ namespace Crow
//if no layouting remains in queue for item, registre for redraw
if (RegisteredLayoutings == LayoutingType.None && bmp == null)
- RegisterForGraphicUpdate ();
+ Interface.CurrentInterface.EnqueueForRepaint (this);
return true;
}
@@ -183,8 +183,8 @@ namespace Crow
#region Mouse handling
public override void checkHoverWidget (MouseMoveEventArgs e)
{
- if (Interface.CurrentInterface.hoverWidget != this) {
- Interface.CurrentInterface.hoverWidget = this;
+ if (Interface.CurrentInterface.HoverWidget != this) {
+ Interface.CurrentInterface.HoverWidget = this;
onMouseEnter (this, e);
}
diff --git a/src/GraphicObjects/TextBox.cs b/src/GraphicObjects/TextBox.cs
index fc02f0d6..5c3772b7 100644
--- a/src/GraphicObjects/TextBox.cs
+++ b/src/GraphicObjects/TextBox.cs
@@ -49,7 +49,7 @@ namespace Crow
set
{
base.HasFocus = value;
- RegisterForGraphicUpdate();
+ RegisterForRedraw();
}
}
@@ -210,10 +210,6 @@ namespace Crow
default:
break;
}
- if (Width < 0)
- RegisterForLayouting (LayoutingType.Width);
- if (Height < 0)
- RegisterForLayouting (LayoutingType.Height);
RegisterForGraphicUpdate();
}
public override void onKeyPress (object sender, KeyPressEventArgs e)
@@ -225,10 +221,6 @@ namespace Crow
SelRelease = -1;
SelBegin = new Point(CurrentColumn, SelBegin.Y);
- if (Width < 0)
- RegisterForLayouting (LayoutingType.Width);
- if (Height < 0)
- RegisterForLayouting (LayoutingType.Height);
RegisterForGraphicUpdate();
}
#endregion
diff --git a/src/GraphicObjects/TextRun.cs b/src/GraphicObjects/TextRun.cs
index 35b46f18..6b6f7999 100644
--- a/src/GraphicObjects/TextRun.cs
+++ b/src/GraphicObjects/TextRun.cs
@@ -55,7 +55,7 @@ namespace Crow
if (horizontalStretch == value)
return;
horizontalStretch = value;
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
NotifyValueChanged ("HorizontalStretch", horizontalStretch);
}
}
@@ -67,8 +67,8 @@ namespace Crow
if (verticalStretch == value)
return;
verticalStretch = value;
+ RegisterForRedraw ();
NotifyValueChanged ("VerticalStretch", verticalStretch);
-
}
}
[XmlAttributeAttribute ()]
@@ -83,8 +83,6 @@ namespace Crow
return;
RegisterForGraphicUpdate ();
- this.RegisterForLayouting (LayoutingType.Sizing);
-
_text = value;
diff --git a/src/GraphicObjects/Trend.cs b/src/GraphicObjects/Trend.cs
index e9ff4c06..fef1e48f 100644
--- a/src/GraphicObjects/Trend.cs
+++ b/src/GraphicObjects/Trend.cs
@@ -41,7 +41,7 @@ namespace Crow
values.Add (_value);
while (values.Count > nbValues)
values.RemoveAt (0);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
public Trend ()
@@ -61,7 +61,7 @@ namespace Crow
nbValues = value;
NotifyValueChanged ("NbValues", minValue);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(0.0)]
@@ -73,7 +73,7 @@ namespace Crow
minValue = value;
NotifyValueChanged ("Minimum", minValue);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(100.0)]
@@ -86,7 +86,7 @@ namespace Crow
maxValue = value;
NotifyValueChanged ("Maximum", maxValue);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue(20.0)]
@@ -119,7 +119,7 @@ namespace Crow
return;
lowThresholdFill = value;
NotifyValueChanged ("LowThresholdFill", lowThresholdFill);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
[XmlAttributeAttribute()][DefaultValue("DarkGreen")]
@@ -130,7 +130,7 @@ namespace Crow
return;
highThresholdFill = value;
NotifyValueChanged ("HighThresholdFill", highThresholdFill);
- RegisterForGraphicUpdate ();
+ RegisterForRedraw ();
}
}
protected override void onDraw (Cairo.Context gr)