wx.grid.GridStringTable¶Simplest type of data table for a grid for small tables of strings that are stored in memory.
Methods Summary¶__init__ |
|
AppendCols |
Exactly the same as AppendRows but for columns. |
AppendRows |
Append additional rows at the end of the table. |
Clear |
Clear the table contents. |
DeleteCols |
Exactly the same as DeleteRows but for columns. |
DeleteRows |
Delete rows from the table. |
GetColLabelValue |
Return the label of the specified column. |
GetNumberCols |
Must be overridden to return the number of columns in the table. |
GetNumberRows |
Must be overridden to return the number of rows in the table. |
GetRowLabelValue |
Return the label of the specified row. |
GetValue |
Must be overridden to implement accessing the table values as text. |
InsertCols |
Exactly the same as InsertRows but for columns. |
InsertRows |
Insert additional rows into the table. |
SetColLabelValue |
Exactly the same as SetRowLabelValue but for columns. |
SetRowLabelValue |
Set the given label for the specified row. |
SetValue |
Must be overridden to implement setting the table values as text. |
Class API¶wx.grid.GridStringTable(GridTableBase)¶Possible constructors:
GridStringTable()
GridStringTable(numRows, numCols)
Simplest type of data table for a grid for small tables of strings that are stored in memory.
__init__(self, *args, **kw)¶__init__ (self)
__init__ (self, numRows, numCols)
| Parameters: |
|
|---|
AppendCols(self, numCols=1)¶Exactly the same as AppendRows but for columns.
| Parameters: | numCols (int) – |
|---|---|
| Return type: | bool |
AppendRows(self, numRows=1)¶Append additional rows at the end of the table.
This method is provided in addition to InsertRows as some data models may only support appending rows to them but not inserting them at arbitrary locations. In such case you may implement this method only and leave InsertRows unimplemented.
| Parameters: | numRows (int) – The number of rows to add. |
|---|---|
| Return type: | bool |
Clear(self)¶Clear the table contents.
This method is used by wx.grid.Grid.ClearGrid .
DeleteCols(self, pos=0, numCols=1)¶Exactly the same as DeleteRows but for columns.
| Parameters: |
|
|---|---|
| Return type: | bool |
DeleteRows(self, pos=0, numRows=1)¶Delete rows from the table.
Notice that currently deleting a row intersecting a multi-cell (see SetCellSize()) is not supported and will result in a crash.
| Parameters: |
|
|---|---|
| Return type: | bool |
GetColLabelValue(self, col)¶Return the label of the specified column.
| Parameters: | col (int) – |
|---|---|
| Return type: | string |
GetNumberCols(self)¶Must be overridden to return the number of columns in the table.
For backwards compatibility reasons, this method is not const. Use GetColsCount instead of it in methods of derived table classes,
| Return type: | int |
|---|
GetNumberRows(self)¶Must be overridden to return the number of rows in the table.
For backwards compatibility reasons, this method is not const. Use GetRowsCount instead of it in methods of derived table classes.
| Return type: | int |
|---|
GetRowLabelValue(self, row)¶Return the label of the specified row.
| Parameters: | row (int) – |
|---|---|
| Return type: | string |
GetValue(self, row, col)¶Must be overridden to implement accessing the table values as text.
| Parameters: |
|
|---|---|
| Return type: |
|
InsertCols(self, pos=0, numCols=1)¶Exactly the same as InsertRows but for columns.
| Parameters: |
|
|---|---|
| Return type: | bool |
InsertRows(self, pos=0, numRows=1)¶Insert additional rows into the table.
| Parameters: |
|
|---|---|
| Return type: | bool |
SetColLabelValue(self, col, label)¶Exactly the same as SetRowLabelValue but for columns.
| Parameters: |
|
|---|
SetRowLabelValue(self, row, label)¶Set the given label for the specified row.
The default version does nothing, i.e. the label is not stored. You must override this method in your derived class if you wish wx.grid.Grid.SetRowLabelValue to work.
| Parameters: |
|
|---|
SetValue(self, row, col, value)¶Must be overridden to implement setting the table values as text.
| Parameters: |
|
|---|
NumberCols¶See GetNumberCols
NumberRows¶See GetNumberRows