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;
procedure doMouseDown;
begin
if not Focused then
if not Focused and not(csNoFocus in ControlStyle) then
SetFocus;
if assigned(OnMouseDown) then
OnMouseDown(Self, Button, Shift, X, Y);

View File

@ -6091,7 +6091,7 @@ procedure TCustomGrid.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
function DoAutoEdit: boolean;
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);
if result then begin
SelectEditor;
@ -6113,7 +6113,7 @@ begin
DebugLn('Mouse was in ', dbgs(FGCache.HotGridZone));
{$ENDIF}
if not Focused then begin
if not Focused and not(csNoFocus in ControlStyle) then begin
SetFocus;
if not Focused then begin
{$ifDef dbgGrid} DebugLnExit('TCustomGrid.MouseDown EXIT: Focus not allowed'); {$Endif}