View Issue Details

IDProjectCategoryView StatusLast Update
0028931LazarusLCLpublic2015-11-21 10:56
ReporterGabor BorosAssigned ToOndrej Pokorny 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.4.5 (SVN)Product Build50149 
Target VersionFixed in Version1.6 
Summary0028931: Grids ignore the csNoFocus control style
DescriptionIf click on a grid it's catch the focus independently from csNoFocus control style. The attached diffs solve the problem.
TagsNo tags attached.
Fixed in Revision50454
LazTarget-
Widgetset
Attached Files
  • grids.diff (204 bytes)
    --- grids.pas	Cs okt.  1 15:25:52 2015
    +++ grids.pas	Cs okt. 29 21:10:49 2015
    @@ -6087 +6087 @@ begin
    -  if not Focused then begin
    +  if (not Focused) and (not(csNoFocus in ControlStyle)) then begin
    
    grids.diff (204 bytes)
  • dbgrids.diff (198 bytes)
    --- dbgrids.pas	Cs okt.  1 15:25:52 2015
    +++ dbgrids.pas	Cs okt. 29 21:17:25 2015
    @@ -2460 +2460 @@ var
    -    if not Focused then
    +    if (not Focused) and (not(csNoFocus in ControlStyle)) then
    
    dbgrids.diff (198 bytes)
  • grid_no_focus.patch (919 bytes)
    Index: lcl/dbgrids.pas
    ===================================================================
    --- lcl/dbgrids.pas	(revision 50199)
    +++ lcl/dbgrids.pas	(working copy)
    @@ -2537,7 +2537,7 @@
       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);
    Index: lcl/grids.pas
    ===================================================================
    --- lcl/grids.pas	(revision 50199)
    +++ lcl/grids.pas	(working copy)
    @@ -6125,7 +6125,7 @@
       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}
    
    grid_no_focus.patch (919 bytes)

Activities

Gabor Boros

2015-10-29 21:38

reporter  

grids.diff (204 bytes)
--- grids.pas	Cs okt.  1 15:25:52 2015
+++ grids.pas	Cs okt. 29 21:10:49 2015
@@ -6087 +6087 @@ begin
-  if not Focused then begin
+  if (not Focused) and (not(csNoFocus in ControlStyle)) then begin
grids.diff (204 bytes)

Gabor Boros

2015-10-29 21:38

reporter  

dbgrids.diff (198 bytes)
--- dbgrids.pas	Cs okt.  1 15:25:52 2015
+++ dbgrids.pas	Cs okt. 29 21:17:25 2015
@@ -2460 +2460 @@ var
-    if not Focused then
+    if (not Focused) and (not(csNoFocus in ControlStyle)) then
dbgrids.diff (198 bytes)

Cyrax

2015-10-30 00:15

reporter   ~0087003

Would you kindly make patches against trunk version of Lazarus? And create patch from root of Lazarus directory so patches would include relative path.

Do-wan Kim

2015-10-30 00:23

reporter  

grid_no_focus.patch (919 bytes)
Index: lcl/dbgrids.pas
===================================================================
--- lcl/dbgrids.pas	(revision 50199)
+++ lcl/dbgrids.pas	(working copy)
@@ -2537,7 +2537,7 @@
   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);
Index: lcl/grids.pas
===================================================================
--- lcl/grids.pas	(revision 50199)
+++ lcl/grids.pas	(working copy)
@@ -6125,7 +6125,7 @@
   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}
grid_no_focus.patch (919 bytes)

Gabor Boros

2015-10-30 08:39

reporter   ~0087006

I will try create a better solution for next time. Do-wan Kim added a patch against trunk. Thanks for it!

Ondrej Pokorny

2015-11-20 23:29

developer   ~0087435

I commited with a small extension of AutoEdit. Please test.

Gabor Boros

2015-11-21 10:56

reporter   ~0087437

Tested with trunk 50454.

Issue History

Date Modified Username Field Change
2015-10-29 21:38 Gabor Boros New Issue
2015-10-29 21:38 Gabor Boros File Added: grids.diff
2015-10-29 21:38 Gabor Boros File Added: dbgrids.diff
2015-10-30 00:15 Cyrax Note Added: 0087003
2015-10-30 00:23 Do-wan Kim File Added: grid_no_focus.patch
2015-10-30 08:39 Gabor Boros Note Added: 0087006
2015-11-01 19:44 Zeljan Rikalo Assigned To => Jesus Reyes
2015-11-01 19:44 Zeljan Rikalo Status new => assigned
2015-11-20 16:34 Ondrej Pokorny Assigned To Jesus Reyes => Ondrej Pokorny
2015-11-20 23:29 Ondrej Pokorny Fixed in Revision => 50454
2015-11-20 23:29 Ondrej Pokorny LazTarget => -
2015-11-20 23:29 Ondrej Pokorny Note Added: 0087435
2015-11-20 23:29 Ondrej Pokorny Status assigned => resolved
2015-11-20 23:29 Ondrej Pokorny Fixed in Version => 1.6
2015-11-20 23:29 Ondrej Pokorny Resolution open => fixed
2015-11-21 10:56 Gabor Boros Note Added: 0087437
2015-11-21 10:56 Gabor Boros Status resolved => closed