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:
wp_xxyyzz
2019-07-27 20:42:54 +00:00
parent d9a8c87eef
commit 10a21f6ba9

View File

@ -448,6 +448,11 @@ type
const ALeftOuterStyle, ATopOuterStyle, ARightOuterStyle, ABottomOuterStyle, const ALeftOuterStyle, ATopOuterStyle, ARightOuterStyle, ABottomOuterStyle,
AHorInnerStyle, AVertInnerStyle: TsCellBorderStyle); 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; procedure Sort(AColSorting: Boolean; AIndex, AIndxFrom, AIndxTo:Integer); override;
{ Row height / col width calculation } { Row height / col width calculation }
@ -5608,6 +5613,66 @@ begin
ProcessBorder(r, c, cbEast, AVertInnerStyle); ProcessBorder(r, c, cbEast, AVertInnerStyle);
end; 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. Sorts the grid by calling the corresponding method of the worksheet.
Sorting extends across the entire worksheet. Sorting extends across the entire worksheet.