rvico TRichView Reference | Item Types | Table

TRVTableItemInfo.GetSelectionBounds

Top  Previous  Next

Returns selection in table.

function GetSelectionBounds(var StartRow, StartCol, RowOffs, ColOffs: Integer): Boolean;

Output parameters:

Cells[StartRow, StartCol] is a cell where selection is started. Selection always includes this cell.

if RowOffs>0, the selection includes RowOffs rows below. If RowOffs<0, the selection includes abs(RowOffs) rows above.

The same is for ColOffs.

Selection includes all cells intersected with imaginary rectangle that fully includes Cells[StartRow, StartCol] and Cells[StartRow+RowOffs, StartCol+ColOffs]. Warning: these cells can be nil because of merging.

For example, the returned value (3,3,0,0) means that only one cell is selected: Cells[3,3].

Selection can have a rectangular shape or not (because of merging). Some operations are possible only on rectangular selection (for example, cell merging). It can be checked using CanMergeSelectedCells.

This method returns selection as it is stored internally. For practical use, GetNormalizedSelectionBounds is more convenient.

This method must be called when the document is formatted.

Return value:

True, if selection exists, False otherwise.

See also:

Overview of selection in tables.

See also methods:

GetNormalizedSelectionBounds;

Select;

Deselect.


TRichView © trichview.com