Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

MouseEnter and MouseExit (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Re: [WE] How do I handle a "Please Wait" window? [Multi-threading in WE]
Next thread: Re: Subject: Re: macoslib additions


Re: [OT] Large Screenshots   -   Rubber Chicken Software Co.
  MouseEnter and MouseExit   -   Jim Dossey
   Re: MouseEnter and MouseExit   -   Andrew Keller
   Re: MouseEnter and MouseExit   -   Stéphane Mons <
   Re: MouseEnter and MouseExit   -   Glenn L. Austin
   Re: MouseEnter and MouseExit   -   Myron Meyer
   Re: MouseEnter and MouseExit   -   Arnaud Nicolet
   Re: MouseEnter and MouseExit   -   Myron Meyer
   Re: MouseEnter and MouseExit   -   Jim Dossey

MouseEnter and MouseExit
Date: 03.08.11 16:20 (Wed, 3 Aug 2011 11:20:19 -0400)
From: Jim Dossey
Say I have a window with a canvas on it. I need to know if the mouse
is in the window or the canvas. I tried using MouseEnter and
MouseExit and that mostly works. Except for when the mouse moves out
of the canvas back into the window. I get a MouseExit event on the
canvas, but not a new MouseEnter event on the window. I tried
checking MouseMove, but it fires on the window even when the mouse is
inside the canvas. I suppose I could keep a stack and do a push on
MouseEnter and a pop on MouseExit. Does anyone know of a better way
to handle that?

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

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

Re: MouseEnter and MouseExit
Date: 03.08.11 16:40 (Wed, 3 Aug 2011 11:40:57 -0400)
From: Andrew Keller
On Aug 3, 2011, at 11:20 AM, Jim Dossey wrote:

> Say I have a window with a canvas on it. I need to know if the mouse is in the window or the canvas. I tried using MouseEnter and MouseExit and that mostly works. Except for when the mouse moves out of the canvas back into the window. I get a MouseExit event on the canvas, but not a new MouseEnter event on the window. I tried checking MouseMove, but it fires on the window even when the mouse is inside the canvas. I suppose I could keep a stack and do a push on MouseEnter and a pop on MouseExit. Does anyone know of a better way to handle that?

MouseEnter and MouseExit events operate by the rectangles of the controls, without taking overlaps into account.

If the canvas is on the window, and the mouse is on the canvas, then the mouse is on both the canvas and the window at the same time.

~ Andrew Keller

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

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

Re: MouseEnter and MouseExit
Date: 03.08.11 16:41 (Wed, 3 Aug 2011 17:41:17 +0200)
From: Stéphane Mons <
Yes, you need to keep track of MouseEnter and MouseExit. MouseExit fires for the window only when it really goes out of the window.

Le 3 août 2011 à 17:20, Jim Dossey a écrit :

> Say I have a window with a canvas on it. I need to know if the mouse
> is in the window or the canvas. I tried using MouseEnter and
> MouseExit and that mostly works. Except for when the mouse moves out
> of the canvas back into the window. I get a MouseExit event on the
> canvas, but not a new MouseEnter event on the window. I tried
> checking MouseMove, but it fires on the window even when the mouse is
> inside the canvas. I suppose I could keep a stack and do a push on
> MouseEnter and a pop on MouseExit. Does anyone know of a better way
> to handle that?
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>

5 REM My Signature
10 PRINT "Stéphane"
20 GOTO 10



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

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

Re: MouseEnter and MouseExit
Date: 03.08.11 16:37 (Wed, 3 Aug 2011 08:37:21 -0700)
From: Glenn L. Austin
On Aug 3, 2011, at 8:20 AM, Jim Dossey wrote:

> Say I have a window with a canvas on it. I need to know if the mouse
> is in the window or the canvas. I tried using MouseEnter and
> MouseExit and that mostly works. Except for when the mouse moves out
> of the canvas back into the window. I get a MouseExit event on the
> canvas, but not a new MouseEnter event on the window. I tried
> checking MouseMove, but it fires on the window even when the mouse is
> inside the canvas. I suppose I could keep a stack and do a push on
> MouseEnter and a pop on MouseExit. Does anyone know of a better way
> to handle that?

It sounds like it's working correctly.

The canvas is on the window, so the mouse never left the window when it entered the canvas.

Re: MouseEnter and MouseExit
Date: 05.08.11 02:44 (Thu, 4 Aug 2011 18:44:18 -0700)
From: Myron Meyer
One simple solution might be to have the cursor change to a different
cursor, maybe even make a custom cursor, when it enters the canvas, and then
back to the standard pointer when it exits the canvas.
Myron

On Wed, Aug 3, 2011 at 10:40 AM, Arnaud Nicolet <<email address removed>> wrote:

> Le 3 août 11 à 18:12, Jim Dossey a écrit:
>
> On Wed, Aug 3, 2011 at 11:41 AM, Stéphane Mons <<email address removed>>
>> wrote:
>>
>>> Yes, you need to keep track of MouseEnter and MouseExit. MouseExit fires
>>> for the window only when it really goes out of the window.
>>>
>>> Le 3 août 2011 à 17:20, Jim Dossey a écrit :
>>>
>>> Say I have a window with a canvas on it. I need to know if the mouse
>>>> is in the window or the canvas. I tried using MouseEnter and
>>>> MouseExit and that mostly works. Except for when the mouse moves out
>>>> of the canvas back into the window. I get a MouseExit event on the
>>>> canvas, but not a new MouseEnter event on the window. I tried
>>>> checking MouseMove, but it fires on the window even when the mouse is
>>>> inside the canvas. I suppose I could keep a stack and do a push on
>>>> MouseEnter and a pop on MouseExit. Does anyone know of a better way
>>>> to handle that?
>>>>
>>>
>> Thanks to all who answered. I guess I didn't really state my real
>> question in the original message. I understood that MouseExit, et al,
>> were operating correctly. What I really wanted to know was if there
>> was a better way to tell that the mouse was back in the window when it
>> left the canvas, since MouseEnter doesn't fire on the window again.
>> Stéphane answered that. So I guess I'll just keep doing it the way
>> I'm doing it now.
>>
> You could have a concept similar to the focus property: add a property to
> your window (say "ControlWhereTheMouseIsOn As RectControl"). In your canvas'
> MouseEnter you'd put "ControlWhereTheMouseIsOn=me" and in MouseExit
> "ControlWhereTheMouseIsOn=nil"**, and do the same for any other needed
> control.
>
> ______________________________**_________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/**support/listmanager/<http://www.realsoftware.com/support/listmanager/>
> >
> Search the archives:
> <http://support.realsoftware.**com/listarchives/lists.html<http://support.realsoftware.com/listarchives/lists.html>
> >
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

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

Re: MouseEnter and MouseExit
Date: 03.08.11 18:40 (Wed, 03 Aug 2011 19:40:16 +0200)
From: Arnaud Nicolet
Le 3 août 11 à 18:12, Jim Dossey a écrit:

> On Wed, Aug 3, 2011 at 11:41 AM, Stéphane Mons
> <<email address removed>> wrote:
>> Yes, you need to keep track of MouseEnter and MouseExit. MouseExit
>> fires for the window only when it really goes out of the window.
>>
>> Le 3 août 2011 à 17:20, Jim Dossey a écrit :
>>
>>> Say I have a window with a canvas on it. I need to know if the
>>> mouse
>>> is in the window or the canvas. I tried using MouseEnter and
>>> MouseExit and that mostly works. Except for when the mouse moves
>>> out
>>> of the canvas back into the window. I get a MouseExit event on the
>>> canvas, but not a new MouseEnter event on the window. I tried
>>> checking MouseMove, but it fires on the window even when the mouse
>>> is
>>> inside the canvas. I suppose I could keep a stack and do a push on
>>> MouseEnter and a pop on MouseExit. Does anyone know of a better way
>>> to handle that?
>
> Thanks to all who answered. I guess I didn't really state my real
> question in the original message. I understood that MouseExit, et al,
> were operating correctly. What I really wanted to know was if there
> was a better way to tell that the mouse was back in the window when it
> left the canvas, since MouseEnter doesn't fire on the window again.
> Stéphane answered that. So I guess I'll just keep doing it the way
> I'm doing it now.

You could have a concept similar to the focus property: add a property
to your window (say "ControlWhereTheMouseIsOn As RectControl"). In
your canvas' MouseEnter you'd put "ControlWhereTheMouseIsOn=me" and in
MouseExit "ControlWhereTheMouseIsOn=nil", and do the same for any
other needed control.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

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

Re: MouseEnter and MouseExit
Date: 03.08.11 17:58 (Wed, 3 Aug 2011 09:58:42 -0700)
From: Myron Meyer
A possible solution might be to have the cursor change to a different
pointer when it enters the canvas, and then back to standard pointer when it
exits the canvas.
Myron

On Wed, Aug 3, 2011 at 9:12 AM, Jim Dossey <<email address removed>> wrote:

> On Wed, Aug 3, 2011 at 11:41 AM, Stéphane Mons <<email address removed>>
> wrote:
> > Yes, you need to keep track of MouseEnter and MouseExit. MouseExit fires
> for the window only when it really goes out of the window.
> >
> > Le 3 août 2011 à 17:20, Jim Dossey a écrit :
> >
> >> Say I have a window with a canvas on it. I need to know if the mouse
> >> is in the window or the canvas. I tried using MouseEnter and
> >> MouseExit and that mostly works. Except for when the mouse moves out
> >> of the canvas back into the window. I get a MouseExit event on the
> >> canvas, but not a new MouseEnter event on the window. I tried
> >> checking MouseMove, but it fires on the window even when the mouse is
> >> inside the canvas. I suppose I could keep a stack and do a push on
> >> MouseEnter and a pop on MouseExit. Does anyone know of a better way
> >> to handle that?
> >>
> Thanks to all who answered. I guess I didn't really state my real
> question in the original message. I understood that MouseExit, et al,
> were operating correctly. What I really wanted to know was if there
> was a better way to tell that the mouse was back in the window when it
> left the canvas, since MouseEnter doesn't fire on the window again.
> Stéphane answered that. So I guess I'll just keep doing it the way
> I'm doing it now.
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

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

Re: MouseEnter and MouseExit
Date: 03.08.11 17:12 (Wed, 3 Aug 2011 12:12:00 -0400)
From: Jim Dossey
On Wed, Aug 3, 2011 at 11:41 AM, Stéphane Mons <<email address removed>> wrote:
> Yes, you need to keep track of MouseEnter and MouseExit. MouseExit fires for the window only when it really goes out of the window.
>
> Le 3 août 2011 à 17:20, Jim Dossey a écrit :
>
>> Say I have a window with a canvas on it.  I need to know if the mouse
>> is in the window or the canvas.  I tried using MouseEnter and
>> MouseExit and that mostly works.  Except for when the mouse moves out
>> of the canvas back into the window.  I get a MouseExit event on the
>> canvas, but not a new MouseEnter event on the window.  I tried
>> checking MouseMove, but it fires on the window even when the mouse is
>> inside the canvas.  I suppose I could keep a stack and do a push on
>> MouseEnter and a pop on MouseExit.  Does anyone know of a better way
>> to handle that?
>>

Thanks to all who answered. I guess I didn't really state my real
question in the original message. I understood that MouseExit, et al,
were operating correctly. What I really wanted to know was if there
was a better way to tell that the mouse was back in the window when it
left the canvas, since MouseEnter doesn't fire on the window again.
Stéphane answered that. So I guess I'll just keep doing it the way
I'm doing it now.

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

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