aboutsummaryrefslogtreecommitdiffstatsci
path: root/src
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-02 01:13:08 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-02 01:13:08 +0100
commit86238b1031ff73dc5f4be48033ba674189224e3a (patch)
treed755c4447e61783bd3c39d960cc140903bb2d2f2 /src
parent47fe040bb568b4eff544bb9f287481343216373e (diff)
debug
Diffstat (limited to 'src')
-rw-r--r--src/Cairo/CairoHelpers.cs8
-rw-r--r--src/CompilerServices/CompilerServices.cs2
-rw-r--r--src/GraphicObjects/Border.cs4
-rw-r--r--src/GraphicObjects/GraduatedSlider.cs2
-rw-r--r--src/GraphicObjects/GraphicObject.cs16
-rw-r--r--src/GraphicObjects/Group.cs7
-rw-r--r--src/GraphicObjects/Label.cs132
-rw-r--r--src/GraphicObjects/ProgressBar.cs4
-rw-r--r--src/GraphicObjects/ScrollBar.cs12
-rw-r--r--src/GraphicObjects/Scroller.cs32
-rw-r--r--src/GraphicObjects/Slider.cs4
-rw-r--r--src/GraphicObjects/Spinner.cs2
-rw-r--r--src/GraphicObjects/TextBox.cs22
-rw-r--r--src/GraphicObjects/TextRun.cs2
-rw-r--r--src/Interface.cs3
-rw-r--r--src/OpenTKGameWindow.cs3
-rw-r--r--src/Rectangles.cs2
-rw-r--r--src/SvgPicture.cs1
18 files changed, 113 insertions, 145 deletions
diff --git a/src/Cairo/CairoHelpers.cs b/src/Cairo/CairoHelpers.cs
index 307eaccb..77b1b863 100644
--- a/src/Cairo/CairoHelpers.cs
+++ b/src/Cairo/CairoHelpers.cs
@@ -83,13 +83,13 @@ namespace Crow
gr.Save();
r.Inflate((int)-width / 2, (int)-width / 2);
gr.LineWidth = width;
- gr.Color = Color.White;
+ gr.SetSourceColor(Color.White);
gr.MoveTo(r.BottomLeft);
gr.LineTo(r.TopLeft);
gr.LineTo(r.TopRight);
gr.Stroke();
- gr.Color = Color.DarkGray;
+ gr.SetSourceColor(Color.DarkGray);
gr.MoveTo(r.TopRight);
gr.LineTo(r.BottomRight);
gr.LineTo(r.BottomLeft);
@@ -102,12 +102,12 @@ namespace Crow
gr.Save();
r.Inflate((int)-width / 2, (int)-width / 2);
gr.LineWidth = width;
- gr.Color = Color.DarkGray;
+ gr.SetSourceColor(Color.DarkGray);
gr.MoveTo(r.BottomLeft);
gr.LineTo(r.TopLeft);
gr.LineTo(r.TopRight);
gr.Stroke();
- gr.Color = Color.White;
+ gr.SetSourceColor(Color.White);
gr.MoveTo(r.TopRight);
gr.LineTo(r.BottomRight);
gr.LineTo(r.BottomLeft);
diff --git a/src/CompilerServices/CompilerServices.cs b/src/CompilerServices/CompilerServices.cs
index 25d66f4b..b640a628 100644
--- a/src/CompilerServices/CompilerServices.cs
+++ b/src/CompilerServices/CompilerServices.cs
@@ -150,8 +150,6 @@ namespace Crow
public static class CompilerServices
{
- static int dynHandleCpt = 0;
-
#region conversions
internal static MethodInfo GetConvertMethod( Type targetType )
diff --git a/src/GraphicObjects/Border.cs b/src/GraphicObjects/Border.cs
index d9791050..c04a135e 100644
--- a/src/GraphicObjects/Border.cs
+++ b/src/GraphicObjects/Border.cs
@@ -52,13 +52,13 @@ namespace Crow
if (BorderWidth > 0)
rBack.Inflate (-BorderWidth / 2);
- gr.Color = Background;
+ gr.SetSourceColor(Background);
CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);
gr.Fill ();
if (BorderWidth > 0) {
gr.LineWidth = BorderWidth;
- gr.Color = Foreground;
+ gr.SetSourceColor(Foreground);
CairoHelpers.CairoRectangle(gr, rBack, CornerRadius);
gr.Stroke ();
}
diff --git a/src/GraphicObjects/GraduatedSlider.cs b/src/GraphicObjects/GraduatedSlider.cs
index e885ecb8..9ed5e19e 100644
--- a/src/GraphicObjects/GraduatedSlider.cs
+++ b/src/GraphicObjects/GraduatedSlider.cs
@@ -25,7 +25,7 @@ namespace Crow
protected override void DrawGraduations(Context gr, PointD pStart, PointD pEnd)
{
Rectangle r = ClientRectangle;
- gr.Color = Foreground;
+ gr.SetSourceColor(Foreground);
gr.LineWidth = 2;
gr.MoveTo(pStart);
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index 69f19ca2..dedbe931 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -82,7 +82,6 @@ namespace Crow
Picture _backgroundImage;
string _backgroundImagePath;
- string _template;
#endregion
#region public fields
@@ -434,19 +433,13 @@ namespace Crow
foreach (PropertyInfo pi in this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) {
if (pi.GetSetMethod () == null)
continue;
-
- bool isAttribute = false;
string name = "";
- Type valueType = null;
-
- MemberInfo mi = pi.GetGetMethod ();
object[] att = pi.GetCustomAttributes (false);
foreach (object o in att) {
XmlAttributeAttribute xaa = o as XmlAttributeAttribute;
- if (xaa != null) {
- isAttribute = true;
+ if (xaa != null) {
if (string.IsNullOrEmpty (xaa.AttributeName))
name = pi.Name;
else
@@ -745,7 +738,7 @@ namespace Crow
{
Rectangle rBack = new Rectangle (Slot.Size);
- gr.Color = Background;
+ gr.SetSourceColor(Background);
CairoHelpers.CairoRectangle(gr,rBack,_cornerRadius);
gr.Fill ();
@@ -1322,17 +1315,12 @@ namespace Crow
continue;
}
- object o = null;
-
if (pi.PropertyType.IsEnum) {
pi.SetValue (this, Enum.Parse (pi.PropertyType, attValue), null);
} else {
MethodInfo me = pi.PropertyType.GetMethod ("Parse", new Type[] { typeof(string) });
pi.SetValue (this, me.Invoke (null, new string[] { attValue }), null);
}
-
-
-
}
}
reader.MoveToElement();
diff --git a/src/GraphicObjects/Group.cs b/src/GraphicObjects/Group.cs
index 77cb6d64..ef6e7fc8 100644
--- a/src/GraphicObjects/Group.cs
+++ b/src/GraphicObjects/Group.cs
@@ -190,7 +190,7 @@ namespace Crow
Rectangle rBack = new Rectangle (Slot.Size);
if (BackgroundImage != null)
BackgroundImage.Paint (gr, rBack, BackImgSub);
- gr.Color = Background;
+ gr.SetSourceColor(Background);
CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);
gr.Fill ();
@@ -207,9 +207,6 @@ namespace Crow
if (bmp == null)
UpdateGraphic ();
else {
-
- Rectangle rb = Parent.ContextCoordinates (Slot);
-
if (clip != null)
clip.Rebase (this);
else {
@@ -230,7 +227,7 @@ namespace Crow
clip.clearAndClip (gr);
Rectangle rBack = Slot.Size;
- gr.Color = Background;
+ gr.SetSourceColor(Background);
CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);
gr.Fill ();
#if DEBUG_CLIP_RECTANGLE
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs
index 460dcbdc..68cd50b6 100644
--- a/src/GraphicObjects/Label.cs
+++ b/src/GraphicObjects/Label.cs
@@ -29,9 +29,8 @@ namespace Crow
//TODO:change protected to private
#region private and protected fields
- protected string _text = "label";
+ string _text = "label";
Alignment _textAlignment = Alignment.LeftCenter;
- Font _font;
bool _multiline = false;
Color selColor;
Color selFontColor;
@@ -52,7 +51,7 @@ namespace Crow
protected TextExtents te;
#endregion
- [XmlAttributeAttribute()][DefaultValue("SkyBlue")]
+ [XmlAttributeAttribute()][DefaultValue("SteelBlue")]
public virtual Color SelectionBackground {
get { return selColor; }
set {
@@ -63,7 +62,7 @@ namespace Crow
registerForGraphicUpdate ();
}
}
- [XmlAttributeAttribute()][DefaultValue("DarkGray")]
+ [XmlAttributeAttribute()][DefaultValue("White")]
public virtual Color SelectionForeground {
get { return selFontColor; }
set {
@@ -78,7 +77,13 @@ namespace Crow
public Alignment TextAlignment
{
get { return _textAlignment; }
- set { _textAlignment = value; }
+ set {
+ if (value == _textAlignment)
+ return;
+ _textAlignment = value;
+ registerForGraphicUpdate ();
+ NotifyValueChanged ("TextAlignment", _textAlignment);
+ }
}
[XmlAttributeAttribute()][DefaultValue("label")]
public string Text
@@ -99,7 +104,7 @@ namespace Crow
lines = getLines;
- //registerForGraphicUpdate();
+ this.registerForGraphicUpdate ();
this.RegisterForLayouting ((int)LayoutingType.Sizing);
NotifyValueChanged ("Text", Text);
}
@@ -110,33 +115,41 @@ namespace Crow
get { return _multiline; }
set
{
+ if (value == _multiline)
+ return;
_multiline = value;
+ NotifyValueChanged ("Multiline", _multiline);
registerForGraphicUpdate();
}
}
- [XmlIgnore]public int currentCol{
+ [XmlIgnore]public int CurrentColumn{
get { return _currentCol; }
set {
+ if (value == _currentCol)
+ return;
if (value < 0)
_currentCol = 0;
else if (value > lines [_currentLine].Count ())
_currentCol = lines [_currentLine].Count ();
else
_currentCol = value;
+ NotifyValueChanged ("CurrentColumn", _currentCol);
}
}
- [XmlIgnore]public int currentLine{
+ [XmlIgnore]public int CurrentLine{
get { return _currentLine; }
set {
+ if (value == _currentLine)
+ return;
if (value > lines.Count)
_currentLine = lines.Count;
else if (value < 0)
_currentLine = 0;
else
_currentLine = value;
+ NotifyValueChanged ("CurrentLine", _currentLine);
}
}
-
[XmlIgnore]public Point SelBegin {
get {
return _selBegin;
@@ -208,17 +221,17 @@ namespace Crow
public void DeleteChar()
{
if (selectionIsEmpty) {
- if (currentCol == 0) {
- if (currentLine == 0)
+ if (CurrentColumn == 0) {
+ if (CurrentLine == 0)
return;
- currentLine--;
- currentCol = lines [currentLine].Count ();
- lines [currentLine] += lines [currentLine + 1];
- lines.RemoveAt (currentLine + 1);
+ CurrentLine--;
+ CurrentColumn = lines [CurrentLine].Count ();
+ lines [CurrentLine] += lines [CurrentLine + 1];
+ lines.RemoveAt (CurrentLine + 1);
return;
}
- currentCol--;
- lines [currentLine] = lines [currentLine].Remove (currentCol, 1);
+ CurrentColumn--;
+ lines [CurrentLine] = lines [CurrentLine].Remove (CurrentColumn, 1);
} else {
Debug.WriteLine (selectionEnd.ToString());
int linesToRemove = selectionEnd.Y - selectionStart.Y;
@@ -230,11 +243,11 @@ namespace Crow
l++;
for (int c = 0; c < linesToRemove-1; c++)
lines.RemoveAt (l);
- currentCol = selectionStart.X;
- currentLine = selectionStart.Y;
+ CurrentColumn = selectionStart.X;
+ CurrentLine = selectionStart.Y;
} else
lines [l] = lines [l].Remove (selectionStart.X, selectionEnd.X - selectionStart.X);
- currentCol = selectionStart.X;
+ CurrentColumn = selectionStart.X;
SelBegin = -1;
SelRelease = -1;
}
@@ -245,8 +258,8 @@ namespace Crow
/// <param name="str">String.</param>
protected void Insert(string str)
{
- lines [currentLine] = lines [currentLine].Insert (currentCol, str);
- currentCol += str.Length;
+ lines [CurrentLine] = lines [CurrentLine].Insert (CurrentColumn, str);
+ CurrentColumn += str.Length;
}
#region GraphicObject overrides
@@ -426,11 +439,11 @@ namespace Crow
if (SelectionInProgress)
{
if (SelBegin < 0){
- SelBegin = new Point(currentCol, currentLine);
+ SelBegin = new Point(CurrentColumn, CurrentLine);
SelStartCursorPos = textCursorPos;
SelRelease = -1;
}else{
- SelRelease = new Point(currentCol, currentLine);
+ SelRelease = new Point(CurrentColumn, CurrentLine);
if (SelRelease == SelBegin)
SelRelease = -1;
else
@@ -443,36 +456,35 @@ namespace Crow
#endregion
+ //****** debug selection *************
+// if (SelRelease >= 0) {
+// gr.Color = Color.Green;
+// Rectangle R = new Rectangle (
+// rText.X + (int)SelEndCursorPos - 2,
+// rText.Y + (int)(SelRelease.Y * fe.Height),
+// 4,
+// (int)fe.Height);
+// gr.Rectangle (R);
+// gr.Fill ();
+// }
+// if (SelBegin >= 0) {
+// gr.Color = Color.UnmellowYellow;
+// Rectangle R = new Rectangle (
+// rText.X + (int)SelStartCursorPos - 2,
+// rText.Y + (int)(SelBegin.Y * fe.Height),
+// 4,
+// (int)fe.Height);
+// gr.Rectangle (R);
+// gr.Fill ();
+// }
//*******************
- //debug selection
- if (SelRelease >= 0) {
- gr.Color = Color.Green;
- Rectangle R = new Rectangle (
- rText.X + (int)SelEndCursorPos - 2,
- rText.Y + (int)(SelRelease.Y * fe.Height),
- 4,
- (int)fe.Height);
- gr.Rectangle (R);
- gr.Fill ();
- }
- if (SelBegin >= 0) {
- gr.Color = Color.UnmellowYellow;
- Rectangle R = new Rectangle (
- rText.X + (int)SelStartCursorPos - 2,
- rText.Y + (int)(SelBegin.Y * fe.Height),
- 4,
- (int)fe.Height);
- gr.Rectangle (R);
- gr.Fill ();
- }
- //*******************
+
if (HasFocus )
{
- //TODO:
gr.SetSourceColor(Foreground);
gr.LineWidth = 1.5;
- gr.MoveTo(new PointD(textCursorPos + rText.X, rText.Y + currentLine * fe.Height));
- gr.LineTo(new PointD(textCursorPos + rText.X, rText.Y + (currentLine + 1) * fe.Height));
+ gr.MoveTo(new PointD(textCursorPos + rText.X, rText.Y + CurrentLine * fe.Height));
+ gr.LineTo(new PointD(textCursorPos + rText.X, rText.Y + (CurrentLine + 1) * fe.Height));
gr.Stroke();
}
gr.FontMatrix = new Matrix(widthRatio * Font.Size, 0, 0, heightRatio * Font.Size, 0, 0);
@@ -549,9 +561,7 @@ namespace Crow
SelBegin = new Point(0,0);
SelRelease = new Point (lines.LastOrDefault ().Length, lines.Count-1);
- OpenTKGameWindow.currentWindow.CursorVisible = true;
registerForGraphicUpdate ();
- Debug.WriteLine("focused:", this.ToString());
}
public override void onUnfocused (object sender, EventArgs e)
{
@@ -559,9 +569,7 @@ namespace Crow
SelBegin = -1;
SelRelease = -1;
-
registerForGraphicUpdate ();
- Debug.WriteLine("unfocused:", this.ToString());
}
public override void onMouseMove (object sender, MouseMoveEventArgs e)
{
@@ -610,15 +618,15 @@ namespace Crow
double cPos = 0f;
- currentLine = (int)(mouseLocalPos.Y / fe.Height);
+ CurrentLine = (int)(mouseLocalPos.Y / fe.Height);
//fix cu
- if (currentLine >= lines.Count)
- currentLine = lines.Count - 1;
+ if (CurrentLine >= lines.Count)
+ CurrentLine = lines.Count - 1;
- for (int i = 0; i < lines[currentLine].Length; i++)
+ for (int i = 0; i < lines[CurrentLine].Length; i++)
{
- string c = lines [currentLine].Substring (i, 1);
+ string c = lines [CurrentLine].Substring (i, 1);
if (c == "\t")
c = new string (' ', Interface.TabSize);
@@ -632,7 +640,7 @@ namespace Crow
if (mouseLocalPos.X <= cPos + halfWidth)
{
- currentCol = i;
+ CurrentColumn = i;
textCursorPos = cPos;
mouseLocalPos = -1;
return;
@@ -640,7 +648,7 @@ namespace Crow
cPos += te.XAdvance;
}
- currentCol = lines[currentLine].Length;
+ CurrentColumn = lines[CurrentLine].Length;
textCursorPos = cPos;
//reset mouseLocalPos
@@ -653,7 +661,7 @@ namespace Crow
SelStartCursorPos = GetXFromTextPointer (gr, SelBegin);
if (SelRelease >= 0)
SelEndCursorPos = GetXFromTextPointer (gr, SelRelease);
- textCursorPos = GetXFromTextPointer (gr, new Point(currentCol, currentLine));
+ textCursorPos = GetXFromTextPointer (gr, new Point(CurrentColumn, CurrentLine));
}
/// <summary> Compute x offset in cairo unit from text position </summary>
double GetXFromTextPointer(Context gr, Point pos)
@@ -662,7 +670,7 @@ namespace Crow
string l = lines [pos.Y].Substring (0, pos.X).
Replace ("\t", new String (' ', Interface.TabSize));
return gr.TextExtents (l).XAdvance;
- } catch (Exception ex) {
+ } catch{
return -1;
}
}
diff --git a/src/GraphicObjects/ProgressBar.cs b/src/GraphicObjects/ProgressBar.cs
index 3554dea3..e7be280d 100644
--- a/src/GraphicObjects/ProgressBar.cs
+++ b/src/GraphicObjects/ProgressBar.cs
@@ -78,7 +78,7 @@ namespace Crow
set { base.BorderWidth = value; }
}
[XmlAttributeAttribute()][DefaultValue("BlueCrayola")]
- public virtual Color Foreground {
+ public override Color Foreground {
get { return base.Foreground; }
set { base.Foreground = value; }
}
@@ -94,7 +94,7 @@ namespace Crow
rBack.Width = (int)((double)rBack.Width / Maximum * Value);
- gr.Color = Foreground;
+ gr.SetSourceColor(Foreground);
CairoHelpers.CairoRectangle(gr,rBack,CornerRadius);
gr.Fill();
diff --git a/src/GraphicObjects/ScrollBar.cs b/src/GraphicObjects/ScrollBar.cs
index 905efc55..32bc8807 100644
--- a/src/GraphicObjects/ScrollBar.cs
+++ b/src/GraphicObjects/ScrollBar.cs
@@ -17,12 +17,8 @@ using System.ComponentModel;
namespace Crow
{
[DefaultTemplate("#Crow.Templates.ScrollBar.goml")]
- public class ScrollBar : TemplatedControl, IValueChange
+ public class ScrollBar : TemplatedControl
{
- #region IValueChange implementation
- public event EventHandler<ValueChangeEventArgs> ValueChanged;
- #endregion
-
Orientation _orientation;
Slider _slider;
double _maximumScroll;
@@ -47,7 +43,7 @@ namespace Crow
return;
_maximumScroll = value;
registerForGraphicUpdate ();
- ValueChanged.Raise(this, new ValueChangeEventArgs ("MaximumScroll", _maximumScroll));
+ NotifyValueChanged ("MaximumScroll", _maximumScroll);
}
}
[XmlAttributeAttribute()][DefaultValue(0.0)]
@@ -63,7 +59,7 @@ namespace Crow
else if (_scroll > _maximumScroll)
_scroll = _maximumScroll;
registerForGraphicUpdate ();
- ValueChanged.Raise(this, new ValueChangeEventArgs ("Scroll", _scroll));
+ NotifyValueChanged ("Scroll", _scroll);
}
}
[XmlAttributeAttribute()][DefaultValue(Orientation.Vertical)]
@@ -74,7 +70,7 @@ namespace Crow
if (_orientation == value)
return;
_orientation = value;
- ValueChanged.Raise(this, new ValueChangeEventArgs ("Orientation", _orientation));
+ NotifyValueChanged ("Orientation", _orientation);
registerForGraphicUpdate ();
}
}
diff --git a/src/GraphicObjects/Scroller.cs b/src/GraphicObjects/Scroller.cs
index a4eb2a57..9808fef8 100644
--- a/src/GraphicObjects/Scroller.cs
+++ b/src/GraphicObjects/Scroller.cs
@@ -11,12 +11,8 @@ using System.ComponentModel;
namespace Crow
{
- public class Scroller : Container, IValueChange
- {
- #region IValueChange implementation
- public event EventHandler<ValueChangeEventArgs> ValueChanged;
- #endregion
-
+ public class Scroller : Container
+ {
bool _verticalScrolling;
bool _horizontalScrolling;
bool _scrollbarVisible;
@@ -27,7 +23,6 @@ namespace Crow
#region public properties
-
[XmlAttributeAttribute][DefaultValue(false)]
public bool VerticalScrolling {
get { return _verticalScrolling; }
@@ -43,9 +38,7 @@ namespace Crow
public bool ScrollbarVisible {
get { return _scrollbarVisible; }
set { _scrollbarVisible = value; }
- }
-
-
+ }
[XmlAttributeAttribute][DefaultValue(0.0)]
public double ScrollX {
get {
@@ -60,12 +53,10 @@ namespace Crow
_scrollX = Math.Max(0.0, Child.Slot.Width - ClientRectangle.Width);
else
_scrollX = value;
- ValueChanged.Raise(this, new ValueChangeEventArgs("ScrollX", _scrollX));
+ NotifyValueChanged("ScrollX", _scrollX);
RegisterForRedraw();
}
- }
-
-
+ }
[XmlAttributeAttribute][DefaultValue(0.0)]
public double ScrollY {
get {
@@ -80,7 +71,7 @@ namespace Crow
_scrollY = Math.Max(0.0,Child.Slot.Height - ClientRectangle.Height);
else
_scrollY = value;
- ValueChanged.Raise(this, new ValueChangeEventArgs("ScrollY", _scrollY));
+ NotifyValueChanged("ScrollY", _scrollY);
RegisterForRedraw();
}
}
@@ -99,17 +90,14 @@ namespace Crow
get { return scrollSpeed; }
set {
scrollSpeed = value;
- ValueChanged.Raise(this, new ValueChangeEventArgs("ScrollSpeed", scrollSpeed));
+ NotifyValueChanged("ScrollSpeed", scrollSpeed);
}
}
-
#endregion
public Scroller()
- : base()
- {
- }
+ : base(){}
#region GraphicObject Overrides
void OnChildLayoutChanges (object sender, LayoutChangeEventArgs arg)
@@ -121,12 +109,12 @@ namespace Crow
Debug.WriteLine ("scrolly={0} maxscroll={1}", ScrollY, maxScroll);
ScrollY = 0;
}
- ValueChanged.Raise (this, new ValueChangeEventArgs ("MaximumScroll", maxScroll));
+ NotifyValueChanged("MaximumScroll", maxScroll);
}
} else if (arg.LayoutType == LayoutingType.Width) {
if (maxScroll < ScrollX)
ScrollX = 0;
- ValueChanged.Raise (this, new ValueChangeEventArgs ("MaximumScroll", maxScroll));
+ NotifyValueChanged("MaximumScroll", maxScroll);
}
}
void onChildListCleared(object sender, EventArgs e){
diff --git a/src/GraphicObjects/Slider.cs b/src/GraphicObjects/Slider.cs
index 2351669c..27c162a0 100644
--- a/src/GraphicObjects/Slider.cs
+++ b/src/GraphicObjects/Slider.cs
@@ -120,7 +120,7 @@ namespace Crow
protected virtual void DrawGraduations(Context gr, PointD pStart, PointD pEnd)
{
- gr.Color = Foreground;
+ gr.SetSourceColor(Foreground);
gr.LineWidth = 1;
gr.MoveTo(pStart);
@@ -131,7 +131,7 @@ namespace Crow
}
protected virtual void DrawCursor(Context gr, Rectangle _cursor)
{
- gr.Color = CursorColor;
+ gr.SetSourceColor(CursorColor);
CairoHelpers.CairoRectangle (gr, _cursor, CornerRadius);
gr.FillPreserve();
}
diff --git a/src/GraphicObjects/Spinner.cs b/src/GraphicObjects/Spinner.cs
index c86cde14..a44abb13 100644
--- a/src/GraphicObjects/Spinner.cs
+++ b/src/GraphicObjects/Spinner.cs
@@ -26,8 +26,6 @@ namespace Crow
[DefaultTemplate("#Crow.Templates.Spinner.goml")]
public class Spinner : NumericControl
{
- Label labCpt;
-
public Spinner (double minimum, double maximum, double step) :
base (minimum, maximum, step)
{
diff --git a/src/GraphicObjects/TextBox.cs b/src/GraphicObjects/TextBox.cs
index f2fdace6..7d67e825 100644
--- a/src/GraphicObjects/TextBox.cs
+++ b/src/GraphicObjects/TextBox.cs
@@ -92,7 +92,7 @@ namespace Crow
break;
case Key.Delete:
if (selectionIsEmpty)
- currentCol++;
+ CurrentColumn++;
this.DeleteChar ();
break;
case Key.Enter:
@@ -101,33 +101,33 @@ namespace Crow
break;
case Key.Escape:
Text = "";
- currentCol = 0;
+ CurrentColumn = 0;
SelRelease = -1;
break;
case Key.Home:
//TODO
if (e.Control)
- currentLine = 0;
- currentCol = 0;
+ CurrentLine = 0;
+ CurrentColumn = 0;
break;
case Key.End:
if (e.Control)
- currentLine = int.MaxValue;
- currentCol = int.MaxValue;
+ CurrentLine = int.MaxValue;
+ CurrentColumn = int.MaxValue;
break;
case Key.Insert:
break;
case Key.Left:
- currentCol--;
+ CurrentColumn--;
break;
case Key.Right:
- currentCol++;
+ CurrentColumn++;
break;
case Key.Up:
- currentLine--;
+ CurrentLine--;
break;
case Key.Down:
- currentLine++;
+ CurrentLine++;
break;
case Key.Menu:
break;
@@ -191,7 +191,7 @@ namespace Crow
this.Insert (k);
SelRelease = -1;
- SelBegin = new Point(currentCol, SelBegin.Y);
+ SelBegin = new Point(CurrentColumn, SelBegin.Y);
break;
}
diff --git a/src/GraphicObjects/TextRun.cs b/src/GraphicObjects/TextRun.cs
index 1fa43963..6201f7c1 100644
--- a/src/GraphicObjects/TextRun.cs
+++ b/src/GraphicObjects/TextRun.cs
@@ -313,7 +313,7 @@ namespace Crow
continue;
}
- gr.Color = Foreground;
+ gr.SetSourceColor (Foreground);
gr.MoveTo (rText.X, rText.Y + fe.Ascent + fe.Height * curLineCount);
#if _WIN32 || _WIN64
diff --git a/src/Interface.cs b/src/Interface.cs
index 9b291a32..6d4d259b 100644
--- a/src/Interface.cs
+++ b/src/Interface.cs
@@ -81,7 +81,7 @@ namespace Crow
//try/catch added to prevent nunit error
try {
stream = System.Reflection.Assembly.GetEntryAssembly ().GetManifestResourceStream (resId);
- } catch (Exception ex) {}
+ } catch{}
if (stream == null)//try to find ressource in Crow assembly
stream = System.Reflection.Assembly.GetExecutingAssembly ().GetManifestResourceStream (resId);
if (stream == null)
@@ -125,7 +125,6 @@ namespace Crow
using (Stream stream = GetStreamFromPath (path)) {
return Load(stream, GetTopContainerOfGOMLStream(stream), hostClass);
}
- CurrentGOMLPath = "";
}
diff --git a/src/OpenTKGameWindow.cs b/src/OpenTKGameWindow.cs
index 2db35fc7..ba458b54 100644
--- a/src/OpenTKGameWindow.cs
+++ b/src/OpenTKGameWindow.cs
@@ -395,9 +395,6 @@ namespace Crow
Console.WriteLine("GLSL version: " + GL.GetString (StringName.ShadingLanguageVersion));
Console.WriteLine("*************************************\n");
- int matl = GL.GetInteger (GetPName.MaxArrayTextureLayers);
- int mts = GL.GetInteger (GetPName.MaxTextureSize);
-
shader = new Crow.TexturedShader ();
}
diff --git a/src/Rectangles.cs b/src/Rectangles.cs
index daf1587b..9c5cf4e4 100644
--- a/src/Rectangles.cs
+++ b/src/Rectangles.cs
@@ -140,7 +140,7 @@ namespace Crow
ctx.Rectangle(r);
}
- ctx.Color = c;
+ ctx.SetSourceColor(c);
ctx.LineWidth = 2;
ctx.Stroke ();
diff --git a/src/SvgPicture.cs b/src/SvgPicture.cs
index cbe6f2e8..38781a1c 100644
--- a/src/SvgPicture.cs
+++ b/src/SvgPicture.cs
@@ -27,7 +27,6 @@ namespace Crow
public class SvgPicture : Picture
{
Rsvg.Handle hSVG;
- string _subSvg;
public SvgPicture ()
{}