From 4c24b68ea964b71135cdcd4096016eb0087b73d9 Mon Sep 17 00:00:00 2001 From: jesus Date: Sat, 20 Oct 2007 08:11:59 +0000 Subject: [PATCH] LCL, grids, fixed AutoAdvance when grid has goRowSelect option, reported by Barko git-svn-id: trunk@12529 - --- lcl/dbgrids.pas | 34 +++++++++++++++++----------------- lcl/grids.pas | 9 ++++++++- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/lcl/dbgrids.pas b/lcl/dbgrids.pas index 0d87730981..6b5fb775bc 100644 --- a/lcl/dbgrids.pas +++ b/lcl/dbgrids.pas @@ -1760,21 +1760,20 @@ begin doOnKeyDown; if Key<>0 then begin if dgTabs in Options then begin + if GetDeltaMoveNext(ssShift in Shift, DeltaCol, DeltaRow) then begin - GetDeltaMoveNext(ssShift in Shift, DeltaCol, DeltaRow); + if DeltaRow > 0 then begin + if doVKDown then + //DeltaCol:=0; // tochk: strict? already in EOF, don't change column + end else + if DeltaRow < 0 then begin + if doVKUP then + //DeltaCol:=0; // tochk: strict? already in BOF, don't change column + end; - if DeltaRow > 0 then begin - if doVKDown then - //DeltaCol:=0; // tochk: strict? already in EOF, don't change column - end else - if DeltaRow < 0 then begin - if doVKUP then - //DeltaCol:=0; // tochk: strict? already in BOF, don't change column + if (DeltaCol<>0) then + Col := Col + DeltaCol; end; - - if (DeltaCol<>0) then - Col := Col + DeltaCol; - Key := 0; end; end; @@ -1788,11 +1787,12 @@ begin if (dgEditing in Options) and not EditorMode then EditorMode:=true else begin - GetDeltaMoveNext(ssShift in Shift, DeltaCol, DeltaRow); - if DeltaRow > 0 then - doVKDown; - if DeltaCol <> 0 then - Col := Col + DeltaCol; + if GetDeltaMoveNext(ssShift in Shift, DeltaCol, DeltaRow) then begin + if DeltaRow > 0 then + doVKDown; + if DeltaCol <> 0 then + Col := Col + DeltaCol; + end; ResetEditor; end; end; diff --git a/lcl/grids.pas b/lcl/grids.pas index e3e4607e56..bd88954c54 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -6260,7 +6260,14 @@ begin if FAutoAdvance=aaNone then exit; // quick case, no auto movement allowed - + + if [goRowSelect,goRelaxedRowSelect]*Options=[goRowSelect] then begin + if Inverse then + ACol := FixedCols + else + ACol := ColCount-1; + end; + // browse the grid in autoadvance order while CalcNextStep do begin ACol := ACol + DeltaCol;