View Issue Details

IDProjectCategoryView StatusLast Update
0030332LazarusLCLpublic2016-07-03 00:00
ReportermalcomeAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version1.7 (SVN)Product Build 
Target Version1.8Fixed in Version1.7 (SVN) 
Summary0030332: Add FixedGridLineColor property to TCustomGrid
DescriptionI added FixedGridLineColor property to TCustomGrid
and created a patch.
TagsNo tags attached.
Fixed in Revision52602
LazTarget1.8
Widgetset
Attached Files
  • grids.pas.patch (2,495 bytes)
    Index: lcl/grids.pas
    ===================================================================
    --- lcl/grids.pas	(revision 52590)
    +++ lcl/grids.pas	(working copy)
    @@ -721,8 +721,8 @@
         FOnPrepareCanvas: TOnPrepareCanvasEvent;
         FOnSelectEditor: TSelectEditorEvent;
         FOnValidateEntry: TValidateEntryEvent;
    -    FGridLineColor: TColor;
    -    FFixedcolor, FFixedHotColor, FFocusColor, FSelectedColor: TColor;
    +    FGridLineColor, FFixedGridLineColor: TColor;
    +    FFixedColor, FFixedHotColor, FFocusColor, FSelectedColor: TColor;
         FFocusRectVisible: boolean;
         FCols,FRows: TList;
         FsaveOptions: TSaveOptions;
    @@ -857,6 +857,7 @@
         procedure SetEditor(AValue: TWinControl);
         procedure SetFocusColor(const AValue: TColor);
         procedure SetGridLineColor(const AValue: TColor);
    +    procedure SetFixedGridLineColor(const AValue: TColor);
         procedure SetGridLineStyle(const AValue: TPenStyle);
         procedure SetGridLineWidth(const AValue: Integer);
         procedure SetLeftCol(const AValue: Integer);
    @@ -1144,6 +1145,7 @@
         property GridFlags: TGridFlags read FGridFlags write FGridFlags;
         property GridHeight: Integer read FGCache.GridHeight;
         property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clSilver;
    +    property FixedGridLineColor: TColor read FFixedGridLineColor write SetFixedGridLineColor default cl3DDKShadow;
         property GridLineStyle: TPenStyle read FGridLineStyle write SetGridLineStyle;
         property GridLineWidth: Integer read FGridLineWidth write SetGridLineWidth default 1;
         property GridWidth: Integer read FGCache.GridWidth;
    @@ -1336,6 +1338,7 @@
         property FocusRectVisible;
         property GridHeight;
         property GridLineColor;
    +    property FixedGridLineColor;
         property GridLineStyle;
         property GridWidth;
         property IsCellSelected;
    @@ -2559,6 +2562,13 @@
       Invalidate;
     end;
     
    +procedure TCustomGrid.SetFixedGridLineColor(const AValue: TColor);
    +begin
    +  if FFixedGridLineColor=AValue then exit;
    +  FFixedGridLineColor:=AValue;
    +  Invalidate;
    +end;
    +
     procedure TCustomGrid.SetLeftCol(const AValue: Integer);
     begin
       TryScrollTo(AValue, FTopLeft.Y, True, False);
    @@ -4261,8 +4271,10 @@
                 end;
               end;
             end;
    +        Pen.Color := cl3DDKShadow;
    +      end else begin
    +        Pen.Color := FFixedGridLineColor;
           end;
    -      Pen.Color := cl3DDKShadow;
         end else begin
           Dv := goVertLine in Options;
           Dh := goHorzLine in Options;
    
    grids.pas.patch (2,495 bytes)

Activities

malcome

2016-07-01 04:48

reporter  

grids.pas.patch (2,495 bytes)
Index: lcl/grids.pas
===================================================================
--- lcl/grids.pas	(revision 52590)
+++ lcl/grids.pas	(working copy)
@@ -721,8 +721,8 @@
     FOnPrepareCanvas: TOnPrepareCanvasEvent;
     FOnSelectEditor: TSelectEditorEvent;
     FOnValidateEntry: TValidateEntryEvent;
-    FGridLineColor: TColor;
-    FFixedcolor, FFixedHotColor, FFocusColor, FSelectedColor: TColor;
+    FGridLineColor, FFixedGridLineColor: TColor;
+    FFixedColor, FFixedHotColor, FFocusColor, FSelectedColor: TColor;
     FFocusRectVisible: boolean;
     FCols,FRows: TList;
     FsaveOptions: TSaveOptions;
@@ -857,6 +857,7 @@
     procedure SetEditor(AValue: TWinControl);
     procedure SetFocusColor(const AValue: TColor);
     procedure SetGridLineColor(const AValue: TColor);
+    procedure SetFixedGridLineColor(const AValue: TColor);
     procedure SetGridLineStyle(const AValue: TPenStyle);
     procedure SetGridLineWidth(const AValue: Integer);
     procedure SetLeftCol(const AValue: Integer);
@@ -1144,6 +1145,7 @@
     property GridFlags: TGridFlags read FGridFlags write FGridFlags;
     property GridHeight: Integer read FGCache.GridHeight;
     property GridLineColor: TColor read FGridLineColor write SetGridLineColor default clSilver;
+    property FixedGridLineColor: TColor read FFixedGridLineColor write SetFixedGridLineColor default cl3DDKShadow;
     property GridLineStyle: TPenStyle read FGridLineStyle write SetGridLineStyle;
     property GridLineWidth: Integer read FGridLineWidth write SetGridLineWidth default 1;
     property GridWidth: Integer read FGCache.GridWidth;
@@ -1336,6 +1338,7 @@
     property FocusRectVisible;
     property GridHeight;
     property GridLineColor;
+    property FixedGridLineColor;
     property GridLineStyle;
     property GridWidth;
     property IsCellSelected;
@@ -2559,6 +2562,13 @@
   Invalidate;
 end;
 
+procedure TCustomGrid.SetFixedGridLineColor(const AValue: TColor);
+begin
+  if FFixedGridLineColor=AValue then exit;
+  FFixedGridLineColor:=AValue;
+  Invalidate;
+end;
+
 procedure TCustomGrid.SetLeftCol(const AValue: Integer);
 begin
   TryScrollTo(AValue, FTopLeft.Y, True, False);
@@ -4261,8 +4271,10 @@
             end;
           end;
         end;
+        Pen.Color := cl3DDKShadow;
+      end else begin
+        Pen.Color := FFixedGridLineColor;
       end;
-      Pen.Color := cl3DDKShadow;
     end else begin
       Dv := goVertLine in Options;
       Dh := goHorzLine in Options;
grids.pas.patch (2,495 bytes)

Jesus Reyes

2016-07-02 21:28

developer   ~0093488

Thanks, applied with a small modification: properties declared with default values must be initialized with the same value in order for them to not be streamed by default into the lfm file.

malcome

2016-07-03 00:00

reporter   ~0093492

Thanks!

Issue History

Date Modified Username Field Change
2016-07-01 04:48 malcome New Issue
2016-07-01 04:48 malcome File Added: grids.pas.patch
2016-07-02 20:19 Jesus Reyes Assigned To => Jesus Reyes
2016-07-02 20:19 Jesus Reyes Status new => assigned
2016-07-02 21:28 Jesus Reyes Fixed in Revision => 52602
2016-07-02 21:28 Jesus Reyes LazTarget => 1.8
2016-07-02 21:28 Jesus Reyes Note Added: 0093488
2016-07-02 21:28 Jesus Reyes Status assigned => resolved
2016-07-02 21:28 Jesus Reyes Fixed in Version => 1.7 (SVN)
2016-07-02 21:28 Jesus Reyes Resolution open => fixed
2016-07-02 21:28 Jesus Reyes Target Version => 1.8
2016-07-03 00:00 malcome Note Added: 0093492
2016-07-03 00:00 malcome Status resolved => closed