View Issue Details

IDProjectCategoryView StatusLast Update
0029420LazarusLCLpublic2016-01-18 22:07
ReporterMichlAssigned ToOndrej Pokorny 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOS7OS Version32bit
Product Version1.5 (SVN)Product Build51302 
Target Version1.6Fixed in Version1.7 (SVN) 
Summary0029420: [patch] grid fix for offset bug
DescriptionBy default goSmoothScroll is set in TDrawGrid and TStringGrid options. If you scroll with the scrollbars a bit, the offset of the cells is changed. If you not step with the keyboard in the grid, the cells are painted at the wrong position.
Steps To ReproduceStart added example or create a project with a grid witch is bigger than the form so the scrollbars appear.

- scroll a little bit, that the cells at the first position aren't completly painted
- click on one cell in the grid
- step with the keyboard -> the new painted cells have a other offset than the old cells
 
Additional InformationThe patch has no effect for TDBGrid, cause there is no SmoothScroll option (only full painted cells).

It works for vertical and horizontal cutted cells (see testproject).

There was a little thread about that issue on German Lazarusforum: http://www.lazarusforum.de/viewtopic.php?f=19&t=9311
TagsNo tags attached.
Fixed in Revision51317
LazTarget1.6
WidgetsetWin32/Win64
Attached Files
  • offsetpatch.pas (583 bytes)
    Index: lcl/grids.pas
    ===================================================================
    --- lcl/grids.pas	(revision 51302)
    +++ lcl/grids.pas	(working copy)
    @@ -6849,8 +6849,10 @@
       procedure MoveSel(Rel: Boolean; aCol,aRow: Integer);
       begin
         // Always reset Offset in keyboard Events
    -    FGCache.TLColOff:=0;
    -    FGCache.TLRowOff:=0;
    +    if not (goSmoothScroll in Options) then begin
    +      FGCache.TLColOff := 0;
    +      FGCache.TLRowOff := 0;
    +    end;
         SelectActive:=Sh;
         Include(FGridFlags, gfEditingDone);
         if MoveNextSelectable(Rel, aCol, aRow) then
    
    offsetpatch.pas (583 bytes)
  • testproject.zip (2,160 bytes)
  • snapshot.png (45,248 bytes)
    snapshot.png (45,248 bytes)

Activities

Michl

2016-01-16 21:51

developer  

offsetpatch.pas (583 bytes)
Index: lcl/grids.pas
===================================================================
--- lcl/grids.pas	(revision 51302)
+++ lcl/grids.pas	(working copy)
@@ -6849,8 +6849,10 @@
   procedure MoveSel(Rel: Boolean; aCol,aRow: Integer);
   begin
     // Always reset Offset in keyboard Events
-    FGCache.TLColOff:=0;
-    FGCache.TLRowOff:=0;
+    if not (goSmoothScroll in Options) then begin
+      FGCache.TLColOff := 0;
+      FGCache.TLRowOff := 0;
+    end;
     SelectActive:=Sh;
     Include(FGridFlags, gfEditingDone);
     if MoveNextSelectable(Rel, aCol, aRow) then
offsetpatch.pas (583 bytes)

Michl

2016-01-16 21:55

developer  

testproject.zip (2,160 bytes)

Michl

2016-01-17 22:45

developer  

snapshot.png (45,248 bytes)
snapshot.png (45,248 bytes)

Michl

2016-01-17 22:48

developer   ~0089015

Last edited: 2016-01-17 22:55

View 2 revisions

It works for the IDE too ;)

The snapshot was made without the patch (Options -> Editor -> Mouse -> Advanced).

Michl

2016-01-18 22:07

developer   ~0089050

Thanks!

Issue History

Date Modified Username Field Change
2016-01-16 21:51 Michl New Issue
2016-01-16 21:51 Michl File Added: offsetpatch.pas
2016-01-16 21:55 Michl File Added: testproject.zip
2016-01-17 22:45 Michl File Added: snapshot.png
2016-01-17 22:48 Michl Note Added: 0089015
2016-01-17 22:55 Michl Note Edited: 0089015 View Revisions
2016-01-18 19:32 Ondrej Pokorny LazTarget => -
2016-01-18 19:32 Ondrej Pokorny Status new => confirmed
2016-01-18 19:40 Ondrej Pokorny Assigned To => Ondrej Pokorny
2016-01-18 19:40 Ondrej Pokorny Status confirmed => assigned
2016-01-18 19:48 Ondrej Pokorny Fixed in Revision => 51317
2016-01-18 19:48 Ondrej Pokorny LazTarget - => 1.6
2016-01-18 19:48 Ondrej Pokorny Status assigned => resolved
2016-01-18 19:48 Ondrej Pokorny Fixed in Version => 1.7 (SVN)
2016-01-18 19:48 Ondrej Pokorny Resolution open => fixed
2016-01-18 19:48 Ondrej Pokorny Target Version => 1.6
2016-01-18 22:07 Michl Note Added: 0089050
2016-01-18 22:07 Michl Status resolved => closed