I'am trying to minimize whole DBGrid redraw. Where I can discuss my steps to avoid my pointless work.
Most of code what I plan to change was commited by jesus.
Petr

Mailing lists / lazarus / 2014-01
9 messages · 5 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
I'am trying to minimize whole DBGrid redraw. Where I can discuss my steps to avoid my pointless work.
Most of code what I plan to change was commited by jesus.
Petr
Petr Kristan wroteI'am trying to minimize whole DBGrid redraw. Where I can discuss my steps to avoid my pointless work. Most of code what I plan to change was commited by jesus.
The choices are this list or private mails with Jesus (). It depends on how interesting the discussion is for other people. (See the related thread about private communication :)
You should send a private mail in any case because he may not notice this.
Juha
I tried it, but no response till now.
Then I try try send another question about grid speed opt. here.
In the beginning of Grid paint is Canvas.GetClipRect called to obtain area which wee must redraw. This function directly calls WidgetSet.GetClipBox. I find out difference betwen Win32 and gtk2 bahaviour of this func.
In gtk2 TGtk2WidgetSet.GetClipBox returns previously Invalidated area (through DC.PaintRectangle = PS.rcPaint retrieved in BeginPaint)
But in win32 directly calls Windows.GetClipBox, but this func returns whole grid area. Do not takes account on invalidated area retrieved in BeginPaint.
Result of this difference is whole grid redraw in windows, even if only one cell is invalidated.
Question si how to correct this?
Modify TWin32WidgetSet.GetClipBox to behave as TGtk2WidgetSet.GetClipBox? I'am not sure, because GetClipBox should probably correspond to Win32 documentation.
How is this solved in another widgetsets?
Petr
You may have to give it a few days.
A lot of the code in Lazarus has a dedicated maintainer (SVN may sometimes give a clue). In which case other developers may hold back. Any individual developer may be busy (e.g his normal work) and only catch up once a week or fortnight. Or even be on a holiday.
Also since dbgrid (probably ( I did not check)) inherits from normal grids in LCL: Is your work in the dbgrid unit *only* or does it affect also (mostly?) LCL in general?
Depending on that you may look at talking to a different developer.
Also maybe if you start pointing out what you know, on want to ask, or where you think you want to make (which) changes, then maybe other developers can decide if it falls into there expertise.
I tried it, but no response till now. Then I try try send another question about grid…
It may be a bug in the Win32 widgetset, invalidating the entire control area instead of only the affected cell, *or* some special handling of invalidated areas by Windows. I remember that Windows used to extend the UpdateRect to include *all* invalidated parts of the DC. This can lead to a big update area, when a single bit at the top left and at the bottom right of the DC was invalidated. This may have changed in the meantime, though.
DoDi
My idea was wrong, I overlook something in debug logs. Canvas.GetClipRect returns correct value.
Problem must be in another place.
First Paint has correct update rect, but then second Paint is called on whole grid.
Petr
Petr Kristan wroteOn Wed, Jan 08, 2014 at 02:35:08PM +0100, Hans-Peter Diettrich wrote: > Petr Kristan schrieb: > >> In the beginning of Grid paint is Canvas.GetClipRect
Have you checked if it applies to other grids too? If it is generic then
mailing with the subject "dbgrid" will potentially exclude people.I have myself not much looked at I take an empty
dbgrid (no datasource), and call Invalidatecect(grid.handle, @r), then I get only one call to paint. (vista/classic theme). I have not checked how much that one call does paint.
I tried it, but no response till now. Then I try try send another question about grid…
El Mi?rcoles, 8 de enero, 2014 2:41:07, Petr Kristan escribi?:
I'm sorry, I seldom check the gmail account, now I checked and there is your msg. If somebody want to write me, please use
Thanks.
Jesus Reyes A. ?
Oops, sorry again. It is yahoo.com.mx
Jesus Reyes A.