wxGrid Mouse Move and Position to Row ID retrieval Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
kshitij_ds
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 205
Joined: Wed Jun 25, 2008 3:37 pm

wxGrid Mouse Move and Position to Row ID retrieval

Post by kshitij_ds » Wed Jan 14, 2009 10:17 pm

Hello All,

In my application I have a grid control with one column and multiple rows.
I am displaying a tooltip text when users move mouse over a cell. Now, the data for this tooltip is stored in a Map and the key of which corresponds to RowID.
Hence, MyMap[1] will retrieve value for cell 1 (row:1 col :0).

Now, the retrieval and tooltip display works fine when the number of rows are less enough such that users do not have to scroll down using vertical scroll bars. This is because I use the
event.GetPosition();
method to determine y co-ordinate.
However, when users scroll to some row, the y co-ordinate is calculated with respect to the new view and the currently visible row taken as reference zero (0).

Can anyone suggest if there is any other way to retrieve exact row number number ?

timg
Earned some good credits
Earned some good credits
Posts: 148
Joined: Mon Jan 23, 2006 6:52 pm

Post by timg » Wed Jan 14, 2009 11:27 pm

I believe you will need to translate the position to logical coordinates using:

wxScrolledWindow::CalcUnscrolledPosition

before you can feed it to YtoRow function.

Post Reply