Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread TGrid OnMouseLeave Event
Tue, Sep 6 2016 10:32 PMPermanent Link

kentersoft

TGrid's OnMouseLeave event is fire at Mouse Leave Rows area , can the area include Grid Header and ScrollBar area.
I want to use Grid's OnMouseLeave to auto Hide a child form which contains the Grid, but when want to use scrollbar to scroll grid, OnMouseLeave is fire, then grid hide.

thanks!
Thu, Sep 8 2016 7:13 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< TGrid's OnMouseLeave event is fire at Mouse Leave Rows area , can the area include Grid Header and ScrollBar area. I want to use Grid's OnMouseLeave to auto Hide a child form which contains the Grid, but when want to use scrollbar to scroll grid, OnMouseLeave is fire, then grid hide.  >>

So, just to confirm: you *want* the OnMouseLeave to fire when the user scrolls the grid and then moves the mouse outside of the grid ?

This probably won't be possible without a re-design of the grid.  The "rows" area is considered the client area of the grid, whereas the headers and scrollbars reside in the "non-client" area of the grid.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Sep 8 2016 8:14 AMPermanent Link

kentersoft

Tim Young [Elevate Software] wrote:


<< TGrid's OnMouseLeave event is fire at Mouse Leave Rows area , can the area include Grid Header and ScrollBar area. I want to use Grid's OnMouseLeave to auto Hide a child form which contains the Grid, but when want to use scrollbar to scroll grid, OnMouseLeave is fire, then grid hide.  >>

<
So, just to confirm: you *want* the OnMouseLeave to fire when the user scrolls the grid and then moves the mouse outside of the grid ?
>

I use Grid in a dropdown form to select some data, user sometime need scroll the rows to select row, after user select row, i make the form invisible, but user sometime may not select row, so i need when user move cursor outside the grid, make the form invisible, but now when cursor outside grid's rows area, onMouseLeave event fired, this make user impossible use mouse to scroll grid rows.

thanks!
Thu, Sep 8 2016 11:54 AMPermanent Link

Matthew Jones

kentersoft wrote:

>  so i need when user move cursor outside the grid,

This is a key thing for me too - and in a container. Indeed, if we
could just have it work for TPanel (or the appropriate parent of them
all) then it would be quite workable. A lot of things on the web work
on the basis that you mouse over the item represented by a panel or
something and actions you can take become visible (fade in), or it
changes colour etc. When the panel contains other components, they can
steal the events, and that stops this working (I end up with actions
still enabled, or not showing at all). It has been discussed before,
but I'm approaching this being critical for me, and so hope to work
something out that will work for me. Even a basic "mouse moved to X,Y"
would be enough, or as I say just basing it on a panel would be good.

--

Matthew Jones
Wed, Sep 14 2016 2:07 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< A lot of things on the web work on the basis that you mouse over the item represented by a panel or something and actions you can take become visible (fade in), or it changes colour etc. >>

Yes, but as you say, these are not just simple panels that we're talking about.  You can do what you say with a TBasicPanel, no problem.  But, this is a *very* complex grid control that involves thousands of lines of code.  It's not something that is amenable to a simple "hey, did the mouse enter" this UI element.  There are hundreds of UI elements in a grid control, and *all* of them need to know about, and react to, mouse events.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Sep 14 2016 3:39 PMPermanent Link

Matthew Jones

Tim Young [Elevate Software] <timyoung@elevatesoft.com> wrote:
> Matthew,
>
> << A lot of things on the web work on the basis that you mouse over the
> item represented by a panel or something and actions you can take become
> visible (fade in), or it changes colour etc. >>
>
> Yes, but as you say, these are not just simple panels that we're talking
> about.  You can do what you say with a TBasicPanel, no problem.  But,
> this is a *very* complex grid control that involves thousands of lines of
> code.  It's not something that is amenable to a simple "hey, did the
> mouse enter" this UI element.  There are hundreds of UI elements in a
> grid control, and *all* of them need to know about, and react to, mouse events.
>
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
>

I was thinking to ignore other controls. Then you can put something complex
like the grid on a panel. I realise that's a bit selfish though. 8-)

--
Matthew Jones
Tue, Sep 20 2016 7:15 AMPermanent Link

Matthew Jones

I worked out a way for me to achieve my mouse enter/leave desires in
the current version. I did a counter for the mouse enter/leave in
complex situations, where you have a single event handler for a panel
and the components on the panel (some of which may touch the edges
etc). This is unreliable, in that I can move the mouse over and end up
with an enter count of anywhere from 3 to -1 on leaving the area. For
any component, it's fine, but for compound groups like this, much less
so.

However, that doesn't matter, because what IS reliable for this
purpose, is the MouseMove event. Indeed it is perfect, because it is
not counted. So on the event, I can just de-select any other panel in
the display, and select the one the mouse is over, making the extra
tools visible as it goes. It seems undefeatable at this point in time.

--

Matthew Jones
Wed, Sep 21 2016 6:19 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< I worked out a way for me to achieve my mouse enter/leave desires in the current version. I did a counter for the mouse enter/leave in complex situations, where you have a single event handler for a panel and the components on the panel (some of which may touch the edges etc). This is unreliable, in that I can move the mouse over and end up with an enter count of anywhere from 3 to -1 on leaving the area. For any component, it's fine, but for compound groups like this, much less so. >>

You've just duplicated what EWB already does in its event manager.  Check out the WebUI unit, specifically the TEventManager.MouseEnterHandler and TEventManager.MouseLeaveHandler methods.

Tim Young
Elevate Software
www.elevatesoft.com
Image