mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 13:50:06 +02:00
LCL: grids: support csNoFocus. Modified patch from Gabor Boros. Issue #28931
git-svn-id: trunk@50454 -
This commit is contained in:
parent
08960d78f2
commit
3afba023bb
@ -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);
|
||||||
|
@ -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}
|
||||||
|
Loading…
Reference in New Issue
Block a user