A table of cells, using a TableHeaderComponent as its header. More...
Inherits ListBox, ListBoxModel, and TableHeaderComponent::Listener.
Public Member Functions | |
| TableListBox (const String &componentName=String::empty, TableListBoxModel *model=0) | |
| Creates a TableListBox. | |
| ~TableListBox () | |
| Destructor. | |
| void | setModel (TableListBoxModel *newModel) |
| Changes the TableListBoxModel that is being used for this table. | |
| TableListBoxModel * | getModel () const |
| Returns the model currently in use. | |
| TableHeaderComponent & | getHeader () const |
| Returns the header component being used in this table. | |
| void | setHeader (TableHeaderComponent *newHeader) |
| Sets the header component to use for the table. | |
| void | setHeaderHeight (int newHeight) |
| Changes the height of the table header component. | |
| int | getHeaderHeight () const |
| Returns the height of the table header. | |
| void | autoSizeColumn (int columnId) |
| Resizes a column to fit its contents. | |
| void | autoSizeAllColumns () |
| Calls autoSizeColumn() for all columns in the table. | |
| void | setAutoSizeMenuOptionShown (bool shouldBeShown) |
| Enables or disables the auto size options on the popup menu. | |
| bool | isAutoSizeMenuOptionShown () const |
| True if the auto-size options should be shown on the menu. | |
| Rectangle< int > | getCellPosition (int columnId, int rowNumber, bool relativeToComponentTopLeft) const |
| Returns the position of one of the cells in the table. | |
| Component * | getCellComponent (int columnId, int rowNumber) const |
| Returns the component that currently represents a given cell. | |
| void | scrollToEnsureColumnIsOnscreen (int columnId) |
| Scrolls horizontally if necessary to make sure that a particular column is visible. | |
| int | getNumRows () |
| void | paintListBoxItem (int, Graphics &, int, int, bool) |
| Component * | refreshComponentForRow (int rowNumber, bool isRowSelected, Component *existingComponentToUpdate) |
| void | selectedRowsChanged (int lastRowSelected) |
| void | deleteKeyPressed (int currentSelectedRow) |
| void | returnKeyPressed (int currentSelectedRow) |
| void | backgroundClicked () |
| void | listWasScrolled () |
| void | tableColumnsChanged (TableHeaderComponent *) |
| void | tableColumnsResized (TableHeaderComponent *) |
| void | tableSortOrderChanged (TableHeaderComponent *) |
| void | tableColumnDraggingChanged (TableHeaderComponent *, int) |
| void | resized () |
A table of cells, using a TableHeaderComponent as its header.
This component makes it easy to create a table by providing a TableListBoxModel as the data source.
| TableListBox::TableListBox | ( | const String & | componentName = String::empty, |
| TableListBoxModel * | model = 0 |
||
| ) |
Creates a TableListBox.
The model pointer passed-in can be null, in which case you can set it later with setModel().
Destructor.
| void TableListBox::setModel | ( | TableListBoxModel * | newModel | ) |
Changes the TableListBoxModel that is being used for this table.
| TableListBoxModel* TableListBox::getModel | ( | ) | const |
Returns the model currently in use.
Reimplemented from ListBox.
| TableHeaderComponent& TableListBox::getHeader | ( | ) | const |
Returns the header component being used in this table.
| void TableListBox::setHeader | ( | TableHeaderComponent * | newHeader | ) |
Sets the header component to use for the table.
The table will take ownership of the component that you pass in, and will delete it when it's no longer needed.
| void TableListBox::setHeaderHeight | ( | int | newHeight | ) |
Changes the height of the table header component.
| int TableListBox::getHeaderHeight | ( | ) | const |
Returns the height of the table header.
| void TableListBox::autoSizeColumn | ( | int | columnId | ) |
Resizes a column to fit its contents.
This uses TableListBoxModel::getColumnAutoSizeWidth() to find the best width, and applies that to the column.
| void TableListBox::autoSizeAllColumns | ( | ) |
Calls autoSizeColumn() for all columns in the table.
| void TableListBox::setAutoSizeMenuOptionShown | ( | bool | shouldBeShown | ) |
Enables or disables the auto size options on the popup menu.
By default, these are enabled.
| bool TableListBox::isAutoSizeMenuOptionShown | ( | ) | const |
True if the auto-size options should be shown on the menu.
| Rectangle<int> TableListBox::getCellPosition | ( | int | columnId, |
| int | rowNumber, | ||
| bool | relativeToComponentTopLeft | ||
| ) | const |
Returns the position of one of the cells in the table.
If relativeToComponentTopLeft is true, the co-ordinates are relative to the table component's top-left. The row number isn't checked to see if it's in-range, but the column ID must exist or this will return an empty rectangle.
If relativeToComponentTopLeft is false, the co-ords are relative to the top-left of the table's top-left cell.
| Component* TableListBox::getCellComponent | ( | int | columnId, |
| int | rowNumber | ||
| ) | const |
Returns the component that currently represents a given cell.
If the component for this cell is off-screen or if the position is out-of-range, this may return 0.
| void TableListBox::scrollToEnsureColumnIsOnscreen | ( | int | columnId | ) |
Scrolls horizontally if necessary to make sure that a particular column is visible.
| int TableListBox::getNumRows | ( | ) | [virtual] |
Implements ListBoxModel.
| void TableListBox::paintListBoxItem | ( | int | , |
| Graphics & | , | ||
| int | , | ||
| int | , | ||
| bool | |||
| ) | [virtual] |
Implements ListBoxModel.
| Component* TableListBox::refreshComponentForRow | ( | int | rowNumber, |
| bool | isRowSelected, | ||
| Component * | existingComponentToUpdate | ||
| ) | [virtual] |
Reimplemented from ListBoxModel.
| void TableListBox::selectedRowsChanged | ( | int | lastRowSelected | ) | [virtual] |
Reimplemented from ListBoxModel.
| void TableListBox::deleteKeyPressed | ( | int | currentSelectedRow | ) | [virtual] |
Reimplemented from ListBoxModel.
| void TableListBox::returnKeyPressed | ( | int | currentSelectedRow | ) | [virtual] |
Reimplemented from ListBoxModel.
| void TableListBox::backgroundClicked | ( | ) | [virtual] |
Reimplemented from ListBoxModel.
| void TableListBox::listWasScrolled | ( | ) | [virtual] |
Reimplemented from ListBoxModel.
| void TableListBox::tableColumnsChanged | ( | TableHeaderComponent * | ) | [virtual] |
Implements TableHeaderComponent::Listener.
| void TableListBox::tableColumnsResized | ( | TableHeaderComponent * | ) | [virtual] |
Implements TableHeaderComponent::Listener.
| void TableListBox::tableSortOrderChanged | ( | TableHeaderComponent * | ) | [virtual] |
Implements TableHeaderComponent::Listener.
| void TableListBox::tableColumnDraggingChanged | ( | TableHeaderComponent * | , |
| int | |||
| ) | [virtual] |
Reimplemented from TableHeaderComponent::Listener.
| void TableListBox::resized | ( | ) | [virtual] |
Reimplemented from ListBox.