realbasic-nug
[Top] [All Lists]

Wrong Canvas.MouseUp Event?

To: REALbasic Network Users Group <realbasic-nug@lists.realsoftware.com>
Subject: Wrong Canvas.MouseUp Event?
From: Tom <tom@helios.de>
Date: Thu, 30 Apr 2009 11:34:21 +0200
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
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)
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.

Cheers,

Tom

PS. RB 2009r2 on Mac OS X 10.5.6

_______________________________________________
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>