A button that uses the standard lozenge-shaped background with a line of text on it. More...
Inherits Button.
Public Types | |
| enum | ColourIds { buttonColourId = 0x1000100, buttonOnColourId = 0x1000101, textColourOffId = 0x1000102, textColourOnId = 0x1000103 } |
A set of colour IDs to use to change the colour of various aspects of the button. More... | |
Public Member Functions | |
| TextButton (const String &buttonName, const String &toolTip=String::empty) | |
| Creates a TextButton. | |
| ~TextButton () | |
| Destructor. | |
| void | changeWidthToFitText (int newHeight=-1) |
| Resizes the button to fit neatly around its current text. | |
| virtual const Font | getFont () |
| This can be overridden to use different fonts than the default one. | |
Protected Member Functions | |
| void | paintButton (Graphics &g, bool isMouseOverButton, bool isButtonDown) |
| void | colourChanged () |
A button that uses the standard lozenge-shaped background with a line of text on it.
A set of colour IDs to use to change the colour of various aspects of the button.
These constants can be used either via the Component::setColour(), or LookAndFeel::setColour() methods.
| TextButton::TextButton | ( | const String & | buttonName, | |
| const String & | toolTip = String::empty | |||
| ) |
Creates a TextButton.
| buttonName | the text to put in the button (the component's name is also initially set to this string, but these can be changed later using the setName() and setButtonText() methods) | |
| toolTip | an optional string to use as a toolip |
| TextButton::~TextButton | ( | ) |
Destructor.
| void TextButton::changeWidthToFitText | ( | int | newHeight = -1 |
) |
Resizes the button to fit neatly around its current text.
If newHeight is >= 0, the button's height will be changed to this value. If it's less than zero, its height will be unaffected.
| virtual const Font TextButton::getFont | ( | ) | [virtual] |
This can be overridden to use different fonts than the default one.
Note that you'll need to set the font's size appropriately, too.
| void TextButton::paintButton | ( | Graphics & | g, | |
| bool | isMouseOverButton, | |||
| bool | isButtonDown | |||
| ) | [protected, virtual] |
For internal use only.
Implements Button.
| void TextButton::colourChanged | ( | ) | [protected, virtual] |
For internal use only.
Reimplemented from Component.
1.6.3