Sequence of table columns.
| 449 | |
| 450 | |
| 451 | class _ColumnCollection(Subshape): |
| 452 | """Sequence of table columns.""" |
| 453 | |
| 454 | def __init__(self, tbl: CT_Table, parent: Table): |
| 455 | super(_ColumnCollection, self).__init__(parent) |
| 456 | self._parent = parent |
| 457 | self._tbl = tbl |
| 458 | |
| 459 | def __getitem__(self, idx: int): |
| 460 | """Provides indexed access, (e.g. 'columns[0]').""" |
| 461 | if idx < 0 or idx >= len(self._tbl.tblGrid.gridCol_lst): |
| 462 | msg = "column index [%d] out of range" % idx |
| 463 | raise IndexError(msg) |
| 464 | return _Column(self._tbl.tblGrid.gridCol_lst[idx], self) |
| 465 | |
| 466 | def __len__(self): |
| 467 | """Supports len() function (e.g. 'len(columns) == 1').""" |
| 468 | return len(self._tbl.tblGrid.gridCol_lst) |
| 469 | |
| 470 | def notify_width_changed(self): |
| 471 | """Called by a column when its width changes. Pass along to parent.""" |
| 472 | self._parent.notify_width_changed() |
| 473 | |
| 474 | |
| 475 | class _RowCollection(Subshape): |
no outgoing calls
searching dependent graphs…