The wxGrid.XYToCell seems to be broken for virtual grids. It doesn't appear to take into account the row and column label sizes or the scroll positions.
Without this, it was impossible to make a virtual grid the target of a DragAndDrop action. This took me a little while to work out, so here is my solution. Note the new XYToCell function in the example below. Comments are welcome
I assume this is a wxWindows bug, who should be contacted about this?
p.s. this should probably go into the grid wiki or the demos, I am wiki challenged so if somebody could help out ...
Brian Kelley
Whitehead Institute for Biomedical Research
The wxGrid.XYToCell seems to be broken for virtual grids. It doesn't appear to take into account the row and column label sizes or the scroll positions.
Without this, it was impossible to make a virtual grid the target of a DragAndDrop action. This took me a little while to work out, so here is my solution. Note the new XYToCell function in the example below. Comments are welcome
I assume this is a wxWindows bug, who should be contacted about this?
PLease enter a bug report at SF about it, with a category of wxGrid.
p.s. this should probably go into the grid wiki or the demos, I am wiki challenged so if somebody could help out ...
Okay. XYToCell is not broken, just poorly documented
XYToCell, XToCol and YToRow take unscrolled coordinates. On top of that it seems that the grid's labels need to be taken into account for computing the x,y positions. Attached (and also on the wxGrid wiki now, thanks Robin) is the updated DragAndDrop to wxGrid.
Perhaps another addition to the demo? It would have saved me some time
Okay. XYToCell is not broken, just poorly documented
XYToCell, XToCol and YToRow take unscrolled coordinates. On top of that it seems that the grid's labels need to be taken into account for computing the x,y positions. Attached (and also on the wxGrid wiki now, thanks Robin) is the updated DragAndDrop to wxGrid.
Thanks for the update.
Perhaps another addition to the demo? It would have saved me some time
Yep, I've already added it. I'll update it with your new version.
路路路
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!