[Gambas-user] How to know permanently the cursor coordinates in a gridview?

Benoît Minisini gambas at ...1...
Mon Feb 23 12:11:00 CET 2009


> Hi,
> I've a main Gridview (grdGame) surrounded by 2 other grids, grdHdef on
> top and grdVdef on left of grdGame
>
> When the mouse cursor is over the main grid, I want to highlight a
> column of the top grid and a row of the left grid facing the cursor
> position.
> How to know at each instant where the cursor is, that is without action
> on any button?
> I cannot use Mouse.X/Y because there is no mouse event
>
> Thank for your help,
>

Yep. The problem is that mouse move are not always generated. It depends on 
the internal implementation of the widget in the toolkit.

What you can do is enabling a timer at Enter event, and disabling it at Leave 
event. Ecah timer the timer is triggered, just use the Mouse.ScreenX and 
Mouse.ScreenY properties to calculate where the cursor is on the GridView.

The right solution would be implementing a "Tracking" property in the Control 
class to tell Gambas that you want MouseMove events even if no mouse button is 
pressed.

Regards,

-- 
Benoît




More information about the User mailing list