LMMS
Loading...
Searching...
No Matches
juce::TableListBox Class Reference

#include <juce_TableListBox.h>

Inheritance diagram for juce::TableListBox:
juce::ListBox juce::ListBoxModel juce::TableHeaderComponent::Listener juce::Component juce::SettableTooltipClient juce::MouseListener juce::TooltipClient

Classes

class  RowComp
class  Header

Public Member Functions

 TableListBox (const String &componentName=String(), TableListBoxModel *model=nullptr)
 ~TableListBox () override
void setModel (TableListBoxModel *newModel)
TableListBoxModelgetModel () const noexcept
TableHeaderComponentgetHeader () const noexcept
void setHeader (std::unique_ptr< 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 row) 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
Public Member Functions inherited from juce::ListBox
 ListBox (const String &componentName=String(), ListBoxModel *model=nullptr)
 ~ListBox () override
void setModel (ListBoxModel *newModel)
ListBoxModelgetModel () const noexcept
void updateContent ()
void setMultipleSelectionEnabled (bool shouldBeEnabled) noexcept
void setClickingTogglesRowSelection (bool flipRowSelection) noexcept
void setRowSelectedOnMouseDown (bool isSelectedOnMouseDown) noexcept
void setMouseMoveSelectsRows (bool shouldSelect)
void selectRow (int rowNumber, bool dontScrollToShowThisRow=false, bool deselectOthersFirst=true)
void selectRangeOfRows (int firstRow, int lastRow, bool dontScrollToShowThisRange=false)
void deselectRow (int rowNumber)
void deselectAllRows ()
void flipRowSelection (int rowNumber)
SparseSet< intgetSelectedRows () const
void setSelectedRows (const SparseSet< int > &setOfRowsToBeSelected, NotificationType sendNotificationEventToModel=sendNotification)
bool isRowSelected (int rowNumber) const
int getNumSelectedRows () const
int getSelectedRow (int index=0) const
int getLastRowSelected () const
void selectRowsBasedOnModifierKeys (int rowThatWasClickedOn, ModifierKeys modifiers, bool isMouseUpEvent)
void setVerticalPosition (double newProportion)
double getVerticalPosition () const
void scrollToEnsureRowIsOnscreen (int row)
ScrollBargetVerticalScrollBar () const noexcept
ScrollBargetHorizontalScrollBar () const noexcept
int getRowContainingPosition (int x, int y) const noexcept
int getInsertionIndexForPosition (int x, int y) const noexcept
Rectangle< intgetRowPosition (int rowNumber, bool relativeToComponentTopLeft) const noexcept
ComponentgetComponentForRowNumber (int rowNumber) const noexcept
int getRowNumberOfComponent (Component *rowComponent) const noexcept
int getVisibleRowWidth () const noexcept
void setRowHeight (int newHeight)
int getRowHeight () const noexcept
int getNumRowsOnScreen () const noexcept
void setOutlineThickness (int outlineThickness)
int getOutlineThickness () const noexcept
void setHeaderComponent (std::unique_ptr< Component > newHeaderComponent)
ComponentgetHeaderComponent () const noexcept
void setMinimumContentWidth (int newMinimumWidth)
int getVisibleContentWidth () const noexcept
void repaintRow (int rowNumber) noexcept
virtual ScaledImage createSnapshotOfRows (const SparseSet< int > &rows, int &x, int &y)
ViewportgetViewport () const noexcept
bool keyPressed (const KeyPress &) override
bool keyStateChanged (bool isKeyDown) override
void paint (Graphics &) override
void paintOverChildren (Graphics &) override
void visibilityChanged () override
void mouseWheelMove (const MouseEvent &, const MouseWheelDetails &) override
void mouseUp (const MouseEvent &) override
void colourChanged () override
void parentHierarchyChanged () override
void startDragAndDrop (const MouseEvent &, const SparseSet< int > &rowsToDrag, const var &dragDescription, bool allowDraggingToOtherWindows)
void setSelectedRows (const SparseSet< int > &, bool)
Public Member Functions inherited from juce::Component
 Component () noexcept
 ~Component () override
 Component (const String &componentName) noexcept
String getName () const noexcept
virtual void setName (const String &newName)
String getComponentID () const noexcept
void setComponentID (const String &newID)
virtual void setVisible (bool shouldBeVisible)
bool isVisible () const noexcept
bool isShowing () const
virtual void addToDesktop (int windowStyleFlags, void *nativeWindowToAttachTo=nullptr)
void removeFromDesktop ()
bool isOnDesktop () const noexcept
ComponentPeergetPeer () const
virtual void userTriedToCloseWindow ()
virtual void minimisationStateChanged (bool isNowMinimised)
virtual float getDesktopScaleFactor () const
void toFront (bool shouldAlsoGainKeyboardFocus)
void toBack ()
void toBehind (Component *other)
void setAlwaysOnTop (bool shouldStayOnTop)
bool isAlwaysOnTop () const noexcept
int getX () const noexcept
int getY () const noexcept
int getWidth () const noexcept
int getHeight () const noexcept
int getRight () const noexcept
Point< intgetPosition () const noexcept
int getBottom () const noexcept
Rectangle< intgetBounds () const noexcept
Rectangle< intgetLocalBounds () const noexcept
Rectangle< intgetBoundsInParent () const noexcept
int getScreenX () const
int getScreenY () const
Point< intgetScreenPosition () const
Rectangle< intgetScreenBounds () const
Point< intgetLocalPoint (const Component *sourceComponent, Point< int > pointRelativeToSourceComponent) const
Point< float > getLocalPoint (const Component *sourceComponent, Point< float > pointRelativeToSourceComponent) const
Rectangle< intgetLocalArea (const Component *sourceComponent, Rectangle< int > areaRelativeToSourceComponent) const
Rectangle< float > getLocalArea (const Component *sourceComponent, Rectangle< float > areaRelativeToSourceComponent) const
Point< intlocalPointToGlobal (Point< int > localPoint) const
Point< float > localPointToGlobal (Point< float > localPoint) const
Rectangle< intlocalAreaToGlobal (Rectangle< int > localArea) const
Rectangle< float > localAreaToGlobal (Rectangle< float > localArea) const
void setTopLeftPosition (int x, int y)
void setTopLeftPosition (Point< int > newTopLeftPosition)
void setTopRightPosition (int x, int y)
void setSize (int newWidth, int newHeight)
void setBounds (int x, int y, int width, int height)
void setBounds (Rectangle< int > newBounds)
void setBoundsRelative (float proportionalX, float proportionalY, float proportionalWidth, float proportionalHeight)
void setBoundsRelative (Rectangle< float > proportionalArea)
void setBoundsInset (BorderSize< int > borders)
void setBoundsToFit (Rectangle< int > targetArea, Justification justification, bool onlyReduceInSize)
void setCentrePosition (int x, int y)
void setCentrePosition (Point< int > newCentrePosition)
void setCentreRelative (float x, float y)
void centreWithSize (int width, int height)
void setTransform (const AffineTransform &transform)
AffineTransform getTransform () const
bool isTransformed () const noexcept
int proportionOfWidth (float proportion) const noexcept
int proportionOfHeight (float proportion) const noexcept
int getParentWidth () const noexcept
int getParentHeight () const noexcept
Rectangle< intgetParentMonitorArea () const
int getNumChildComponents () const noexcept
ComponentgetChildComponent (int index) const noexcept
int getIndexOfChildComponent (const Component *child) const noexcept
const Array< Component * > & getChildren () const noexcept
ComponentfindChildWithID (StringRef componentID) const noexcept
void addChildComponent (Component *child, int zOrder=-1)
void addChildComponent (Component &child, int zOrder=-1)
void addAndMakeVisible (Component *child, int zOrder=-1)
void addAndMakeVisible (Component &child, int zOrder=-1)
void addChildAndSetID (Component *child, const String &componentID)
void removeChildComponent (Component *childToRemove)
ComponentremoveChildComponent (int childIndexToRemove)
void removeAllChildren ()
void deleteAllChildren ()
ComponentgetParentComponent () const noexcept
template<class TargetClass>
TargetClass * findParentComponentOfClass () const
ComponentgetTopLevelComponent () const noexcept
bool isParentOf (const Component *possibleChild) const noexcept
virtual void childrenChanged ()
virtual bool hitTest (int x, int y)
void setInterceptsMouseClicks (bool allowClicksOnThisComponent, bool allowClicksOnChildComponents) noexcept
void getInterceptsMouseClicks (bool &allowsClicksOnThisComponent, bool &allowsClicksOnChildComponents) const noexcept
bool contains (Point< int > localPoint)
bool contains (Point< float > localPoint)
bool reallyContains (Point< int > localPoint, bool returnTrueIfWithinAChild)
bool reallyContains (Point< float > localPoint, bool returnTrueIfWithinAChild)
ComponentgetComponentAt (int x, int y)
ComponentgetComponentAt (Point< int > position)
ComponentgetComponentAt (Point< float > position)
void repaint ()
void repaint (int x, int y, int width, int height)
void repaint (Rectangle< int > area)
void setBufferedToImage (bool shouldBeBuffered)
Image createComponentSnapshot (Rectangle< int > areaToGrab, bool clipImageToComponentBounds=true, float scaleFactor=1.0f)
void paintEntireComponent (Graphics &context, bool ignoreAlphaLevel)
void setPaintingIsUnclipped (bool shouldPaintWithoutClipping) noexcept
bool isPaintingUnclipped () const noexcept
void setComponentEffect (ImageEffectFilter *newEffect)
ImageEffectFiltergetComponentEffect () const noexcept
LookAndFeelgetLookAndFeel () const noexcept
void setLookAndFeel (LookAndFeel *newLookAndFeel)
virtual void lookAndFeelChanged ()
void sendLookAndFeelChange ()
void setOpaque (bool shouldBeOpaque)
bool isOpaque () const noexcept
void setBroughtToFrontOnMouseClick (bool shouldBeBroughtToFront) noexcept
bool isBroughtToFrontOnMouseClick () const noexcept
void setExplicitFocusOrder (int newFocusOrderIndex)
int getExplicitFocusOrder () const
void setFocusContainerType (FocusContainerType containerType) noexcept
bool isFocusContainer () const noexcept
bool isKeyboardFocusContainer () const noexcept
ComponentfindFocusContainer () const
ComponentfindKeyboardFocusContainer () const
void setWantsKeyboardFocus (bool wantsFocus) noexcept
bool getWantsKeyboardFocus () const noexcept
void setMouseClickGrabsKeyboardFocus (bool shouldGrabFocus)
bool getMouseClickGrabsKeyboardFocus () const noexcept
void grabKeyboardFocus ()
void giveAwayKeyboardFocus ()
bool hasKeyboardFocus (bool trueIfChildIsFocused) const
void moveKeyboardFocusToSibling (bool moveToNext)
virtual std::unique_ptr< ComponentTraversercreateFocusTraverser ()
virtual std::unique_ptr< ComponentTraversercreateKeyboardFocusTraverser ()
void setHasFocusOutline (bool hasFocusOutline) noexcept
bool hasFocusOutline () const noexcept
bool isEnabled () const noexcept
void setEnabled (bool shouldBeEnabled)
virtual void enablementChanged ()
float getAlpha () const noexcept
void setAlpha (float newAlpha)
virtual void alphaChanged ()
void setMouseCursor (const MouseCursor &cursorType)
virtual MouseCursor getMouseCursor ()
void updateMouseCursor () const
void mouseMove (const MouseEvent &event) override
void mouseEnter (const MouseEvent &event) override
void mouseExit (const MouseEvent &event) override
void mouseDown (const MouseEvent &event) override
void mouseDrag (const MouseEvent &event) override
void mouseDoubleClick (const MouseEvent &event) override
void mouseMagnify (const MouseEvent &event, float scaleFactor) override
void setRepaintsOnMouseActivity (bool shouldRepaint) noexcept
void addMouseListener (MouseListener *newListener, bool wantsEventsForAllNestedChildComponents)
void removeMouseListener (MouseListener *listenerToRemove)
void addKeyListener (KeyListener *newListener)
void removeKeyListener (KeyListener *listenerToRemove)
virtual void modifierKeysChanged (const ModifierKeys &modifiers)
virtual void focusGained (FocusChangeType cause)
virtual void focusLost (FocusChangeType cause)
virtual void focusOfChildComponentChanged (FocusChangeType cause)
bool isMouseOver (bool includeChildren=false) const
bool isMouseButtonDown (bool includeChildren=false) const
bool isMouseOverOrDragging (bool includeChildren=false) const
Point< intgetMouseXYRelative () const
virtual void moved ()
virtual void childBoundsChanged (Component *child)
virtual void parentSizeChanged ()
virtual void broughtToFront ()
void addComponentListener (ComponentListener *newListener)
void removeComponentListener (ComponentListener *listenerToRemove)
void postCommandMessage (int commandId)
virtual void handleCommandMessage (int commandId)
void enterModalState (bool takeKeyboardFocus=true, ModalComponentManager::Callback *callback=nullptr, bool deleteWhenDismissed=false)
void exitModalState (int returnValue)
bool isCurrentlyModal (bool onlyConsiderForemostModalComponent=true) const noexcept
bool isCurrentlyBlockedByAnotherModalComponent () const
virtual bool canModalEventBeSentToComponent (const Component *targetComponent)
virtual void inputAttemptWhenModal ()
NamedValueSetgetProperties () noexcept
const NamedValueSetgetProperties () const noexcept
Colour findColour (int colourID, bool inheritFromParent=false) const
void setColour (int colourID, Colour newColour)
void removeColour (int colourID)
bool isColourSpecified (int colourID) const
void copyAllExplicitColoursTo (Component &target) const
voidgetWindowHandle () const
PositionergetPositioner () const noexcept
void setPositioner (Positioner *newPositioner)
void setCachedComponentImage (CachedComponentImage *newCachedImage)
CachedComponentImagegetCachedComponentImage () const noexcept
void setViewportIgnoreDragFlag (bool ignoreDrag) noexcept
bool getViewportIgnoreDragFlag () const noexcept
String getTitle () const noexcept
void setTitle (const String &newTitle)
String getDescription () const noexcept
void setDescription (const String &newDescription)
String getHelpText () const noexcept
void setHelpText (const String &newHelpText)
void setAccessible (bool shouldBeAccessible)
bool isAccessible () const noexcept
AccessibilityHandlergetAccessibilityHandler ()
void invalidateAccessibilityHandler ()
void setFocusContainer (bool shouldBeFocusContainer) noexcept
void contains (int, int)=delete
Public Member Functions inherited from juce::MouseListener
virtual ~MouseListener ()=default
Public Member Functions inherited from juce::SettableTooltipClient
 ~SettableTooltipClient () override=default
virtual void setTooltip (const String &newTooltip)
String getTooltip () override
Public Member Functions inherited from juce::TooltipClient
virtual ~TooltipClient ()=default

Private Member Functions

std::unique_ptr< AccessibilityHandlercreateAccessibilityHandler () override
void updateColumnComponents () const
Private Member Functions inherited from juce::ListBoxModel
virtual ~ListBoxModel ()=default
virtual String getNameForRow (int rowNumber)
virtual void listBoxItemClicked (int row, const MouseEvent &)
virtual void listBoxItemDoubleClicked (int row, const MouseEvent &)
virtual var getDragSourceDescription (const SparseSet< int > &rowsToDescribe)
virtual String getTooltipForRow (int row)
virtual MouseCursor getMouseCursorForRow (int row)
Private Member Functions inherited from juce::TableHeaderComponent::Listener
 Listener ()=default
virtual ~Listener ()=default

Private Attributes

TableHeaderComponentheader = nullptr
TableListBoxModelmodel
int columnIdNowBeingDragged = 0
bool autoSizeOptionsShown = true

Additional Inherited Members

Public Types inherited from juce::ListBox
enum  ColourIds { backgroundColourId = 0x1002800 , outlineColourId = 0x1002810 , textColourId = 0x1002820 }
Public Types inherited from juce::Component
enum class  FocusContainerType { none , focusContainer , keyboardFocusContainer }
enum  FocusChangeType { focusChangedByMouseClick , focusChangedByTabKey , focusChangedDirectly }
Static Public Member Functions inherited from juce::Component
static float JUCE_CALLTYPE getApproximateScaleFactorForComponent (const Component *targetComponent)
static Component *JUCE_CALLTYPE getCurrentlyFocusedComponent () noexcept
static void JUCE_CALLTYPE unfocusAllComponents ()
static void JUCE_CALLTYPE beginDragAutoRepeat (int millisecondsBetweenCallbacks)
static bool JUCE_CALLTYPE isMouseButtonDownAnywhere () noexcept
static int JUCE_CALLTYPE getNumCurrentlyModalComponents () noexcept
static Component *JUCE_CALLTYPE getCurrentlyModalComponent (int index=0) noexcept
Protected Member Functions inherited from juce::Component
virtual ComponentPeercreateNewPeer (int styleFlags, void *nativeWindowToAttachTo)
Protected Member Functions inherited from juce::SettableTooltipClient
 SettableTooltipClient ()=default
Static Protected Member Functions inherited from juce::Component
static std::unique_ptr< AccessibilityHandlercreateIgnoredAccessibilityHandler (Component &)

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

@tags{GUI}

Constructor & Destructor Documentation

◆ TableListBox()

juce::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()

juce::TableListBox::~TableListBox ( )
override

Destructor.

Member Function Documentation

◆ autoSizeAllColumns()

void juce::TableListBox::autoSizeAllColumns ( )

Calls autoSizeColumn() for all columns in the table.

◆ autoSizeColumn()

void juce::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

◆ backgroundClicked()

void juce::TableListBox::backgroundClicked ( const MouseEvent & )
overridevirtual

This can be overridden to react to the user clicking on a part of the list where there are no rows.

See also
listBoxItemClicked

Reimplemented from juce::ListBoxModel.

◆ createAccessibilityHandler()

std::unique_ptr< AccessibilityHandler > juce::TableListBox::createAccessibilityHandler ( )
overrideprivatevirtual

Override this method to return a custom AccessibilityHandler for this component.

The default implementation creates and returns a AccessibilityHandler object with an unspecified role, meaning that it will be visible to accessibility clients but without a specific role, action callbacks or interfaces. To control how accessibility clients see and interact with your component subclass AccessibilityHandler, implement the desired behaviours, and return an instance of it from this method in your component subclass.

The accessibility handler you return here is guaranteed to be destroyed before its Component, so it's safe to store and use a reference back to the Component inside the AccessibilityHandler if necessary.

See also
getAccessibilityHandler

Reimplemented from juce::ListBox.

◆ deleteKeyPressed()

void juce::TableListBox::deleteKeyPressed ( int lastRowSelected)
overridevirtual

Override this to be informed when the delete key is pressed.

If no rows are selected when they press the key, this won't be called.

Parameters
lastRowSelectedthe last row that had been selected when they pressed the key - if there are multiple selections, this might not be very useful

Reimplemented from juce::ListBoxModel.

◆ getCellComponent()

Component * juce::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

◆ getCellPosition()

Rectangle< int > juce::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.

◆ getHeader()

TableHeaderComponent & juce::TableListBox::getHeader ( ) const
inlinenoexcept

Returns the header component being used in this table.

◆ getHeaderHeight()

int juce::TableListBox::getHeaderHeight ( ) const
noexcept

Returns the height of the table header.

See also
setHeaderHeight

◆ getModel()

TableListBoxModel * juce::TableListBox::getModel ( ) const
inlinenoexcept

Returns the model currently in use.

◆ getNumRows()

int juce::TableListBox::getNumRows ( )
overridevirtual

This has to return the number of items in the list.

See also
ListBox::getNumRows()

Implements juce::ListBoxModel.

◆ isAutoSizeMenuOptionShown()

bool juce::TableListBox::isAutoSizeMenuOptionShown ( ) const
inlinenoexcept

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

See also
setAutoSizeMenuOptionShown

◆ listWasScrolled()

void juce::TableListBox::listWasScrolled ( )
overridevirtual

Override this to be informed when the list is scrolled.

This might be caused by the user moving the scrollbar, or by programmatic changes to the list position.

Reimplemented from juce::ListBoxModel.

◆ paintListBoxItem()

void juce::TableListBox::paintListBoxItem ( int rowNumber,
Graphics & g,
int width,
int height,
bool rowIsSelected )
overridevirtual

This method must be implemented to draw a row of the list. Note that the rowNumber value may be greater than the number of rows in your list, so be careful that you don't assume it's less than getNumRows().

Implements juce::ListBoxModel.

◆ refreshComponentForRow()

Component * juce::TableListBox::refreshComponentForRow ( int rowNumber,
bool isRowSelected,
Component * existingComponentToUpdate )
overridevirtual

This is used to create or update a custom component to go in a row of the list.

Any row may contain a custom component, or can just be drawn with the paintListBoxItem() method and handle mouse clicks with listBoxItemClicked().

This method will be called whenever a custom component might need to be updated - e.g. when the list is changed, or ListBox::updateContent() is called.

If you don't need a custom component for the specified row, then return nullptr. (Bear in mind that even if you're not creating a new component, you may still need to delete existingComponentToUpdate if it's non-null).

If you do want a custom component, and the existingComponentToUpdate is null, then this method must create a suitable new component and return it.

If the existingComponentToUpdate is non-null, it will be a pointer to a component previously created by this method. In this case, the method must either update it to make sure it's correctly representing the given row (which may be different from the one that the component was created for), or it can delete this component and return a new one.

The component that your method returns will be deleted by the ListBox when it is no longer needed.

Bear in mind that if you put a custom component inside the row but still want the listbox to automatically handle clicking, selection, etc, then you'll need to make sure your custom component doesn't intercept all the mouse events that land on it, e.g by using Component::setInterceptsMouseClicks().

Reimplemented from juce::ListBoxModel.

◆ resized()

void juce::TableListBox::resized ( )
overridevirtual

Called when this component's size has been changed.

A component can implement this method to do things such as laying out its child components when its width or height changes.

The method is called synchronously as a result of the setBounds or setSize methods, so repeatedly changing a components size will repeatedly call its resized method (unlike things like repainting, where multiple calls to repaint are coalesced together).

If the component is a top-level window on the desktop, its size could also be changed by operating-system factors beyond the application's control.

See also
moved, setSize

Reimplemented from juce::ListBox.

◆ returnKeyPressed()

void juce::TableListBox::returnKeyPressed ( int lastRowSelected)
overridevirtual

Override this to be informed when the return key is pressed.

If no rows are selected when they press the key, this won't be called.

Parameters
lastRowSelectedthe last row that had been selected when they pressed the key - if there are multiple selections, this might not be very useful

Reimplemented from juce::ListBoxModel.

◆ scrollToEnsureColumnIsOnscreen()

void juce::TableListBox::scrollToEnsureColumnIsOnscreen ( int columnId)

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

See also
ListBox::scrollToEnsureRowIsOnscreen

◆ selectedRowsChanged()

void juce::TableListBox::selectedRowsChanged ( int lastRowSelected)
overridevirtual

Override this to be informed when rows are selected or deselected.

This will be called whenever a row is selected or deselected. If a range of rows is selected all at once, this will just be called once for that event.

Parameters
lastRowSelectedthe last row that the user selected. If no rows are currently selected, this may be -1.

Reimplemented from juce::ListBoxModel.

◆ setAutoSizeMenuOptionShown()

void juce::TableListBox::setAutoSizeMenuOptionShown ( bool shouldBeShown)
noexcept

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

◆ setHeader()

void juce::TableListBox::setHeader ( std::unique_ptr< 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.

◆ setHeaderHeight()

void juce::TableListBox::setHeaderHeight ( int newHeight)

Changes the height of the table header component.

See also
getHeaderHeight

◆ setModel()

void juce::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.

◆ tableColumnDraggingChanged()

void juce::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 juce::TableHeaderComponent::Listener.

◆ tableColumnsChanged()

void juce::TableListBox::tableColumnsChanged ( TableHeaderComponent * tableHeader)
overridevirtual

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

Implements juce::TableHeaderComponent::Listener.

◆ tableColumnsResized()

void juce::TableListBox::tableColumnsResized ( TableHeaderComponent * tableHeader)
overridevirtual

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

Implements juce::TableHeaderComponent::Listener.

◆ tableSortOrderChanged()

void juce::TableListBox::tableSortOrderChanged ( TableHeaderComponent * tableHeader)
overridevirtual

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

Implements juce::TableHeaderComponent::Listener.

◆ updateColumnComponents()

void juce::TableListBox::updateColumnComponents ( ) const
private

Member Data Documentation

◆ autoSizeOptionsShown

bool juce::TableListBox::autoSizeOptionsShown = true
private

◆ columnIdNowBeingDragged

int juce::TableListBox::columnIdNowBeingDragged = 0
private

◆ header

TableHeaderComponent* juce::TableListBox::header = nullptr
private

◆ model

TableListBoxModel* juce::TableListBox::model
private

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