Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-11

Grid question

6 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jesus Reyes
to Michael Van Canneyt: 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?:

Show quoted text 10 lines
De:: Michael Van Canneyt Asunto: [Lazarus] Grid question A: "Lazarus mailing list" Fecha: martes, 4 noviembre, 2008, 9:23 am Hi, How can I force the grid to invalidate (or draw if visible) a single cell ? Michael.
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/

Reply by email

Graeme Geldenhuys
to Jesus Reyes
Jesus Reyes wrote 9 lines
> > How can I force the grid to invalidate (or draw if visible) > a single cell ? > grid.InvalidateCell(ColIndx,RowIndex); Jesus Reyes A.

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/

Reply by email

Jesus Reyes
to Graeme Geldenhuys

--- El mar 4-nov-08, Graeme Geldenhuys escribi?:

Show quoted text 25 lines
De:: Graeme Geldenhuys Asunto: Re: [Lazarus] Grid question A: "General mailing list" Fecha: martes, 4 noviembre, 2008, 10:48 am On 11/4/08, Jesus Reyes wrote: > > > > How can I force the grid to invalidate (or draw if visible) > > a single cell ? > > > > > grid.InvalidateCell(ColIndx,RowIndex); > > Jesus Reyes A. Just curious....but why would you need that? Isn't the grid painting double buffered? Regards, - Graeme -

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/

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys: Just curious....but why would you need that? Isn't the grid painting double buffered? -…
Graeme Geldenhuys wrote 8 lines
On 11/4/08, Jesus Reyes wrote: > > > > How can I force the grid to invalidate (or draw if visible) > > a single cell ? > > > > > grid.InvalidateCell(ColIndx,RowIndex);

That is what I also expected...

Show quoted text 5 lines
> > Jesus Reyes A. Just curious....but why would you need that? Isn't the grid painting double buffered?

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.

Reply by email