View Issue Details

IDProjectCategoryView StatusLast Update
0034890LazarusLCLpublic2019-03-19 17:09
ReportersembitAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx64OSWindowsOS Version10
Product Version2.1 (SVN)Product Build60030 
Target Version2.0.2Fixed in Version2.1 (SVN) 
Summary0034890: Drawing the indicator in flat TDBGrid
DescriptionWhen Flat = True, when moving through records the indicator is drawn incorrectly.
Additional InformationThe archive contains a picture (1.png) showing the problem.
TagsNo tags attached.
Fixed in Revision60660
LazTarget2.0.2
WidgetsetWin32/Win64
Attached Files

Activities

sembit

2019-01-17 19:03

reporter  

TestFlatDBGrid.zip (158,988 bytes)

Jesus Reyes

2019-03-13 00:17

developer   ~0114806

The problem of this report is caused by Canvas.SaveHandleState and Canvas.RestoreHandleState wich save and restore all the underlaying canvas context properties but they doesn't restore the high level canvas properties like the pen.color property. In this case The problem here, before restoring, canvas.pen.color is set to CLR_A, and after restoring the context pen color is restored to CLR_B. While trying to paint the border
 the canvas.pen.color is set to CLR_A which doesn't succeed because it is the same that was set before and that is lost on restoring the context, as result the line is painted not with the desires pen color but with the currently selected pen color in the context.

In order to properly fix this problem Instead of saving & restoring only the underlaying context properties also the high level properties like pen.color should be made, for this case specifically that would be too much because and risk introducing new bugs and would make the grid paint slower as more time will be invested in saving not only the pen color but all other pen and brush properties but it will also require more backup space. Another solution for the grid would be simple save and restore the pen.color before and after doDrawCell but that would be made multiple times on each pant cycle, instead a workaround is introduced that has the minimum impact.

Please test.

sembit

2019-03-19 17:09

reporter   ~0114928

Thanks!

Issue History

Date Modified Username Field Change
2019-01-17 19:03 sembit New Issue
2019-01-17 19:03 sembit File Added: TestFlatDBGrid.zip
2019-03-06 20:55 Jesus Reyes Assigned To => Jesus Reyes
2019-03-06 20:55 Jesus Reyes Status new => assigned
2019-03-13 00:17 Jesus Reyes Fixed in Revision => 60660
2019-03-13 00:17 Jesus Reyes LazTarget => 2.0.2
2019-03-13 00:17 Jesus Reyes Note Added: 0114806
2019-03-13 00:17 Jesus Reyes Status assigned => resolved
2019-03-13 00:17 Jesus Reyes Fixed in Version => 2.1 (SVN)
2019-03-13 00:17 Jesus Reyes Resolution open => fixed
2019-03-13 00:17 Jesus Reyes Target Version => 2.0.2
2019-03-19 17:09 sembit Note Added: 0114928
2019-03-19 17:09 sembit Status resolved => closed