aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2015-06-21 15:39:58 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2015-06-21 15:39:58 +0200
commitdc995bd1da98971009454f4efe043d6237d00729 (patch)
tree3af8d3a6745e9779edb71de29f3463898a3dedd0 /src/GraphicObjects
parent746f5cfb60c9a798825e31c2e362cfc817e59d44 (diff)
* OpenTK:
* OpenTKGameWindow.cs: * Tests.csproj: * GOLIBTest_4.cs: * GOLIBTest_1.cs: * Window.goml: * Listbox.goml: * test4.goml: * GOLIBTest_Expandable.cs: * testExpandable.goml: debug and test * Colors.cs: debug argb->rgba * CompilerServices.cs: value type conversion * Border.cs: default border =1 * Checkbox.cs: * Expandable.cs: changes in update technic * Group.cs: Clipping debug (need rework) * Label.cs: debug text positionning * Slider.cs: debug * TextBox.cs: selectable=true by default
Diffstat (limited to 'src/GraphicObjects')
-rw-r--r--src/GraphicObjects/Border.cs2
-rw-r--r--src/GraphicObjects/Checkbox.cs2
-rw-r--r--src/GraphicObjects/Expandable.cs8
-rw-r--r--src/GraphicObjects/Group.cs7
-rwxr-xr-xsrc/GraphicObjects/Label.cs20
-rw-r--r--src/GraphicObjects/Slider.cs1
-rw-r--r--src/GraphicObjects/TextBox.cs5
7 files changed, 38 insertions, 7 deletions
diff --git a/src/GraphicObjects/Border.cs b/src/GraphicObjects/Border.cs
index 352b626a..f2ce01e2 100644
--- a/src/GraphicObjects/Border.cs
+++ b/src/GraphicObjects/Border.cs
@@ -16,7 +16,7 @@ namespace go
#endregion
#region public properties
- [XmlAttributeAttribute()][DefaultValue(2)]
+ [XmlAttributeAttribute()][DefaultValue(1)]
public virtual int BorderWidth {
get { return _borderWidth; }
set {
diff --git a/src/GraphicObjects/Checkbox.cs b/src/GraphicObjects/Checkbox.cs
index 0e20ddb7..30db3849 100644
--- a/src/GraphicObjects/Checkbox.cs
+++ b/src/GraphicObjects/Checkbox.cs
@@ -62,7 +62,7 @@ namespace go
else
_image.SvgSub = "unchecked";
- registerForGraphicUpdate();
+ //registerForGraphicUpdate();
}
}
diff --git a/src/GraphicObjects/Expandable.cs b/src/GraphicObjects/Expandable.cs
index 369930a8..8b3f4b1a 100644
--- a/src/GraphicObjects/Expandable.cs
+++ b/src/GraphicObjects/Expandable.cs
@@ -54,8 +54,8 @@ namespace go
return;
_image.SvgSub = "collapsed";
- this.Expand += (object sender, EventArgs e) => {_image.SvgSub = "expanded";};
- this.Collapse += (object sender, EventArgs e) => {_image.SvgSub = "collapsed";};
+// this.Expand += (object sender, EventArgs e) => {};
+// this.Collapse += (object sender, EventArgs e) => {};
}
@@ -86,18 +86,20 @@ namespace go
else
onCollapse (this, null);
- registerForGraphicUpdate();
+ //registerForGraphicUpdate();
}
}
public virtual void onExpand(object sender, EventArgs e)
{
_contentContainer.Visible = true;
+ _image.SvgSub = "expanded";
Expand.Raise (this, e);
}
public virtual void onCollapse(object sender, EventArgs e)
{
_contentContainer.Visible = false;
+ _image.SvgSub = "collapsed";
Collapse.Raise (this, e);
}
diff --git a/src/GraphicObjects/Group.cs b/src/GraphicObjects/Group.cs
index f1620a2a..aac566db 100644
--- a/src/GraphicObjects/Group.cs
+++ b/src/GraphicObjects/Group.cs
@@ -178,8 +178,13 @@ namespace go
if (clip != null) {
clip.Rebase (this);
//localClip = clip.intersectingRects (Slot.Size);
- } else
+ } else {
clip = new Rectangles ();
+ //TODO:added lately slot to empty clip,
+ //should rework this precise case causing expandable not
+ //to show image changes
+ clip.AddRectangle (ContextCoordinates (Slot.Size));
+ }
if (!DrawingIsValid || clip != null) {//false when 1 child has changed
//child having their content changed has to be repainted
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs
index 27a766d2..e9951862 100755
--- a/src/GraphicObjects/Label.cs
+++ b/src/GraphicObjects/Label.cs
@@ -287,6 +287,8 @@ namespace go
//gr.FontOptions.HintMetrics = HintMetrics.On;
rText = new Rectangle(measureRawSize());
+ rText.Width -= 2 * Margin;
+ rText.Height -= 2 * Margin;
widthRatio = 1f;
heightRatio = 1f;
@@ -479,6 +481,24 @@ namespace go
if (string.IsNullOrWhiteSpace (l))
continue;
+// double t = rText.Y;
+// gr.LineWidth = 1;
+// gr.Color = Color.Green;
+// gr.MoveTo (rText.X, t);
+// gr.LineTo (rText.X + rText.Width, t);
+// gr.Stroke ();
+// gr.MoveTo (rText.X, t + rText.Height);
+// gr.LineTo (rText.X + rText.Width, t + rText.Height);
+// gr.Stroke ();
+// gr.Rectangle (rText);
+// gr.Fill ();
+//
+// t += fe.Ascent;
+// gr.Color = Color.Red;
+// gr.MoveTo (rText.X, t);
+// gr.LineTo (rText.X + rText.Width, t);
+// gr.Stroke ();
+
gr.Color = Foreground;
gr.MoveTo (rText.X, rText.Y + fe.Ascent + fe.Height * i);
diff --git a/src/GraphicObjects/Slider.cs b/src/GraphicObjects/Slider.cs
index 7a5623f8..25da2241 100644
--- a/src/GraphicObjects/Slider.cs
+++ b/src/GraphicObjects/Slider.cs
@@ -119,7 +119,6 @@ namespace go
cursor.TopLeft = new Point(r.Left + (int)(Value * unity),
(int)(p1.Y - cursor.Height / 2));
- Debug.WriteLine (cursor.TopLeft.ToString ());
}
#region mouse handling
diff --git a/src/GraphicObjects/TextBox.cs b/src/GraphicObjects/TextBox.cs
index 28e7c74c..7ba10fe8 100644
--- a/src/GraphicObjects/TextBox.cs
+++ b/src/GraphicObjects/TextBox.cs
@@ -44,6 +44,11 @@ namespace go
get { return base.Focusable; }
set { base.Focusable = value; }
}
+ [XmlAttributeAttribute()][DefaultValue(true)]
+ public override bool Selectable {
+ get { return base.Selectable; }
+ set { base.Selectable = value; }
+ }
[XmlAttributeAttribute()][DefaultValue("White")]
public override Color Background {
get { return base.Background; }