TableListBox Class Reference

A table of cells, using a TableHeaderComponent as its header. More...

Inherits ListBox, ListBoxModel, and TableHeaderListener.

List of all members.

Public Member Functions

 TableListBox (const String &componentName, TableListBoxModel *model)
 Creates a TableListBox.
 ~TableListBox ()
 Destructor.
void setModel (TableListBoxModel *newModel)
 Changes the TableListBoxModel that is being used for this table.
TableListBoxModelgetModel () const
 Returns the model currently in use.
TableHeaderComponentgetHeader () const
 Returns the header component being used in this 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.
const Rectangle< int > getCellPosition (int columnId, int rowNumber, bool relativeToComponentTopLeft) const
 Returns the position of one of the cells in the table.
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)
ComponentrefreshComponentForRow (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 ()

Detailed Description

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.

See also:
TableListBoxModel, TableHeaderComponent

Constructor & Destructor Documentation

TableListBox::TableListBox ( const String componentName,
TableListBoxModel model 
)

Creates a TableListBox.

The model pointer passed-in can be null, in which case you can set it later with setModel().

TableListBox::~TableListBox (  ) 

Destructor.


Member Function Documentation

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::setHeaderHeight ( int  newHeight  ) 

Changes the height of the table header component.

See also:
getHeaderHeight
int TableListBox::getHeaderHeight (  )  const

Returns the height of the table header.

See also:
setHeaderHeight
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.

See also:
autoSizeAllColumns, TableHeaderComponent::setColumnWidth
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.

See also:
setAutoSizeMenuOptionsShown
const 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.

void TableListBox::scrollToEnsureColumnIsOnscreen ( int  columnId  ) 

Scrolls horizontally if necessary to make sure that a particular column is visible.

See also:
ListBox::scrollToEnsureRowIsOnscreen
int TableListBox::getNumRows (  )  [virtual]

For internal use only.

Implements ListBoxModel.

void TableListBox::paintListBoxItem ( int  ,
Graphics ,
int  ,
int  ,
bool   
) [virtual]

For internal use only.

Implements ListBoxModel.

Component* TableListBox::refreshComponentForRow ( int  rowNumber,
bool  isRowSelected,
Component existingComponentToUpdate 
) [virtual]

For internal use only.

Reimplemented from ListBoxModel.

void TableListBox::selectedRowsChanged ( int  lastRowSelected  )  [virtual]

For internal use only.

Reimplemented from ListBoxModel.

void TableListBox::deleteKeyPressed ( int  currentSelectedRow  )  [virtual]

For internal use only.

Reimplemented from ListBoxModel.

void TableListBox::returnKeyPressed ( int  currentSelectedRow  )  [virtual]

For internal use only.

Reimplemented from ListBoxModel.

void TableListBox::backgroundClicked (  )  [virtual]

For internal use only.

Reimplemented from ListBoxModel.

void TableListBox::listWasScrolled (  )  [virtual]

For internal use only.

Reimplemented from ListBoxModel.

void TableListBox::tableColumnsChanged ( TableHeaderComponent  )  [virtual]

For internal use only.

Implements TableHeaderListener.

void TableListBox::tableColumnsResized ( TableHeaderComponent  )  [virtual]

For internal use only.

Implements TableHeaderListener.

void TableListBox::tableSortOrderChanged ( TableHeaderComponent  )  [virtual]

For internal use only.

Implements TableHeaderListener.

void TableListBox::tableColumnDraggingChanged ( TableHeaderComponent ,
int   
) [virtual]

For internal use only.

Reimplemented from TableHeaderListener.

void TableListBox::resized (  )  [virtual]

For internal use only.

Reimplemented from ListBox.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Mon Apr 26 11:42:18 2010 for JUCE by  doxygen 1.6.3