Merged revision(s) 51286 #6d831b44de, 51317 #9e65d8f0c1 from trunk:

LCL: grids: partially revert r49016 #2b2ffb7044 that prevents OnSelectEditor when entering cell by keyboard. Issue #29191
........
grids: Do not reset Offset in keyboard Events. Issue #29420, patch by Michl
........

git-svn-id: branches/fixes_1_6@51328 -
This commit is contained in:
maxim 2016-01-18 23:04:52 +00:00
parent 915e906be0
commit 67fc6eb2c8

View File

@ -6848,9 +6848,9 @@ var
procedure MoveSel(Rel: Boolean; aCol,aRow: Integer); procedure MoveSel(Rel: Boolean; aCol,aRow: Integer);
begin begin
// Always reset Offset in keyboard Events // Do not reset Offset in keyboard Events - see issue #29420
FGCache.TLColOff:=0; //FGCache.TLColOff:=0;
FGCache.TLRowOff:=0; //FGCache.TLRowOff:=0;
SelectActive:=Sh; SelectActive:=Sh;
Include(FGridFlags, gfEditingDone); Include(FGridFlags, gfEditingDone);
if MoveNextSelectable(Rel, aCol, aRow) then if MoveNextSelectable(Rel, aCol, aRow) then
@ -7179,20 +7179,18 @@ begin
FRow := DRow; FRow := DRow;
MoveSelection; MoveSelection;
if EditorAlwaysShown then begin
SelectEditor; SelectEditor;
if (FEditor<>nil) and EditorAlwaysShown then begin
// if editor visibility was changed on BeforeMoveSelection or MoveSelection // if editor visibility was changed on BeforeMoveSelection or MoveSelection
// make sure editor will be updated. // make sure editor will be updated.
// TODO: cell coords of last time editor was visible // TODO: cell coords of last time editor was visible
// could help here too, if they are not the same as the // could help here too, if they are not the same as the
// current cell, editor should be hidden first too. // current cell, editor should be hidden first too.
if FEditor<>nil then begin
if FEditor.Visible then if FEditor.Visible then
EditorHide; EditorHide;
EditorShow(true); EditorShow(true);
end; end;
end;
{$IfDef dbgGrid}DebugLnExit('MoveExtend END FCol= ',IntToStr(FCol), ' FRow= ',IntToStr(FRow));{$Endif} {$IfDef dbgGrid}DebugLnExit('MoveExtend END FCol= ',IntToStr(FCol), ' FRow= ',IntToStr(FRow));{$Endif}
end; end;