aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/RadioButton.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-25 11:52:35 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-25 11:52:35 +0100
commit54ff9d82e0d195bc335916b8a30a27651f830502 (patch)
treed950855da5376bc8bf3f079c8000dd192f39bc41 /src/GraphicObjects/RadioButton.cs
parentdd6682973fa16921b7ebaf5faa416290c3211c63 (diff)
DefaultStyle attribute, loaded in defvalues
Diffstat (limited to 'src/GraphicObjects/RadioButton.cs')
-rw-r--r--src/GraphicObjects/RadioButton.cs36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/GraphicObjects/RadioButton.cs b/src/GraphicObjects/RadioButton.cs
index 6ca636b1..4370d157 100644
--- a/src/GraphicObjects/RadioButton.cs
+++ b/src/GraphicObjects/RadioButton.cs
@@ -5,6 +5,7 @@ using System.Xml.Serialization;
namespace Crow
{
+ [DefaultStyle("#Crow.Styles.RadioButton.style")]
[DefaultTemplate("#Crow.Templates.RadioButton.goml")]
public class RadioButton : TemplatedControl
{
@@ -20,11 +21,20 @@ namespace Crow
public event EventHandler Unchecked;
#region GraphicObject overrides
- [XmlAttributeAttribute()][DefaultValue(true)]
- public override bool Focusable
- {
- get { return base.Focusable; }
- set { base.Focusable = value; }
+ public override void onMouseClick (object sender, MouseButtonEventArgs e)
+ {
+ Group pg = Parent as Group;
+ if (pg != null) {
+ for (int i = 0; i < pg.Children.Count; i++) {
+ RadioButton c = pg.Children [i] as RadioButton;
+ if (c == null)
+ continue;
+ c.IsChecked = (c == this);
+ }
+ } else
+ IsChecked = !IsChecked;
+
+ base.onMouseClick (sender, e);
}
#endregion
@@ -68,21 +78,5 @@ namespace Crow
Unchecked.Raise (this, null);
}
}
-
- public override void onMouseClick (object sender, MouseButtonEventArgs e)
- {
- Group pg = Parent as Group;
- if (pg != null) {
- for (int i = 0; i < pg.Children.Count; i++) {
- RadioButton c = pg.Children [i] as RadioButton;
- if (c == null)
- continue;
- c.IsChecked = (c == this);
- }
- } else
- IsChecked = !IsChecked;
-
- base.onMouseClick (sender, e);
- }
}
}