lib.selection.*¶
Grid selection representation
Provides
Selection
: Represents grid selection independently from PyQt
- class lib.selection.Selection(block_top_left, block_bottom_right, rows, columns, cells)[source]¶
Bases:
object
Represents grid selection
- Parameters:
- cell_generator(shape, table=None)[source]¶
Returns a generator of cell key tuples
- Parameters:
shape – Grid shape
table – Third component of each returned key
- Return type:
If table is None 2-tuples (row, column) are yielded else 3-tuples
- get_bbox()[source]¶
Returns bounding box
A bounding box is the smallest rectangle that contains all selections. Non-specified boundaries are None.
- get_bottom_borders_selection(border_choice, shape)[source]¶
Get selection of cells, for which the bottom border attributes need to be adjusted on border line and border color changes.
- border_choice names are:
“All borders”
“Top border”
“Bottom border”
“Left border”
“Right border”
“Outer borders”
“Inner borders”
“Top and bottom borders”
- get_grid_bbox(shape)[source]¶
Returns bounding box within grid shape limits
A bounding box is the smallest rectangle that contains all selections. Non-specified boundaries are filled i from size.
- get_relative_access_string(shape, current)[source]¶
Get access string relative to current cell
It is assumed that the selected cells are in the same table as the current cell.
- get_right_borders_selection(border_choice, shape)[source]¶
Get selection of cells, for which the right border attributes need to be adjusted on border line and border color changes.
- border_choice names are:
“All borders”
“Top border”
“Bottom border”
“Left border”
“Right border”
“Outer borders”
“Inner borders”
“Top and bottom borders”
- insert(point, number, axis)[source]¶
Inserts number of rows/columns/tables into selection
Insertion takes place at point on axis.
- property parameters: Tuple[List[Tuple[int, int]], List[Tuple[int, int]], List[int], List[int], List[Tuple[int, int]]]¶
Tuple of selection parameters of self (self.block_tl, self.block_br, self.rows, self.columns,
self.cells)
- Type:
return