]> O.S.I.I.S - jp/crow.git/commitdiff
check if HoverWidget is removed from graphic tree
authorjpbruyere <jp.bruyere@hotmail.com>
Wed, 19 Apr 2017 07:59:39 +0000 (09:59 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Wed, 19 Apr 2017 07:59:39 +0000 (09:59 +0200)
src/GraphicObjects/Group.cs
src/GraphicObjects/PrivateContainer.cs
src/Interface.cs

index d4b5b62ef5112dbb278fe4c9710f497bb17d40aa..549ca2194d0b959e78245303c0362521e07524a9 100644 (file)
@@ -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);
 
index 65eacabba293b4364d4e6d31aca1a1048306e747..4076b5ec59a048662d57ed23510825978af783f8 100644 (file)
@@ -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;
index 62ac6ce3589c0e552715b2170e92e60170bf1a56..9e5175fb8e309dec1589e096da01ba9ca0b59543 100644 (file)
@@ -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;