Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread MouseEnter/Leave
Mon, Nov 11 2013 11:52 AMPermanent Link

Matthew Jones

Am I right in thinking that the mouse enter/leave events for a TPanel occur not
only when the mouse enters/leaves the panel rectangle, but also when the mouse goes
over another control WITHIN the TPanel? This seems to be the case, and I can sort
of understand it, but it would be nice to have it work as a container rather than a
covered item.

/Matthew Jones/
Tue, Nov 12 2013 4:25 AMPermanent Link

Ronald

Hi Matthew,

I have not seen this behaviour. These events are fired only by the controls
that are entered. If Panel2 is a child within Panel1 then only Panel2 fires
the event.

Greetings,
Ronald


"Matthew Jones"  schreef in bericht
news:memo.20131111165207.8200Q@nothanks.nothanks.co.uk...

Am I right in thinking that the mouse enter/leave events for a TPanel occur
not
only when the mouse enters/leaves the panel rectangle, but also when the
mouse goes
over another control WITHIN the TPanel? This seems to be the case, and I can
sort
of understand it, but it would be nice to have it work as a container rather
than a
covered item.

/Matthew Jones/
Tue, Nov 12 2013 5:02 AMPermanent Link

Matthew Jones

> I have not seen this behaviour. These events are fired only by the
> controls that are entered. If Panel2 is a child within Panel1 then
> only Panel2 fires the event.

Thanks for that. I'm not getting anything at all consistent (in Chrome) so I will
study my code further knowing that it can work properly.

/Matthew Jones/

Tue, Nov 12 2013 7:17 AMPermanent Link

Matthew Jones

Okay, further studying done. There is some odd logic error I think.

I'll try to do some ASCII art.

 +---------------------------------------------+
 | +----------------------+                    |
 | | Label1               |                    |
 | +----------------------+                    |
 |                                             |
 | +----------------------+                    |
 +-|----------------------|--------------------+
   +----------------------+                     

Two labels on a TPanel. Label1 is fully on the panel, Label2 is either touching or
slightly over the edge of the panel (and therefore a bit hidden).

The enter/leave detection works fine if you enter from the top, left or right. If
you enter from the bottom, then you get the enter and immediately get the leave on
the next move.

If I move the Label2 to be one pixel margin inside the panel, then it all works as
you would expect.

/Matthew Jones/
Tue, Nov 12 2013 8:58 AMPermanent Link

Matthew Jones

Okay, I don't think that is right either. I think it is simply the speed at which
it hits an inner item. If I move fast from the top, such that the second move
coordinates are on the label1, I can have it "leave".

/Matthew Jones/
Thu, Nov 14 2013 3:26 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Okay, I don't think that is right either. I think it is simply the speed
at which it hits an inner item. If I move fast from the top, such that the
second move coordinates are on the label1, I can have it "leave".  >>

EWB goes to great lengths to make container controls only fire a single
enter/leave event, even with child controls.  By default, browsers/JS do
*not* work this way, and it is quite difficult to get it to work properly.
I've noticed the behavior that you mention several times, but haven't been
able to fix it yet, so I'll try to do so for the next minor release.

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Nov 15 2013 5:47 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Okay, I don't think that is right either. I think it is simply the speed
at which it hits an inner item. If I move fast from the top, such that the
second move coordinates are on the label1, I can have it "leave".  >>

This is now fixed for 1.03 - the EWB framework has to manually "wind/unwind"
the mouse enter/leave events when an element is right next to the edge of a
container element because the container control never receives an event for
mouse enter/leave.  What's funny is that EWB's existing framework code is
the proposed fix all over the Internet for JS developers, and it does not
work 100% of the time. Smile

Tim Young
Elevate Software
www.elevatesoft.com
Image