A component that draws an outline around itself and has an optional title at the top, for drawing an outline around a group of controls. More...
Inherits Component.
Public Types | |
| enum | ColourIds { outlineColourId = 0x1005400, textColourId = 0x1005410 } |
A set of colour IDs to use to change the colour of various aspects of the component. More... | |
Public Member Functions | |
| GroupComponent (const String &componentName=String::empty, const String &labelText=String::empty) | |
| Creates a GroupComponent. | |
| ~GroupComponent () | |
| Destructor. | |
| void | setText (const String &newText) |
| Changes the text that's shown at the top of the component. | |
| String | getText () const |
| Returns the currently displayed text label. | |
| void | setTextLabelPosition (const Justification &justification) |
| Sets the positioning of the text label. | |
| const Justification | getTextLabelPosition () const noexcept |
| Returns the current text label position. | |
| void | paint (Graphics &g) |
| Components can override this method to draw their content. | |
| void | enablementChanged () |
| Callback to indicate that this component has been enabled or disabled. | |
| void | colourChanged () |
| This method is called when a colour is changed by the setColour() method. | |
A component that draws an outline around itself and has an optional title at the top, for drawing an outline around a group of controls.
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.
| GroupComponent::GroupComponent | ( | const String & | componentName = String::empty, |
| const String & | labelText = String::empty |
||
| ) |
Creates a GroupComponent.
| componentName | the name to give the component |
| labelText | the text to show at the top of the outline |
| GroupComponent::~GroupComponent | ( | ) |
Destructor.
| void GroupComponent::setText | ( | const String & | newText ) |
Changes the text that's shown at the top of the component.
| String GroupComponent::getText | ( | ) | const |
Returns the currently displayed text label.
| void GroupComponent::setTextLabelPosition | ( | const Justification & | justification ) |
Sets the positioning of the text label.
(The default is Justification::left)
| const Justification GroupComponent::getTextLabelPosition | ( | ) | const |
Returns the current text label position.
| void GroupComponent::paint | ( | Graphics & | g ) | [virtual] |
Components can override this method to draw their content.
The paint() method gets called when a region of a component needs redrawing, either because the component's repaint() method has been called, or because something has happened on the screen that means a section of a window needs to be redrawn.
Any child components will draw themselves over whatever this method draws. If you need to paint over the top of your child components, you can also implement the paintOverChildren() method to do this.
If you want to cause a component to redraw itself, this is done asynchronously - calling the repaint() method marks a region of the component as "dirty", and the paint() method will automatically be called sometime later, by the message thread, to paint any bits that need refreshing. In Juce (and almost all modern UI frameworks), you never redraw something synchronously.
You should never need to call this method directly - to take a snapshot of the component you could use createComponentSnapshot() or paintEntireComponent().
| g | the graphics context that must be used to do the drawing operations. |
Reimplemented from Component.
| void GroupComponent::enablementChanged | ( | ) | [virtual] |
Callback to indicate that this component has been enabled or disabled.
This can be triggered by one of the component's parent components being enabled or disabled, as well as changes to the component itself.
The default implementation of this method does nothing; your class may wish to repaint itself or something when this happens.
Reimplemented from Component.
| void GroupComponent::colourChanged | ( | ) | [virtual] |
This method is called when a colour is changed by the setColour() method.
Reimplemented from Component.