LCL/grids: Show sort arrows in header of sorted grid even if the grid does not define columns (issue #33731) -- hopefully correct now...

git-svn-id: trunk@57969 -
This commit is contained in:
wp 2018-05-19 10:17:55 +00:00
parent e533b567d9
commit 835a65e709

View File

@ -1685,6 +1685,7 @@ type
procedure DoCutToClipboard; override;
procedure DoPasteFromClipboard; override;
procedure DoCellProcess(aCol, aRow: Integer; processType: TCellProcessType; var aValue: string); virtual;
procedure DrawColumnText(aCol, aRow: Integer; aRect: TRect; aState: TGridDrawState); override;
procedure DrawTextInCell(aCol,aRow: Integer; aRect: TRect; aState: TGridDrawState); override;
procedure DrawCellAutonumbering(aCol,aRow: Integer; aRect: TRect; const aValue: string); override;
//procedure EditordoGetValue; override;
@ -4117,7 +4118,7 @@ procedure TCustomGrid.DrawColumnText(aCol, aRow: Integer; aRect: TRect;
aState: TGridDrawState);
begin
DrawColumnTitleImage(aRect, aCol);
DrawCellText(aCol,aRow,aRect,aState,GetColumnTitle(aCol));
DrawCellText(aCol,aRow,aRect,aState,GetColumnTitle(aCol))
end;
procedure TCustomGrid.DrawColumnTitleImage(
@ -5287,7 +5288,8 @@ end;
function TCustomGrid.GetIsCellTitle(aCol, aRow: Integer): boolean;
begin
result := (FixedRows>0) and (aRow=0) and Columns.Enabled and (aCol>=FirstGridColumn)
result := (FixedRows>0) and (aRow=0) {and Columns.Enabled} and (aCol>=FirstGridColumn);
// Columns.Enabled removed in order to allow sort arrows also without columns
end;
function TCustomGrid.GetIsCellSelected(aCol, aRow: Integer): boolean;
@ -11197,6 +11199,17 @@ begin
inherited DrawCellAutoNumbering(aCol,aRow,aRect,aValue);
end;
procedure TCustomStringGrid.DrawColumnText(aCol, aRow: Integer; aRect: TRect;
aState: TGridDrawState);
begin
if Columns.Enabled then
inherited
else begin
DrawColumnTitleImage(aRect, aCol);
DrawCellText(aCol,aRow,aRect,aState,Cells[aCol,aRow])
end;
end;
procedure TCustomStringGrid.GetCheckBoxState(const aCol, aRow: Integer;
var aState: TCheckboxState);
var