LCL: grids: support csNoFocus. Modified patch from Gabor Boros. Issue #28931

git-svn-id: trunk@50454 -
This commit is contained in:
ondrej 2015-11-20 22:24:29 +00:00
parent 08960d78f2
commit 3afba023bb
2 changed files with 3 additions and 3 deletions

View File

@ -2535,7 +2535,7 @@ var
P: TPoint; P: TPoint;
procedure doMouseDown; procedure doMouseDown;
begin begin
if not Focused then if not Focused and not(csNoFocus in ControlStyle) then
SetFocus; SetFocus;
if assigned(OnMouseDown) then if assigned(OnMouseDown) then
OnMouseDown(Self, Button, Shift, X, Y); OnMouseDown(Self, Button, Shift, X, Y);

View File

@ -6091,7 +6091,7 @@ procedure TCustomGrid.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
function DoAutoEdit: boolean; function DoAutoEdit: boolean;
begin begin
result := FAutoEdit and EditingAllowed(FCol) and result := FAutoEdit and not(csNoFocus in ControlStyle) and EditingAllowed(FCol) and
(FGCache.ClickCell.X=Col) and (FGCache.ClickCell.Y=Row); (FGCache.ClickCell.X=Col) and (FGCache.ClickCell.Y=Row);
if result then begin if result then begin
SelectEditor; SelectEditor;
@ -6113,7 +6113,7 @@ begin
DebugLn('Mouse was in ', dbgs(FGCache.HotGridZone)); DebugLn('Mouse was in ', dbgs(FGCache.HotGridZone));
{$ENDIF} {$ENDIF}
if not Focused then begin if not Focused and not(csNoFocus in ControlStyle) then begin
SetFocus; SetFocus;
if not Focused then begin if not Focused then begin
{$ifDef dbgGrid} DebugLnExit('TCustomGrid.MouseDown EXIT: Focus not allowed'); {$Endif} {$ifDef dbgGrid} DebugLnExit('TCustomGrid.MouseDown EXIT: Focus not allowed'); {$Endif}