Inherits Button.
Public Member Functions | |
| TabBarButton (const String &name, TabbedButtonBar *const ownerBar, const int tabIndex) | |
| Creates the tab button. | |
| ~TabBarButton () | |
| Destructor. | |
| virtual int | getBestTabLength (const int depth) |
| Chooses the best length for the tab, given the specified depth. | |
| void | paintButton (Graphics &g, bool isMouseOverButton, bool isButtonDown) |
| Subclasses should override this to actually paint the button's contents. | |
| void | clicked (const ModifierKeys &mods) |
| This method is called when the button has been clicked. | |
| bool | hitTest (int x, int y) |
| Tests whether a given point inside the component. | |
Protected Member Functions | |
| void | getActiveArea (int &x, int &y, int &w, int &h) |
| Returns an area of the component that's safe to draw in. | |
Protected Attributes | |
| TabbedButtonBar *const | owner |
| int | tabIndex |
| int | overlapPixels |
| DropShadowEffect | shadow |
If you want to create a TabbedButtonBar with custom tab components, derive your component from this class, and override the TabbedButtonBar::createTabButton() method to create it instead of the default one.
| TabBarButton::TabBarButton | ( | const String & | name, | |
| TabbedButtonBar *const | ownerBar, | |||
| const int | tabIndex | |||
| ) |
Creates the tab button.
| TabBarButton::~TabBarButton | ( | ) |
Destructor.
| virtual int TabBarButton::getBestTabLength | ( | const int | depth | ) | [virtual] |
Chooses the best length for the tab, given the specified depth.
If the tab is horizontal, this should return its width, and the depth specifies its height. If it's vertical, it should return the height, and the depth is actually its width.
| void TabBarButton::paintButton | ( | Graphics & | g, | |
| bool | isMouseOverButton, | |||
| bool | isButtonDown | |||
| ) | [virtual] |
Subclasses should override this to actually paint the button's contents.
It's better to use this than the paint method, because it gives you information about the over/down state of the button.
| g | the graphics context to use | |
| isMouseOverButton | true if the button is either in the 'over' or 'down' state | |
| isButtonDown | true if the button should be drawn in the 'down' position |
Implements Button.
| void TabBarButton::clicked | ( | const ModifierKeys & | modifiers | ) | [virtual] |
This method is called when the button has been clicked.
By default it just calls clicked(), but you might want to override it to handle things like clicking when a modifier key is pressed, etc.
Reimplemented from Button.
| bool TabBarButton::hitTest | ( | int | x, | |
| int | y | |||
| ) | [virtual] |
Tests whether a given point inside the component.
Overriding this method allows you to create components which only intercept mouse-clicks within a user-defined area.
This is called to find out whether a particular x, y co-ordinate is considered to be inside the component or not, and is used by methods such as contains() and getComponentAt() to work out which component the mouse is clicked on.
Components with custom shapes will probably want to override it to perform some more complex hit-testing.
The default implementation of this method returns either true or false, depending on the value that was set by calling setInterceptsMouseClicks() (true is the default return value).
Note that the hit-test region is not related to the opacity with which areas of a component are painted.
Applications should never call hitTest() directly - instead use the contains() method, because this will also test for occlusion by the component's parent.
Note that for components on the desktop, this method will be ignored, because it's not always possible to implement this behaviour on all platforms.
| x | the x co-ordinate to test, relative to the left hand edge of this component. This value is guaranteed to be greater than or equal to zero, and less than the component's width | |
| y | the y co-ordinate to test, relative to the top edge of this component. This value is guaranteed to be greater than or equal to zero, and less than the component's height |
Reimplemented from Component.
| void TabBarButton::getActiveArea | ( | int & | x, | |
| int & | y, | |||
| int & | w, | |||
| int & | h | |||
| ) | [protected] |
Returns an area of the component that's safe to draw in.
This deals with the orientation of the tabs, which affects which side is touching the tabbed box's content component.
TabbedButtonBar* const TabBarButton::owner [protected] |
int TabBarButton::tabIndex [protected] |
int TabBarButton::overlapPixels [protected] |
DropShadowEffect TabBarButton::shadow [protected] |
1.5.9