50 lf.drawButtonBackground (g, *
this,
74 return getLookAndFeel().getTextButtonWidthToFitText (*
this, buttonHeight);
int getHeight() const noexcept
Returns the component's height in pixels.
void repaint()
Marks the whole component as needing to be redrawn.
void setSize(int newWidth, int newHeight)
Changes the size of the component.
Colour findColour(int colourID, bool inheritFromParent=false) const
Looks for a colour that has been registered with the given colour ID number.
LookAndFeel & getLookAndFeel() const noexcept
Finds the appropriate look-and-feel to use for this component.
A graphics context, used for drawing a component or image.
TextButton()
Creates a TextButton.
void changeWidthToFitText()
Changes this button's width to fit neatly around its current text, without changing its height.
void colourChanged() override
This method is called when a colour is changed by the setColour() method, or when the look-and-feel i...
int getBestWidthForHeight(int buttonHeight)
Returns the width that the LookAndFeel suggests would be best for this button if it had the given hei...
@ buttonColourId
The colour used to fill the button shape (when the button is toggled 'off').
@ buttonOnColourId
The colour used to fill the button shape (when the button is toggled 'on').
~TextButton() override
Destructor.
void paintButton(Graphics &, bool, bool) override
Subclasses should override this to actually paint the button's contents.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...