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 09:18:12 -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: <49F9709D.5080107@helios.de>
References: <49F9709D.5080107@helios.de>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On Apr 30, 2009, at 5:34 AM, Tom wrote:

Hi List!

The Language reference states:
Canvas.MouseUp Event:
The mouse button was released inside the Canvas region at the location passed in to x,y.

But the event also occurs when the mouse is released _ouside_ of the canvas!

To reproduce this:
make a new project and put a canvas and an Editfield on the Window. Make the EditField multiline.
In the Canvas events add following code
       Sub Paint(g As Graphics)
         g.ForeColor = &cFFAB60
         g.FillRect 0,0,me.Width, me.Height
       End Sub

       Function MouseDown(X As Integer, Y As Integer) As Boolean
EditField1.AppendText "MouseDown, x=" + str(x) + ", y=" + str(y)+ EndOfLine
         return true
       End Function

       Sub MouseUp(X As Integer, Y As Integer)
EditField1.AppendText "MouseUp, x=" + str(x) + ", y=" + str(y)+ EndOfLine End Sub

Now click the canvas and drag the mouse outside of it. Then release the mouse key. I think there should be no MouseUp Event because the mouse is not released _inside_ of the Canvas area.
Tested on Mac and Win XP.

This looks like a bug for me. Comments please.

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.

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>