In a previous mail i wrote a few months ago i mentioned the issue that Lazarus has with Windows Vista when both Aero and visual styles are turned off (which is the case when the Classic theme is used). I decided to dig into a bit today since nobody seemed to figure out a solution (it is still there in rev 18800) and i attached a patch that fixes it.
However i'm not sure if this is the best way to handle the issue.
The problem seems to be in Vista: the clip region isn't used correctly with SetPixel when both aero and visual styles are off and large parts of the region are clipped. Enabled a visual style (like the Visual Basic theme) or Aero fixes this problem, but many users (including me) prefer the Classic theme. So i replaced the call to DrawGrid, which uses SetPixel, with code that draws the grid using a 1 pixel Rectangle. The process unfortunatelly is much slower and in order to avoid messing with other OSes which work without a problem, i added a {$IFDEF WIN32} in there. Also even in Windows, this only happens in an exceptional case: Windows Vista with the Classic theme. I believe it works in every other version of Windows (Win7 not tested). So probably extra some code should be written to avoid this "fix" when Vista is in Aero or uses a Visual Style or some other version of Windows is used. For starters this might need to be moved in DrawGrid function - but i didn't do this because DrawGrid expects Pen settings while i had to use Brush. Beyond that, somewhere in the WidgetSet's initialization a check should be done for the OS and set a flag that DrawGrid will check to see if it should sue Rectangle or SetPixel depending on the OS version and settings.
These are do-able of course, but i thought to release a patch for those who experience the problem and want a fix.
Kostas "Bad Sector" Michalopoulos
PS. I also have another problem: the whole screen flickers like mad - basically everything gets redrawn - when the grid is drawn. This happens with other programs too, so its not a Lazarus-specific issue. However i wonder if anyone knows about a solution.
