defined a custom cell render from derive wxGridCellRenderer class.
on overide Draw method:
I want get current grid focus cell Row and Col coordinate
but the grid GetSelectedCells,GetSelectedRows get Array count is zero.
when use keyboard arrow up,down,left or right to move the indicator rect on grid view , the Draw method can't get the focus cell (row,col) coordinate use uppon method.
anyway to get grid focus cell in custom cell renderer Draw method ?
thanks.
how to get wxGrid focus cell in custom GridCellRenderer? Topic is solved
-
- wxWorld Domination!
- Posts: 1471
- Joined: Tue Nov 14, 2006 7:58 am
- Location: Saint-Petersburg, Russia
Re: how to get wxGrid focus cell in custom GridCellRenderer?
Hi,
Just to draw selection indicator in the selected cell? OK, Draw() has isSelected parameter, why not to take advantage of it?
well, why do you need current focus cell in Draw() method?sunose wrote:defined a custom cell render from derive wxGridCellRenderer class.
on overide Draw method:
I want get current grid focus cell Row and Col coordinate
but the grid GetSelectedCells,GetSelectedRows get Array count is zero.
when use keyboard arrow up,down,left or right to move the indicator rect on grid view , the Draw method can't get the focus cell (row,col) coordinate use uppon method.
anyway to get grid focus cell in custom cell renderer Draw method ?
thanks.
Just to draw selection indicator in the selected cell? OK, Draw() has isSelected parameter, why not to take advantage of it?
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10
Re: how to get wxGrid focus cell in custom GridCellRenderer?
hi,tan:
because I am Familiar java Swing JTable,I want do some special draw effect when the grid view render time.
for this ,I need get current rederering cell's distance from focus cell and then do someting .
the isSelected just when focus cell be renderering time is true.
this not I want.
yesterday ,I read the grid.h file and find the GetCursorRow and GetCursorColumn two method,they are that I want!
thank your reply.
because I am Familiar java Swing JTable,I want do some special draw effect when the grid view render time.
for this ,I need get current rederering cell's distance from focus cell and then do someting .
the isSelected just when focus cell be renderering time is true.
this not I want.
yesterday ,I read the grid.h file and find the GetCursorRow and GetCursorColumn two method,they are that I want!
thank your reply.