ecere/gui/Window: Call OnMouseLeave on Release for Android
authorJerome St-Louis <jerome@ecere.com>
Sat, 7 Feb 2015 03:22:57 +0000 (22:22 -0500)
committerJerome St-Louis <jerome@ecere.com>
Sun, 15 Feb 2015 20:33:18 +0000 (15:33 -0500)
ecere/src/gui/Window.ec
ecere/src/gui/controls/Button.ec

index ee0c553..826d43c 100644 (file)
@@ -4373,6 +4373,11 @@ private:
                incref window;
                if(!MouseMethod(window, clientX, clientY, *mods))
                   result = false;
+
+#ifdef __ANDROID__
+               if(method == __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnLeftButtonUp)
+                  window.OnMouseLeave(*mods);
+#endif
                delete window;
             }
          }
index a4983df..6d0f029 100644 (file)
@@ -560,6 +560,7 @@ public class Button : CommonControl
 
    bool OnLeftButtonUp(int x, int y, Modifiers mods)
    {
+      bool result = true;
       if(!(buttonStyle.toggle))
       {
          bool releasedResult;
@@ -586,10 +587,8 @@ public class Button : CommonControl
                Update(null);
                if(releasedResult)
                {
-                  if(NotifyClicked(master, this, x,y, mods))
-                     return true;
-                  else
-                     return false;
+                  if(!NotifyClicked(master, this, x,y, mods))
+                     result = false;
                }
             }
             else
@@ -600,7 +599,7 @@ public class Button : CommonControl
             }
          }
       }
-      return true;
+      return result;
    }
 
    bool OnLeftDoubleClick(int x, int y, Modifiers mods)