Readraw Cells in Grid

Oswaldo Hernández wrote:

Hello,

I need readraw some cells in a grid. To do it i try send a EVT_GRID_CELL_CHANGE. The CellChange event is fired, but the Draw method in the custom render is not raised.

How can I force Draw in a cell? (not the active cell)

Something like this should do it:

  rect = grid.CellToRect(row, col)
  grid.GetGridWindow().RefreshRect(rect)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Oswaldo Hernández wrote:

Robin Dunn escribió:

Oswaldo Hernández wrote:

Hello,

I need readraw some cells in a grid. To do it i try send a EVT_GRID_CELL_CHANGE. The CellChange event is fired, but the Draw method in the custom render is not raised.

How can I force Draw in a cell? (not the active cell)

Something like this should do it:

    rect = grid.CellToRect(row, col)
    grid.GetGridWindow().RefreshRect(rect)

Sorry for the later response.

I need redraw all cells in the active line without using the select line method.

grid.GetGridWindow().RefreshRect(rect) works fine when move the active cell in the visible part of the grid window, but if move, with cursor, down or up the active cell, forcing the grid to make scroll, a strange effect occur, some cells are partially renderized.

You probably need to convert the rectangle position from logical position to the physical position to compensate for the scrolling offset. See the wx docs for wxScrolledWindow::CalcScrolledPosition.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!