You've already forked lazarus-ccr
fpspreadsheet: Add WorksheetGrid methods Show|HideRow|Col.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7080 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -448,6 +448,11 @@ type
|
||||
const ALeftOuterStyle, ATopOuterStyle, ARightOuterStyle, ABottomOuterStyle,
|
||||
AHorInnerStyle, AVertInnerStyle: TsCellBorderStyle);
|
||||
|
||||
procedure ShowCol(ACol: Integer);
|
||||
procedure HideCol(ACol: Integer);
|
||||
procedure ShowRow(ARow: Integer);
|
||||
procedure HideRow(ARow: Integer);
|
||||
|
||||
procedure Sort(AColSorting: Boolean; AIndex, AIndxFrom, AIndxTo:Integer); override;
|
||||
|
||||
{ Row height / col width calculation }
|
||||
@ -5608,6 +5613,66 @@ begin
|
||||
ProcessBorder(r, c, cbEast, AVertInnerStyle);
|
||||
end;
|
||||
|
||||
{@@ ----------------------------------------------------------------------------
|
||||
Shows the column with the specified index previously hidden.
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure TsCustomWorksheetGrid.ShowCol(ACol: Integer);
|
||||
var
|
||||
c: Cardinal;
|
||||
begin
|
||||
c := GetWorksheetCol(ACol);
|
||||
if Worksheet.ColHidden(c) then begin
|
||||
Worksheet.ShowCol(c);
|
||||
UpdateColWidth(ACol);
|
||||
InvalidateGrid;
|
||||
end;
|
||||
end;
|
||||
|
||||
{@@ ----------------------------------------------------------------------------
|
||||
Hides the column with the specifed index
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure TsCustomWorksheetGrid.HideCol(ACol: Integer);
|
||||
var
|
||||
c: Cardinal;
|
||||
begin
|
||||
c := GetWorksheetCol(ACol);
|
||||
if not Worksheet.ColHidden(c) then begin
|
||||
Worksheet.HideCol(c);
|
||||
UpdateColWidth(ACol);
|
||||
InvalidateGrid;
|
||||
end;
|
||||
end;
|
||||
|
||||
{@@-----------------------------------------------------------------------------
|
||||
Shows the row with the specified index previously hidden
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure TsCustomWorksheetGrid.ShowRow(ARow: Integer);
|
||||
var
|
||||
r: Cardinal;
|
||||
begin
|
||||
r := GetWorksheetRow(ARow);
|
||||
if Worksheet.RowHidden(r) then begin
|
||||
Worksheet.ShowRow(r);
|
||||
UpdateRowHeight(ARow);
|
||||
InvalidateGrid;
|
||||
end;
|
||||
end;
|
||||
|
||||
{@@ ----------------------------------------------------------------------------
|
||||
Hides the row with the specifed index
|
||||
-------------------------------------------------------------------------------}
|
||||
procedure TsCustomWorksheetGrid.HideRow(ARow: Integer);
|
||||
var
|
||||
r: Cardinal;
|
||||
begin
|
||||
r := GetWorksheetRow(ARow);
|
||||
if not Worksheet.RowHidden(r) then begin
|
||||
Worksheet.HideRow(r);
|
||||
UpdateRowHeight(ARow);
|
||||
InvalidateGrid;
|
||||
end;
|
||||
end;
|
||||
|
||||
{@@ ----------------------------------------------------------------------------
|
||||
Sorts the grid by calling the corresponding method of the worksheet.
|
||||
Sorting extends across the entire worksheet.
|
||||
|
Reference in New Issue
Block a user