LCl,Grids: Implements FixedGridLineColor for using with flat grid, modified patch by Malcome, issue #30332

git-svn-id: trunk@52602 -
This commit is contained in:
jesus 2016-07-02 19:25:07 +00:00
parent 86383be1c4
commit 67a56eb60a

View File

@ -721,8 +721,8 @@ type
FOnPrepareCanvas: TOnPrepareCanvasEvent; FOnPrepareCanvas: TOnPrepareCanvasEvent;
FOnSelectEditor: TSelectEditorEvent; FOnSelectEditor: TSelectEditorEvent;
FOnValidateEntry: TValidateEntryEvent; FOnValidateEntry: TValidateEntryEvent;
FGridLineColor: TColor; FGridLineColor, FFixedGridLineColor: TColor;
FFixedcolor, FFixedHotColor, FFocusColor, FSelectedColor: TColor; FFixedColor, FFixedHotColor, FFocusColor, FSelectedColor: TColor;
FFocusRectVisible: boolean; FFocusRectVisible: boolean;
FCols,FRows: TList; FCols,FRows: TList;
FsaveOptions: TSaveOptions; FsaveOptions: TSaveOptions;
@ -857,6 +857,7 @@ type
procedure SetEditor(AValue: TWinControl); procedure SetEditor(AValue: TWinControl);
procedure SetFocusColor(const AValue: TColor); procedure SetFocusColor(const AValue: TColor);
procedure SetGridLineColor(const AValue: TColor); procedure SetGridLineColor(const AValue: TColor);
procedure SetFixedGridLineColor(const AValue: TColor);
procedure SetGridLineStyle(const AValue: TPenStyle); procedure SetGridLineStyle(const AValue: TPenStyle);
procedure SetGridLineWidth(const AValue: Integer); procedure SetGridLineWidth(const AValue: Integer);
procedure SetLeftCol(const AValue: Integer); procedure SetLeftCol(const AValue: Integer);
@ -1136,6 +1137,7 @@ type
property FixedCols: Integer read FFixedCols write SetFixedCols default 1; property FixedCols: Integer read FFixedCols write SetFixedCols default 1;
property FixedRows: Integer read FFixedRows write SetFixedRows default 1; property FixedRows: Integer read FFixedRows write SetFixedRows default 1;
property FixedColor: TColor read GetFixedColor write SetFixedcolor default clBtnFace; property FixedColor: TColor read GetFixedColor write SetFixedcolor default clBtnFace;
property FixedGridLineColor: TColor read FFixedGridLineColor write SetFixedGridLineColor default cl3DDKShadow;
property FixedHotColor: TColor read FFixedHotColor write FFixedHotColor default cl3DLight; property FixedHotColor: TColor read FFixedHotColor write FFixedHotColor default cl3DLight;
property Flat: Boolean read FFlat write SetFlat default false; property Flat: Boolean read FFlat write SetFlat default false;
property FocusColor: TColor read FFocusColor write SetFocusColor; property FocusColor: TColor read FFocusColor write SetFocusColor;
@ -1332,6 +1334,7 @@ type
property ExtendedColSizing; property ExtendedColSizing;
property AltColorStartNormal; property AltColorStartNormal;
property FastEditing; property FastEditing;
property FixedGridLineColor;
property FocusColor; property FocusColor;
property FocusRectVisible; property FocusRectVisible;
property GridHeight; property GridHeight;
@ -2559,6 +2562,13 @@ begin
Invalidate; Invalidate;
end; end;
procedure TCustomGrid.SetFixedGridLineColor(const AValue: TColor);
begin
if FFixedGridLineColor=AValue then exit;
FFixedGridLineColor:=AValue;
Invalidate;
end;
procedure TCustomGrid.SetLeftCol(const AValue: Integer); procedure TCustomGrid.SetLeftCol(const AValue: Integer);
begin begin
TryScrollTo(AValue, FTopLeft.Y, True, False); TryScrollTo(AValue, FTopLeft.Y, True, False);
@ -4261,8 +4271,10 @@ begin
end; end;
end; end;
end; end;
Pen.Color := cl3DDKShadow;
end else begin
Pen.Color := FFixedGridLineColor;
end; end;
Pen.Color := cl3DDKShadow;
end else begin end else begin
Dv := goVertLine in Options; Dv := goVertLine in Options;
Dh := goHorzLine in Options; Dh := goHorzLine in Options;
@ -9028,6 +9040,7 @@ begin
FDefColWidth:=DEFCOLWIDTH; FDefColWidth:=DEFCOLWIDTH;
FDefRowHeight:=GetDefaultRowHeight; FDefRowHeight:=GetDefaultRowHeight;
FGridLineColor:=clSilver; FGridLineColor:=clSilver;
FFixedGridLineColor := cl3DDKShadow;
FGridLineStyle:=psSolid; FGridLineStyle:=psSolid;
FGridLineWidth := 1; FGridLineWidth := 1;
fFocusColor:=clRed; fFocusColor:=clRed;