Hi,
How can I force the grid to invalidate (or draw if visible) a single cell ?
Michael.

Mailing lists / lazarus / 2008-11
6 messages · 4 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi,
How can I force the grid to invalidate (or draw if visible) a single cell ?
Michael.
Michael Van Canneyt wroteHow can I force the grid to invalidate (or draw if visible) a single cell ?
Grid.InvalidateCell(aCol, aRow)?
How can I force the grid to invalidate (or draw if visible) a single cell ? Michael.
--- El mar 4-nov-08, Michael Van Canneyt escribi?:
grid.InvalidateCell(ColIndx,RowIndex);Jesus Reyes A.
?Todo sobre Amor y Sexo!
La gu?a completa para tu vida en Mujer de Hoy.
http://mx.mujer.yahoo.com/
Just curious....but why would you need that? Isn't the grid painting double buffered?
Regards,
- Graeme -
_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
--- El mar 4-nov-08, Graeme Geldenhuys escribi?:
grid does (or knows?) nothing about doublebuffer, that is handled in some other layer, but even then, it's needed in cases like the spreadsheet example when column and row header needs to be repainted because selection has changed, the grid can handle the selection change but not the headers change. It's supposedly more efficient to blit a portion of area than the whole area.
Jesus Reyes A.
?Todo sobre Amor y Sexo!
La gu?a completa para tu vida en Mujer de Hoy.
http://mx.mujer.yahoo.com/
Just curious....but why would you need that? Isn't the grid painting double buffered? -…
That is what I also expected...
Well, I have a special grid mediator that must redraw a TCustomDrawGrid cell, but I don't want it to do this unless it is absolutely necessary. So I tell the grid to invalidate the cell and have it figure out whether the repaint is needed or not. (and in doing so, it calculates all needed parameters such as the cell rectangle and so on)
For a stringgrid, setting the cell text will do whatever is needed, but that doesn't work in a TCustomDrawGrid.
But somehow the InvalidateCell doesn't show up in the code completion. I just get "Invalidate", which I found strange, and so I asked the question. I'll investigate this.
Thanks to everyone for the answers.
Michael.