=============== Table (hwx.gui) =============== A Table widget used to display/edit a list of list of values. Inherits: - :ref:`Widget (hwx.gui)` ---------- Properties ---------- +---------------+---------------+---------------+ | columnLabels_ | numCols_ | numRows_ | +---------------+---------------+---------------+ | readOnly_ | rowLabels_ | | +---------------+---------------+---------------+ -------------- Public Methods -------------- +--------------------------------------------------------------------+ | addRow_ (self, *values) | +--------------------------------------------------------------------+ | clearSelection_ (self) | +--------------------------------------------------------------------+ | getColumnWidth_ (self, col='all') | +--------------------------------------------------------------------+ | getRowHeight_ (self, row='all') | +--------------------------------------------------------------------+ | getSelectedRows_ (self) | +--------------------------------------------------------------------+ | getValue_ (self, row, col) | +--------------------------------------------------------------------+ | isSelected_ (self, row, col) | +--------------------------------------------------------------------+ | selectCells_ (self, row='all', col='all', select=True, clear=True) | +--------------------------------------------------------------------+ | selectRow_ (self, row, clear=True) | +--------------------------------------------------------------------+ | setColumnWidth_ (self, width, col='all') | +--------------------------------------------------------------------+ | setRowHeight_ (self, height=20, row='all') | +--------------------------------------------------------------------+ | setValues_ (self, values, rowOrder=False) | +--------------------------------------------------------------------+ | unselectCells_ (self, row='all', col='all') | +--------------------------------------------------------------------+ ---------------- Property Details ---------------- .. _columnLabels: .. method:: columnLabels The text in the column headers. .. _numCols: .. method:: numCols The number of columns in the table. .. _numRows: .. method:: numRows The number of rows in the table. .. _readOnly: .. method:: readOnly Determines whether the cells are readonly or not. .. _rowLabels: .. method:: rowLabels Text in the row headers. -------------- Method Details -------------- .. _addRow: .. method:: addRow(self, *values) Appends a row of values. :param values: The values to be set in row of the table :type values: list[list[str]] .. _clearSelection: .. method:: clearSelection(self) Unselects all cells. .. _getColumnWidth: .. method:: getColumnWidth(self, col='all') Gets the width of the column. :param col: The indices of columns. Defaults to "all". :type col: str, list[int] :returns: The width of the column. :rtype: int .. _getRowHeight: .. method:: getRowHeight(self, row='all') Gets the row height. :param row: A list of indices of rows. Defaults to "all". :type row: str, list[str] .. _getSelectedRows: .. method:: getSelectedRows(self) Returns a list of row indicies for all rows that are selected. .. _getValue: .. method:: getValue(self, row, col) Gets the value from the specified row and column. :param row: The row index of the table. :type row: int :param col: The column index of the table. :type col: int :returns: The text at the specified row and column. :rtype: str .. _isSelected: .. method:: isSelected(self, row, col) Returns True if the specified cell is selected, False otherwise. :param row: The index of row. :type row: int :param col: The index of col. :type col: int .. _selectCells: .. method:: selectCells(self, row='all', col='all', select=True, clear=True) Selects the specified cells. :param row: The indices of rows. Defaults to "all". :type row: Union[str, list[int]], optional :param col: The indices of columns. Defaults to "all". :type col: Union[str, list[int]], optional :param select: Determines whether the specified cells will be selected. Defaults to True. :type select: bool, optional :param clear: Determines whether the previously selected will be cleared. Defaults to True. :type clear: bool, optional .. _selectRow: .. method:: selectRow(self, row, clear=True) Selects all cells of a row and ensures the row is visible. :param row: The row to be selected. :type row: int :param clear: Determines whether the previously selected will be cleared. Defaults to True. :type clear: bool .. _setColumnWidth: .. method:: setColumnWidth(self, width, col='all') Sets the column width. :param width: The width the column. :type width: int :param col: The indices of columns. Defaults to "all". :type col: str, list[str] .. _setRowHeight: .. method:: setRowHeight(self, height=20, row='all') Sets specific row height. :param height: height to set the rows. Defaults to 20. :type height: int :param row: A list of indices of rows. Defaults to "all". :type row: str, list[int] .. _setValues: .. method:: setValues(self, values, rowOrder=False) Sets the cell text from the list of list of values. :param values: The values to be set in cell of the table :type values: list[list[str]] :param rowOrder: Determines if values will be transposed. Defaults to False. :type rowOrder: bool .. _unselectCells: .. method:: unselectCells(self, row='all', col='all') Deselects the specified cells. :param row: The indices of rows. Defaults to "all". :type row: Union[str, list[int]], optional :param col: The indices of columns. Defaults to "all". :type col: Union[str, list[int]], optional