Inherits Component.
Public Types | |
| enum | ColourIds { backgroundColourId = 0x1005800, outlineColourId = 0x1005801 } |
| A set of colour IDs to use to change the colour of various aspects of the component. More... | |
Public Member Functions | |
| TabbedComponent (const TabbedButtonBar::Orientation orientation) | |
| Creates a TabbedComponent, specifying where the tabs should be placed. | |
| ~TabbedComponent () | |
| Destructor. | |
| void | setOrientation (const TabbedButtonBar::Orientation orientation) |
| Changes the placement of the tabs. | |
| TabbedButtonBar::Orientation | getOrientation () const throw () |
| Returns the current tab placement. | |
| void | setTabBarDepth (const int newDepth) |
| Specifies how many pixels wide or high the tab-bar should be. | |
| int | getTabBarDepth () const throw () |
| Returns the current thickness of the tab bar. | |
| void | setOutline (const int newThickness) |
| Specifies the thickness of an outline that should be drawn around the content component. | |
| void | setIndent (const int indentThickness) |
| Specifies a gap to leave around the edge of the content component. | |
| void | clearTabs () |
| Removes all the tabs from the bar. | |
| void | addTab (const String &tabName, const Colour &tabBackgroundColour, Component *const contentComponent, const bool deleteComponentWhenNotNeeded, const int insertIndex=-1) |
| Adds a tab to the tab-bar. | |
| void | setTabName (const int tabIndex, const String &newName) |
| Changes the name of one of the tabs. | |
| void | removeTab (const int tabIndex) |
| Gets rid of one of the tabs. | |
| int | getNumTabs () const |
| Returns the number of tabs in the bar. | |
| const StringArray | getTabNames () const |
| Returns a list of all the tab names in the bar. | |
| Component * | getTabContentComponent (const int tabIndex) const throw () |
| Returns the content component that was added for the given index. | |
| const Colour | getTabBackgroundColour (const int tabIndex) const throw () |
| Returns the colour of one of the tabs. | |
| void | setTabBackgroundColour (const int tabIndex, const Colour &newColour) |
| Changes the background colour of one of the tabs. | |
| void | setCurrentTabIndex (const int newTabIndex, const bool sendChangeMessage=true) |
| Changes the currently-selected tab. | |
| int | getCurrentTabIndex () const |
| Returns the index of the currently selected tab. | |
| const String & | getCurrentTabName () const |
| Returns the name of the currently selected tab. | |
| Component * | getCurrentContentComponent () const throw () |
| Returns the current component that's filling the panel. | |
| virtual void | currentTabChanged (const int newCurrentTabIndex, const String &newCurrentTabName) |
| Callback method to indicate the selected tab has been changed. | |
| virtual void | popupMenuClickOnTab (const int tabIndex, const String &tabName) |
| Callback method to indicate that the user has right-clicked on a tab. | |
| TabbedButtonBar & | getTabbedButtonBar () const throw () |
| Returns the tab button bar component that is being used. | |
| void | paint (Graphics &g) |
| void | resized () |
| void | lookAndFeelChanged () |
Protected Member Functions | |
| virtual TabBarButton * | createTabButton (const String &tabName, const int tabIndex) |
| This creates one of the tab buttons. | |
Protected Attributes | |
| TabbedButtonBar * | tabs |
This makes it easy to create a set of tabbed pages, just add a bunch of tabs with addTab(), and this will take care of showing the pages for you when the user clicks on a different tab.
A set of colour IDs to use to change the colour of various aspects of the component.
These constants can be used either via the Component::setColour(), or LookAndFeel::setColour() methods.
| TabbedComponent::TabbedComponent | ( | const TabbedButtonBar::Orientation | orientation | ) |
Creates a TabbedComponent, specifying where the tabs should be placed.
Once created, add some tabs with the addTab() method.
| TabbedComponent::~TabbedComponent | ( | ) |
Destructor.
| void TabbedComponent::setOrientation | ( | const TabbedButtonBar::Orientation | orientation | ) |
Changes the placement of the tabs.
This will rearrange the layout to place the tabs along the appropriate side of this component, and will shift the content component accordingly.
| TabbedButtonBar::Orientation TabbedComponent::getOrientation | ( | ) | const throw () |
| void TabbedComponent::setTabBarDepth | ( | const int | newDepth | ) |
Specifies how many pixels wide or high the tab-bar should be.
If the tabs are placed along the top or bottom, this specified the height of the bar; if they're along the left or right edges, it'll be the width of the bar.
| int TabbedComponent::getTabBarDepth | ( | ) | const throw () |
| void TabbedComponent::setOutline | ( | const int | newThickness | ) |
Specifies the thickness of an outline that should be drawn around the content component.
If this thickness is > 0, a line will be drawn around the three sides of the content component which don't touch the tab-bar, and the content component will be inset by this amount.
To set the colour of the line, use setColour (outlineColourId, ...).
| void TabbedComponent::setIndent | ( | const int | indentThickness | ) |
Specifies a gap to leave around the edge of the content component.
Each edge of the content component will be indented by the given number of pixels.
| void TabbedComponent::clearTabs | ( | ) |
| void TabbedComponent::addTab | ( | const String & | tabName, | |
| const Colour & | tabBackgroundColour, | |||
| Component *const | contentComponent, | |||
| const bool | deleteComponentWhenNotNeeded, | |||
| const int | insertIndex = -1 | |||
| ) |
Adds a tab to the tab-bar.
The component passed in will be shown for the tab, and if deleteComponentWhenNotNeeded is true, it will be deleted when the tab is removed or when this object is deleted.
| void TabbedComponent::setTabName | ( | const int | tabIndex, | |
| const String & | newName | |||
| ) |
Changes the name of one of the tabs.
| void TabbedComponent::removeTab | ( | const int | tabIndex | ) |
Gets rid of one of the tabs.
| int TabbedComponent::getNumTabs | ( | ) | const |
Returns the number of tabs in the bar.
| const StringArray TabbedComponent::getTabNames | ( | ) | const |
Returns a list of all the tab names in the bar.
| Component* TabbedComponent::getTabContentComponent | ( | const int | tabIndex | ) | const throw () |
Returns the content component that was added for the given index.
Be sure not to use or delete the components that are returned, as this may interfere with the TabbedComponent's use of them.
| const Colour TabbedComponent::getTabBackgroundColour | ( | const int | tabIndex | ) | const throw () |
Returns the colour of one of the tabs.
| void TabbedComponent::setTabBackgroundColour | ( | const int | tabIndex, | |
| const Colour & | newColour | |||
| ) |
Changes the background colour of one of the tabs.
| void TabbedComponent::setCurrentTabIndex | ( | const int | newTabIndex, | |
| const bool | sendChangeMessage = true | |||
| ) |
Changes the currently-selected tab.
To deselect all the tabs, pass -1 as the index.
| int TabbedComponent::getCurrentTabIndex | ( | ) | const |
Returns the index of the currently selected tab.
| const String& TabbedComponent::getCurrentTabName | ( | ) | const |
Returns the name of the currently selected tab.
| Component* TabbedComponent::getCurrentContentComponent | ( | ) | const throw () |
Returns the current component that's filling the panel.
This will return 0 if there isn't one.
| virtual void TabbedComponent::currentTabChanged | ( | const int | newCurrentTabIndex, | |
| const String & | newCurrentTabName | |||
| ) | [virtual] |
| virtual void TabbedComponent::popupMenuClickOnTab | ( | const int | tabIndex, | |
| const String & | tabName | |||
| ) | [virtual] |
Callback method to indicate that the user has right-clicked on a tab.
(Or ctrl-clicked on the Mac)
| TabbedButtonBar& TabbedComponent::getTabbedButtonBar | ( | ) | const throw () |
Returns the tab button bar component that is being used.
| void TabbedComponent::paint | ( | Graphics & | g | ) | [virtual] |
| void TabbedComponent::resized | ( | ) | [virtual] |
| void TabbedComponent::lookAndFeelChanged | ( | ) | [virtual] |
| virtual TabBarButton* TabbedComponent::createTabButton | ( | const String & | tabName, | |
| const int | tabIndex | |||
| ) | [protected, virtual] |
This creates one of the tab buttons.
If you need to use custom tab components, you can override this method and return your own class instead of the default.
TabbedButtonBar* TabbedComponent::tabs [protected] |
1.5.9