openshot-audio  0.1.7
Classes | Public Member Functions | List of all members
TableListBox Class Reference

#include <juce_TableListBox.h>

Inheritance diagram for TableListBox:
TableHeaderComponent::Listener

Classes

class  Header
 
class  RowComp
 

Public Member Functions

 TableListBox (const String &componentName=String(), TableListBoxModel *model=nullptr)
 
 ~TableListBox ()
 
void setModel (TableListBoxModel *newModel)
 
TableListBoxModelgetModel () const noexcept
 
TableHeaderComponentgetHeader () const noexcept
 
void setHeader (TableHeaderComponent *newHeader)
 
void setHeaderHeight (int newHeight)
 
int getHeaderHeight () const noexcept
 
void autoSizeColumn (int columnId)
 
void autoSizeAllColumns ()
 
void setAutoSizeMenuOptionShown (bool shouldBeShown) noexcept
 
bool isAutoSizeMenuOptionShown () const noexcept
 
Rectangle< intgetCellPosition (int columnId, int rowNumber, bool relativeToComponentTopLeft) const
 
ComponentgetCellComponent (int columnId, int rowNumber) const
 
void scrollToEnsureColumnIsOnscreen (int columnId)
 
int getNumRows () override
 
void paintListBoxItem (int, Graphics &, int, int, bool) override
 
ComponentrefreshComponentForRow (int rowNumber, bool isRowSelected, Component *existingComponentToUpdate) override
 
void selectedRowsChanged (int lastRowSelected) override
 
void deleteKeyPressed (int currentSelectedRow) override
 
void returnKeyPressed (int currentSelectedRow) override
 
void backgroundClicked (const MouseEvent &) override
 
void listWasScrolled () override
 
void tableColumnsChanged (TableHeaderComponent *) override
 
void tableColumnsResized (TableHeaderComponent *) override
 
void tableSortOrderChanged (TableHeaderComponent *) override
 
void tableColumnDraggingChanged (TableHeaderComponent *, int) override
 
void resized () override
 

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 = String(),
TableListBoxModel model = nullptr 
)

Creates a TableListBox.

The model pointer passed-in can be null, in which case you can set it later with setModel(). The TableListBox does not take ownership of the model - it's the caller's responsibility to manage its lifetime and make sure it doesn't get deleted while still being used.

TableListBox::~TableListBox ( )

Destructor.

Member Function Documentation

void TableListBox::autoSizeAllColumns ( )

Calls autoSizeColumn() for all columns in the table.

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::backgroundClicked ( const MouseEvent e)
override
void TableListBox::deleteKeyPressed ( int  currentSelectedRow)
override
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 nullptr.

See Also
getCellPosition
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 coordinates 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 coordinates are relative to the top-left of the table's top-left cell.

TableHeaderComponent& TableListBox::getHeader ( ) const
inlinenoexcept

Returns the header component being used in this table.

int TableListBox::getHeaderHeight ( ) const
noexcept

Returns the height of the table header.

See Also
setHeaderHeight
TableListBoxModel* TableListBox::getModel ( ) const
inlinenoexcept

Returns the model currently in use.

int TableListBox::getNumRows ( )
override
bool TableListBox::isAutoSizeMenuOptionShown ( ) const
inlinenoexcept

True if the auto-size options should be shown on the menu.

See Also
setAutoSizeMenuOptionShown
void TableListBox::listWasScrolled ( )
override
void TableListBox::paintListBoxItem ( int  ,
Graphics ,
int  ,
int  ,
bool   
)
override
Component * TableListBox::refreshComponentForRow ( int  rowNumber,
bool  isRowSelected,
Component existingComponentToUpdate 
)
override
void TableListBox::resized ( )
override
void TableListBox::returnKeyPressed ( int  currentSelectedRow)
override
void TableListBox::scrollToEnsureColumnIsOnscreen ( int  columnId)

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

See Also
ListBox::scrollToEnsureRowIsOnscreen
void TableListBox::selectedRowsChanged ( int  lastRowSelected)
override
void TableListBox::setAutoSizeMenuOptionShown ( bool  shouldBeShown)
noexcept

Enables or disables the auto size options on the popup menu. By default, these are enabled.

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. The pointer passed in may not be null.

void TableListBox::setHeaderHeight ( int  newHeight)

Changes the height of the table header component.

See Also
getHeaderHeight
void TableListBox::setModel ( TableListBoxModel newModel)

Changes the TableListBoxModel that is being used for this table. The TableListBox does not take ownership of the model - it's the caller's responsibility to manage its lifetime and make sure it doesn't get deleted while still being used.

void TableListBox::tableColumnDraggingChanged ( TableHeaderComponent tableHeader,
int  columnIdNowBeingDragged 
)
overridevirtual

This is called when the user begins or ends dragging one of the columns around.

When the user starts dragging a column, this is called with the ID of that column. When they finish dragging, it is called again with 0 as the ID.

Reimplemented from TableHeaderComponent::Listener.

void TableListBox::tableColumnsChanged ( TableHeaderComponent tableHeader)
overridevirtual

This is called when some of the table's columns are added, removed, hidden, or rearranged.

Implements TableHeaderComponent::Listener.

void TableListBox::tableColumnsResized ( TableHeaderComponent tableHeader)
overridevirtual

This is called when one or more of the table's columns are resized.

Implements TableHeaderComponent::Listener.

void TableListBox::tableSortOrderChanged ( TableHeaderComponent tableHeader)
overridevirtual

This is called when the column by which the table should be sorted is changed.

Implements TableHeaderComponent::Listener.


The documentation for this class was generated from the following files: