LCL/grids: Undo commits r57960 #7ea1e8cd31 and 57963

git-svn-id: trunk@57964 -
This commit is contained in:
wp 2018-05-18 22:22:59 +00:00
parent 0c2a0ee826
commit a47fa2b041

View File

@ -120,8 +120,7 @@ type
TGridOption2 = ( TGridOption2 = (
goScrollToLastCol, // allow scrolling to last column (so that last column can be leftcol) goScrollToLastCol, // allow scrolling to last column (so that last column can be leftcol)
goScrollToLastRow, // allow scrolling to last row (so that last row can be toprow) goScrollToLastRow // allow scrolling to last row (so that last row can be toprow)
goShowSortArrows // show arrows in header when column is sorted
); );
TGridOptions2 = set of TGridOption2; TGridOptions2 = set of TGridOption2;
@ -4117,6 +4116,7 @@ end;
procedure TCustomGrid.DrawColumnText(aCol, aRow: Integer; aRect: TRect; procedure TCustomGrid.DrawColumnText(aCol, aRow: Integer; aRect: TRect;
aState: TGridDrawState); aState: TGridDrawState);
begin begin
DrawColumnTitleImage(aRect, aCol);
DrawCellText(aCol,aRow,aRect,aState,GetColumnTitle(aCol)); DrawCellText(aCol,aRow,aRect,aState,GetColumnTitle(aCol));
end; end;
@ -4133,7 +4133,7 @@ var
Details: TThemedElementDetails; Details: TThemedElementDetails;
NativeSortGlyphs: Boolean; NativeSortGlyphs: Boolean;
begin begin
if (FSortColumn = AColumnIndex) and (goShowSortArrows in FOptions2) then if FSortColumn = AColumnIndex then
begin begin
GetSortTitleImageInfo(AColumnIndex, ImgList, ImgIndex, ImgListWidth, NativeSortGlyphs); GetSortTitleImageInfo(AColumnIndex, ImgList, ImgIndex, ImgListWidth, NativeSortGlyphs);
if NativeSortGlyphs then// draw native sort buttons if NativeSortGlyphs then// draw native sort buttons
@ -4492,13 +4492,6 @@ begin
tlBottom: Dec(ARect.Bottom, varCellPadding); tlBottom: Dec(ARect.Bottom, varCellPadding);
end; end;
if (gdFixed in aState) and (FSortColumn = aCol) and
(goShowSortArrows in FOptions2) then
begin
DrawColumnTitleImage(aRect, FSortColumn);
dec(ARect.Right, 2*varCellPadding);
end;
if ARect.Right<ARect.Left then if ARect.Right<ARect.Left then
ARect.Right:=ARect.Left; ARect.Right:=ARect.Left;
if ARect.Left>ARect.Right then if ARect.Left>ARect.Right then
@ -9265,7 +9258,6 @@ begin
Cfg.SetValue(Path+'goRowHighlight/value', goRowHighlight in Options); Cfg.SetValue(Path+'goRowHighlight/value', goRowHighlight in Options);
Cfg.SetValue(Path+'goScrollToLastCol/value', goScrollToLastCol in Options2); Cfg.SetValue(Path+'goScrollToLastCol/value', goScrollToLastCol in Options2);
Cfg.SetValue(Path+'goScrollToLastRow/value', goScrollToLastRow in Options2); Cfg.SetValue(Path+'goScrollToLastRow/value', goScrollToLastRow in Options2);
Cfg.SetValue(Path+'goShowSortArrows/value', goShowSortArrows in Options2);
end; end;
procedure TCustomGrid.LoadColumns(cfg: TXMLConfig; Version: integer); procedure TCustomGrid.LoadColumns(cfg: TXMLConfig; Version: integer);
@ -9462,7 +9454,6 @@ begin
end; end;
GetValue2('goScrollToLastRow',goScrollToLastRow); GetValue2('goScrollToLastRow',goScrollToLastRow);
GetValue2('goScrollToLastCol',goScrollToLastCol); GetValue2('goScrollToLastCol',goScrollToLastCol);
GetValue2('goShowSortArrows',goShowSortArrows);
Options:=Opt; Options:=Opt;
Options2:=Opt2; Options2:=Opt2;
@ -9505,8 +9496,9 @@ begin
FAutoEdit := True; FAutoEdit := True;
FFocusRectVisible := True; FFocusRectVisible := True;
FDefaultDrawing := True; FDefaultDrawing := True;
FOptions := DefaultGridOptions; FOptions:=
FOptions2 := DefaultGridOptions2; [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect,
goSmoothScroll ];
FScrollbars:=ssAutoBoth; FScrollbars:=ssAutoBoth;
fGridState:=gsNormal; fGridState:=gsNormal;
FDefColWidth:=-1; FDefColWidth:=-1;