aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/Popper.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2015-09-14 17:55:46 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2015-09-14 17:55:46 +0200
commit01ec9f5a3fa94df22844e22f47cd4853959fe99e (patch)
tree511fd0caf9ff685ddeb24f4dc4ef63b958c2ad8c /src/GraphicObjects/Popper.cs
parente568d1381aba02054acd3e267f42d319f161d59e (diff)
* Tests.csproj:
* GOLIBTests.cs: * Popper.goml: * Checkbox.goml: * Expandable.goml: * RadioButton.goml: * test7.goml: * Popper.cs: * test4.1.goml: * test1.3.goml: * Checkbox.cs: * Expandable.cs: * RadioButton.cs: * testCheckbox.goml: * testRadioButton.goml: improve templates, set SvgSub as PropertyLess binding updated with only * radiobutton.svg: simplify svg
Diffstat (limited to 'src/GraphicObjects/Popper.cs')
-rw-r--r--src/GraphicObjects/Popper.cs28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/GraphicObjects/Popper.cs b/src/GraphicObjects/Popper.cs
index 41990247..76a12f58 100644
--- a/src/GraphicObjects/Popper.cs
+++ b/src/GraphicObjects/Popper.cs
@@ -69,10 +69,6 @@ namespace go
NotifyValueChanged ("Image", image);
}
}
- [XmlAttributeAttribute()][DefaultValue("collapsed")]
- public string SvgSub {
- get { return IsPopped ? "expanded" : "collapsed"; }
- }
[XmlAttributeAttribute()][DefaultValue(false)]
public bool IsPopped
@@ -80,35 +76,39 @@ namespace go
get { return _isPopped; }
set
{
- if (value == _isPopped)
- return;
-
_isPopped = value;
- NotifyValueChanged ("SvgSub", SvgSub);
- if (_isPopped)
+ if (_isPopped) {
onPop (this, null);
- else
- onUnpop (this, null);
+ NotifyValueChanged ("SvgSub", "expanded");
+ return;
+ }
- //registerForGraphicUpdate();
+ onUnpop (this, null);
+ NotifyValueChanged ("SvgSub", "collapsed");
}
}
public virtual void onPop(object sender, EventArgs e)
{
+ IGOLibHost tc = TopContainer;
+ if (tc == null)
+ return;
if (Content != null) {
Rectangle r = this.ScreenCoordinates (this.Slot);
Content.Visible = true;
Content.Left = r.Left;
Content.Top = r.Bottom;
- TopContainer.AddWidget (Content);
+ tc.AddWidget (Content);
}
Pop.Raise (this, e);
}
public virtual void onUnpop(object sender, EventArgs e)
{
- TopContainer.DeleteWidget (Content);
+ IGOLibHost tc = TopContainer;
+ if (tc == null)
+ return;
+ tc.DeleteWidget (Content);
Unpop.Raise (this, e);
}