realbasic-nug
[Top] [All Lists]

Re: Wrong Canvas.MouseUp Event?

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Wrong Canvas.MouseUp Event?
From: Charles Yeomans <charles@declareSub.com>
Date: Thu, 30 Apr 2009 10:56:49 -0400
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <49F9AD3D.5020306@helios.de>
References: <49F9709D.5080107@helios.de> <A2217C56-292D-4BF7-AD9C-32FAC9BA5E11@declareSub.com> <49F9AD3D.5020306@helios.de>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On Apr 30, 2009, at 9:53 AM, Tom wrote:

Charles Yeomans wrote:
The behavior as you see it has been so as long as I can remember. But the documentation for the current version of REALbasic states

"The mouse button was released inside the Canvas region at the location passed in to x,y"

I suggest that you file a feedback report.

Thanks for the info. I wrote a bug report abut this.

I understand the the MouseUp outside of the canvas is helpful for drag & drop but for a custom button it makes more work because you need to check the x/y-position of the MouseUp event.
Perhaps it would be helpful to make the behavior optional...

I look forward to RS response. The bug is "Case 7521".


Such optional behavior almost always proves to be an annoyance for me. Instead, I suggest that you use this method.

Function IsMouseOver(X as Integer, Y as Integer) as Integer
  return (X >= 0) and (X < me.Left) and (Y >= 0) and (Y < me.Height)
End Function

Either add it to your custom button classes, as I do, or add it to all Canvas objects as an extension method.

Function IsMouseOver(extends c as Canvas, X as Integer, Y as Integer) as Integer
  return (X >= 0) and (X < c.Left) and (Y >= 0) and (Y < c.Height)
End Function

Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>