aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/Popper.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2017-01-29 23:26:46 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2017-01-29 23:26:46 +0100
commitdc603ff31253879bb8effb6d529f266ff78e9f3e (patch)
treee48f38ac22040da95371f661be482389b21e473e /src/GraphicObjects/Popper.cs
parent1a4fe8bd37ed4a3e3324a134df4f90c14b315918 (diff)
parent2ec4eeed1d0353c455719aa612a12646ae2d176e (diff)
Merge improvements and debug from 'CrowIDE' branch
Diffstat (limited to 'src/GraphicObjects/Popper.cs')
-rw-r--r--src/GraphicObjects/Popper.cs40
1 files changed, 25 insertions, 15 deletions
diff --git a/src/GraphicObjects/Popper.cs b/src/GraphicObjects/Popper.cs
index 38621337..8c79ce24 100644
--- a/src/GraphicObjects/Popper.cs
+++ b/src/GraphicObjects/Popper.cs
@@ -38,6 +38,7 @@ namespace Crow
string caption;
Alignment popDirection;
GraphicObject _content;
+ Measure popWidth, popHeight;
public event EventHandler Pop;
public event EventHandler Unpop;
@@ -53,6 +54,26 @@ namespace Crow
NotifyValueChanged ("Caption", caption);
}
}
+ [XmlAttributeAttribute()][DefaultValue("Fit")]
+ public virtual Measure PopWidth {
+ get { return popWidth; }
+ set {
+ if (popWidth == value)
+ return;
+ popWidth = value;
+ NotifyValueChanged ("PopWidth", popWidth);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue("Fit")]
+ public virtual Measure PopHeight {
+ get { return popHeight; }
+ set {
+ if (popHeight == value)
+ return;
+ popHeight = value;
+ NotifyValueChanged ("PopHeight", popHeight);
+ }
+ }
[XmlAttributeAttribute()][DefaultValue(false)]
public bool IsPopped
{
@@ -164,18 +185,6 @@ namespace Crow
}
#region GraphicObject overrides
- public override void OnLayoutChanges (LayoutingType layoutType)
- {
- base.OnLayoutChanges (layoutType);
-
- if (_content == null)
- return;
-
- if (layoutType == LayoutingType.Width)
- _content.MinimumSize = new Size (this.Slot.Width, _content.MinimumSize.Height);
- }
-
-
public override void onMouseClick (object sender, MouseButtonEventArgs e)
{
if (_canPop)
@@ -219,16 +228,17 @@ namespace Crow
if (Content != null) {
Content.Visible = true;
if (Content.Parent == null)
- CurrentInterface.AddWidget (Content);
- CurrentInterface.PutOnTop (Content);
+ CurrentInterface.AddWidget (Content, true);
+ CurrentInterface.PutOnTop (Content, true);
_content_LayoutChanged (this, new LayoutingEventArgs (LayoutingType.Sizing));
}
Pop.Raise (this, e);
}
public virtual void onUnpop(object sender, EventArgs e)
{
- if (Content != null)
+ if (Content != null) {
Content.Visible = false;
+ }
Unpop.Raise (this, e);
}
}