aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects
diff options
context:
space:
mode:
authorjp <jp_bruyere@hotmail.com>2016-04-01 09:33:01 +0200
committerjp <jp_bruyere@hotmail.com>2016-04-01 09:33:01 +0200
commita2151156e8e5aa7deb5cc5e7eb5d6f416599217e (patch)
tree78dc68b199d34d966f39f1685b808e98d438f06d /src/GraphicObjects
parent22644afe6f0722dcfb5fd27ba353f12274f55eb6 (diff)
several changes to merge later
Diffstat (limited to 'src/GraphicObjects')
-rw-r--r--src/GraphicObjects/Label.cs2
-rw-r--r--src/GraphicObjects/Window.cs22
2 files changed, 10 insertions, 14 deletions
diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs
index ebc18f76..64c37ff8 100644
--- a/src/GraphicObjects/Label.cs
+++ b/src/GraphicObjects/Label.cs
@@ -119,7 +119,7 @@ namespace Crow
}
set
{
- if (_text == value)
+ if (string.Equals (value, _text, StringComparison.Ordinal))
return;
_text = value;
diff --git a/src/GraphicObjects/Window.cs b/src/GraphicObjects/Window.cs
index 429d4269..94fe40d3 100644
--- a/src/GraphicObjects/Window.cs
+++ b/src/GraphicObjects/Window.cs
@@ -28,21 +28,14 @@ namespace Crow
Container _contentContainer;
Direction currentDirection = Direction.None;
+ public event EventHandler Closing;
+
#region CTOR
public Window () : base() {
}
#endregion
- #region GraphicObject overrides
- [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true
- public override bool Focusable
- {
- get { return base.Focusable; }
- set { base.Focusable = value; }
- }
- #endregion
-
public override GraphicObject Content {
get {
return _contentContainer == null ? null : _contentContainer.Child;
@@ -221,10 +214,13 @@ namespace Crow
protected void butQuitPress (object sender, MouseButtonEventArgs e)
{
- ILayoutable parent = (sender as GraphicObject).Parent;
- while(!(parent is Window))
- parent = parent.Parent;
- Interface.CurrentInterface.DeleteWidget (parent as GraphicObject);
+ close ();
+ }
+
+ void close(){
+ Closing.Raise (this, null);
+
+ Interface.CurrentInterface.DeleteWidget (this);
}
public override void ResolveBindings ()