aboutsummaryrefslogtreecommitdiffstatsci
path: root/src
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2017-04-19 09:59:39 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2017-04-19 09:59:39 +0200
commitd83f78d3787b9dc035130ebb6e056b6e2f0ca788 (patch)
treead64a7a7900b63bc07392c54c2d5c56917dd3545 /src
parent75424623f5a1d65581e6e911d0d00403c8fab814 (diff)
check if HoverWidget is removed from graphic tree
Diffstat (limited to 'src')
-rw-r--r--src/GraphicObjects/Group.cs7
-rw-r--r--src/GraphicObjects/PrivateContainer.cs5
-rw-r--r--src/Interface.cs8
3 files changed, 16 insertions, 4 deletions
diff --git a/src/GraphicObjects/Group.cs b/src/GraphicObjects/Group.cs
index d4b5b62e..549ca219 100644
--- a/src/GraphicObjects/Group.cs
+++ b/src/GraphicObjects/Group.cs
@@ -75,6 +75,13 @@ namespace Crow
{
child.LayoutChanged -= OnChildLayoutChanges;
//child.Parent = null;
+
+ //check if HoverWidget is removed from Tree
+ if (CurrentInterface.HoverWidget != null) {
+ if (this.Contains (CurrentInterface.HoverWidget))
+ CurrentInterface.HoverWidget = null;
+ }
+
lock (children)
Children.Remove(child);
diff --git a/src/GraphicObjects/PrivateContainer.cs b/src/GraphicObjects/PrivateContainer.cs
index 65eacabb..4076b5ec 100644
--- a/src/GraphicObjects/PrivateContainer.cs
+++ b/src/GraphicObjects/PrivateContainer.cs
@@ -53,6 +53,11 @@ namespace Crow
{
if (child != null) {
+ //check if HoverWidget is removed from Tree
+ if (CurrentInterface.HoverWidget != null) {
+ if (this.Contains (CurrentInterface.HoverWidget))
+ CurrentInterface.HoverWidget = null;
+ }
contentSize = new Size (0, 0);
child.LayoutChanged -= OnChildLayoutChanges;
child.Parent = null;
diff --git a/src/Interface.cs b/src/Interface.cs
index 62ac6ce3..9e5175fb 100644
--- a/src/Interface.cs
+++ b/src/Interface.cs
@@ -82,7 +82,6 @@ namespace Crow
public static int DeviceRepeatInterval = 40;
/// <summary>Tabulation size in Text controls</summary>
public static int TabSize = 4;
- public static bool ReplaceTabsWithSpace = false;
public static string LineBreak = "\r\n";
/// <summary> Allow rendering of interface in development environment </summary>
public static bool DesignerMode = false;
@@ -146,7 +145,6 @@ namespace Crow
/// on the first instance creation of a IML item.
/// </summary>
public static Dictionary<String, Instantiator> Instantiators = new Dictionary<string, Instantiator>();
- public bool DesignMode = false;
public List<CrowThread> CrowThreads = new List<CrowThread>();//used to monitor thread finished
#endregion
@@ -575,6 +573,10 @@ namespace Crow
public void DeleteWidget(GraphicObject g)
{
g.Visible = false;//trick to ensure clip is added to refresh zone
+ if (_hoverWidget != null) {
+ if (g.Contains (_hoverWidget))
+ HoverWidget = null;
+ }
lock (UpdateMutex)
GraphicTree.Remove (g);
}
@@ -683,7 +685,6 @@ namespace Crow
}
if (HoverWidget != null) {
- //TODO, ensure object is still in the graphic tree
//check topmost graphicobject first
GraphicObject tmp = HoverWidget;
GraphicObject topc = null;
@@ -710,7 +711,6 @@ namespace Crow
}
}
-
if (HoverWidget.MouseIsIn (e.Position)) {
HoverWidget.checkHoverWidget (e);
return true;