aboutsummaryrefslogtreecommitdiffstatsci
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/GraphicObjects/Button.cs11
-rw-r--r--src/GraphicObjects/CheckBox.cs16
-rw-r--r--src/GraphicObjects/Expandable.cs25
-rw-r--r--src/GraphicObjects/GroupBox.cs16
-rw-r--r--src/GraphicObjects/MenuItem.cs15
-rw-r--r--src/GraphicObjects/Popper.cs19
-rw-r--r--src/GraphicObjects/RadioButton.cs12
-rw-r--r--src/GraphicObjects/TabItem.cs11
-rw-r--r--src/GraphicObjects/TemplatedControl.cs24
9 files changed, 37 insertions, 112 deletions
diff --git a/src/GraphicObjects/Button.cs b/src/GraphicObjects/Button.cs
index c73062f0..8fc7a1ad 100644
--- a/src/GraphicObjects/Button.cs
+++ b/src/GraphicObjects/Button.cs
@@ -14,7 +14,6 @@ namespace Crow
{
public class Button : TemplatedContainer
{
- string caption;
string image;
bool isPressed;
Container _contentContainer;
@@ -66,16 +65,6 @@ namespace Crow
}
#endregion
- [XmlAttributeAttribute][DefaultValue("Button")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
[XmlAttributeAttribute][DefaultValue("#Crow.Images.button.svg")]
public string Image {
get { return image; }
diff --git a/src/GraphicObjects/CheckBox.cs b/src/GraphicObjects/CheckBox.cs
index 46d77e76..19bbb9b9 100644
--- a/src/GraphicObjects/CheckBox.cs
+++ b/src/GraphicObjects/CheckBox.cs
@@ -27,28 +27,16 @@ namespace Crow
{
public class CheckBox : TemplatedControl
{
- string caption;
- string image;
bool isChecked;
#region CTOR
public CheckBox() : base()
- {}
+ {}
#endregion
public event EventHandler Checked;
public event EventHandler Unchecked;
- [XmlAttributeAttribute()][DefaultValue("Checkbox")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
[XmlAttributeAttribute()][DefaultValue(false)]
public bool IsChecked
{
@@ -57,7 +45,7 @@ namespace Crow
{
if (isChecked == value)
return;
-
+
isChecked = value;
NotifyValueChanged ("IsChecked", value);
diff --git a/src/GraphicObjects/Expandable.cs b/src/GraphicObjects/Expandable.cs
index 38506de8..92cf1640 100644
--- a/src/GraphicObjects/Expandable.cs
+++ b/src/GraphicObjects/Expandable.cs
@@ -35,7 +35,6 @@ namespace Crow
#region Private fields
bool _isExpanded;
- string caption;
string image;
Container _contentContainer;
#endregion
@@ -70,26 +69,16 @@ namespace Crow
}
#region Public properties
- [XmlAttributeAttribute][DefaultValue("Expandable")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
[XmlAttributeAttribute][DefaultValue("#Crow.Images.Icons.expandable.svg")]
public string Image {
- get { return image; }
+ get { return image; }
set {
if (image == value)
return;
- image = value;
+ image = value;
NotifyValueChanged ("Image", image);
}
- }
+ }
[XmlAttributeAttribute][DefaultValue(false)]
public bool IsExpanded
{
@@ -120,11 +109,11 @@ namespace Crow
[XmlIgnore]public bool IsExpandable {
get {
try {
- return GetIsExpandable == null ? true : GetIsExpandable (this);
+ return GetIsExpandable == null ? true : GetIsExpandable (this);
} catch (Exception ex) {
System.Diagnostics.Debug.WriteLine ("Not Expandable error: " + ex.ToString ());
return false;
- }
+ }
}
}
#endregion
@@ -133,14 +122,14 @@ namespace Crow
{
if (_contentContainer != null)
_contentContainer.Visible = true;
-
+
Expand.Raise (this, e);
}
public virtual void onCollapse(object sender, EventArgs e)
{
if (_contentContainer != null)
_contentContainer.Visible = false;
-
+
Collapse.Raise (this, e);
}
}
diff --git a/src/GraphicObjects/GroupBox.cs b/src/GraphicObjects/GroupBox.cs
index db457282..34094703 100644
--- a/src/GraphicObjects/GroupBox.cs
+++ b/src/GraphicObjects/GroupBox.cs
@@ -26,12 +26,11 @@ using System.ComponentModel;
namespace Crow
{
public class GroupBox : TemplatedContainer
- {
- string caption;
+ {
Container _contentContainer;
#region CTOR
- public GroupBox() : base(){}
+ public GroupBox() : base(){}
#endregion
#region Template overrides
@@ -50,16 +49,5 @@ namespace Crow
_contentContainer = this.child.FindByName ("Content") as Container;
}
#endregion
-
- [XmlAttributeAttribute][DefaultValue("Groupbox")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
}
}
diff --git a/src/GraphicObjects/MenuItem.cs b/src/GraphicObjects/MenuItem.cs
index adec326f..b277194e 100644
--- a/src/GraphicObjects/MenuItem.cs
+++ b/src/GraphicObjects/MenuItem.cs
@@ -78,17 +78,10 @@ namespace Crow
NotifyValueChanged ("Command", command);
}
}
- [XmlAttributeAttribute][DefaultValue("MenuItem")]
- public string Caption {
- get { return Command == null ? caption : Command.Caption; }
- set {
- if (caption == value)
- return;
- caption = value;
-
- if (command == null)//raise value changed only if not bound to a command
- NotifyValueChanged ("Caption", caption);
- }
+ [XmlAttributeAttribute]
+ public override string Caption {
+ get { return Command == null ? base.Caption : Command.Caption; }
+ set { base.Caption = value; }
}
[XmlAttributeAttribute]
public Picture Icon {
diff --git a/src/GraphicObjects/Popper.cs b/src/GraphicObjects/Popper.cs
index 0b022842..10d5d30e 100644
--- a/src/GraphicObjects/Popper.cs
+++ b/src/GraphicObjects/Popper.cs
@@ -35,25 +35,14 @@ namespace Crow
#endregion
bool _isPopped, _canPop;
- string caption;
Alignment popDirection;
GraphicObject _content;
Measure popWidth, popHeight;
- public event EventHandler Pop;
- public event EventHandler Unpop;
+ public event EventHandler Popped;
+ public event EventHandler Unpoped;
#region Public Properties
- [XmlAttributeAttribute()][DefaultValue("Popper")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
[XmlAttributeAttribute()][DefaultValue("Fit")]
public virtual Measure PopWidth {
get { return popWidth; }
@@ -234,14 +223,14 @@ namespace Crow
CurrentInterface.PutOnTop (Content, true);
_content_LayoutChanged (this, new LayoutingEventArgs (LayoutingType.Sizing));
}
- Pop.Raise (this, e);
+ Popped.Raise (this, e);
}
public virtual void onUnpop(object sender, EventArgs e)
{
if (Content != null) {
Content.Visible = false;
}
- Unpop.Raise (this, e);
+ Unpoped.Raise (this, e);
}
}
}
diff --git a/src/GraphicObjects/RadioButton.cs b/src/GraphicObjects/RadioButton.cs
index ede16475..9ead433b 100644
--- a/src/GraphicObjects/RadioButton.cs
+++ b/src/GraphicObjects/RadioButton.cs
@@ -27,8 +27,6 @@ namespace Crow
{
public class RadioButton : TemplatedControl
{
- string caption;
- string image;
bool isChecked;
#region CTOR
@@ -56,16 +54,6 @@ namespace Crow
}
#endregion
- [XmlAttributeAttribute()][DefaultValue("RadioButton")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
[XmlAttributeAttribute()][DefaultValue(false)]
public bool IsChecked
{
diff --git a/src/GraphicObjects/TabItem.cs b/src/GraphicObjects/TabItem.cs
index aca033d9..923aa51e 100644
--- a/src/GraphicObjects/TabItem.cs
+++ b/src/GraphicObjects/TabItem.cs
@@ -89,16 +89,7 @@ namespace Crow
RegisterForGraphicUpdate ();
}
}
- [XmlAttributeAttribute][DefaultValue("TabItem")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
+
[XmlAttributeAttribute][DefaultValue(false)]
public virtual bool IsSelected {
get { return isSelected; }
diff --git a/src/GraphicObjects/TemplatedControl.cs b/src/GraphicObjects/TemplatedControl.cs
index cd645dd3..37a220cc 100644
--- a/src/GraphicObjects/TemplatedControl.cs
+++ b/src/GraphicObjects/TemplatedControl.cs
@@ -39,13 +39,9 @@ namespace Crow
}
#endregion
- public override void Initialize ()
- {
- loadTemplate ();
- base.Initialize ();
- }
-
string _template;
+ string caption;
+
[XmlAttributeAttribute][DefaultValue(null)]
public string Template {
get { return _template; }
@@ -60,8 +56,22 @@ namespace Crow
loadTemplate (CurrentInterface.Load (_template));
}
}
-
+ [XmlAttributeAttribute()][DefaultValue("Templated Control")]
+ public virtual string Caption {
+ get { return caption; }
+ set {
+ if (caption == value)
+ return;
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
+ }
+ }
#region GraphicObject overrides
+ public override void Initialize ()
+ {
+ loadTemplate ();
+ base.Initialize ();
+ }
public override GraphicObject FindByName (string nameToFind)
{
//prevent name searching in template