LCL, grids: added gdSelected in addition to gdfocused, issue #9493

git-svn-id: trunk@11860 -
This commit is contained in:
jesus 2007-08-25 01:34:54 +00:00
parent c01e381286
commit d5c517fad0

View File

@ -2691,10 +2691,15 @@ procedure TCustomGrid.PrepareCanvas(aCol, aRow: Integer; aState: TGridDrawState)
var var
AColor: TColor; AColor: TColor;
CurrentTextStyle: TTextStyle; CurrentTextStyle: TTextStyle;
IsSelected: boolean;
begin begin
if DefaultDrawing then begin if DefaultDrawing then begin
Canvas.Pen.Mode := pmCopy; Canvas.Pen.Mode := pmCopy;
if gdSelected in aState then begin IsSelected := (gdSelected in aState);
if IsSelected and (gdFocused in aState) then
IsSelected := (goDrawFocusSelected in Options) or
((goRowSelect in Options) and not (goRelaxedRowSelect in Options));
if IsSelected then begin
Canvas.Brush.Color := SelectedColor; Canvas.Brush.Color := SelectedColor;
SetCanvasFont(GetColumnFont(aCol, False)); SetCanvasFont(GetColumnFont(aCol, False));
Canvas.Font.Color := clWindow; Canvas.Font.Color := clWindow;
@ -3010,12 +3015,9 @@ begin
if ARow<FFixedRows then if ARow<FFixedRows then
include(gds, gdFixed) include(gds, gdFixed)
else begin else begin
if (aCol=FCol)and(aRow=FRow) then begin if (aCol=FCol)and(aRow=FRow) then
Include(gds, gdFocused); gds := gds + [gdFocused, gdSelected]
if (goDrawFocusSelected in Options) or else
(Rs and not(goRelaxedRowSelect in Options)) then
include(gds, gdSelected);
end else
if IsCellSelected[aCol, aRow] then if IsCellSelected[aCol, aRow] then
include(gds, gdSelected); include(gds, gdSelected);
end; end;