25 use_on_colors_(false), shape_(
"shape") {
32 if (findParentComponentOfClass<SynthGuiInterface>())
96 Colour off_normal_color_;
97 Colour off_hover_color_;
98 Colour off_down_color_;
99 Colour on_normal_color_;
100 Colour on_hover_color_;
101 Colour on_down_color_;
132 ToggleButton::resized();
139 ToggleButton::mouseEnter(e);
146 ToggleButton::mouseExit(e);
153 ToggleButton::mouseDown(e);
160 ToggleButton::mouseUp(e);
200 addChildComponent(
text_);
262 if (!
text.isEmpty()) {
354 void setActive(
bool active =
true) { active_ = active; }
406 ToggleButton::enablementChanged();
413 ToggleButton::mouseEnter(e);
420 ToggleButton::mouseExit(e);
427 ToggleButton::mouseDown(e);
428 button_component_.
setDown(
true);
434 ToggleButton::mouseUp(e);
435 button_component_.
setDown(
false);
478 string_lookup_ = lookup;
496 virtual void mouseDown(
const MouseEvent& e)
override;
501 virtual void mouseUp(
const MouseEvent& e)
override;
510 OpenGlToggleButton::clicked();
512 setText(string_lookup_[getToggleState() ? 1 : 0]);
518 void clicked(
const ModifierKeys& modifiers)
override;
520 const std::string* string_lookup_;
521 std::vector<ButtonListener*> button_listeners_;
523 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(
SynthButton)
A base component class that integrates JUCE's Component with OpenGL rendering.
Definition open_gl_component.h:20
virtual void destroy(OpenGlWrapper &open_gl)
Destroys any OpenGL-specific resources allocated by this component.
Definition open_gl_component.cpp:168
virtual void init(OpenGlWrapper &open_gl)
Initializes any OpenGL-specific resources needed by the component.
Definition open_gl_component.cpp:148
void setComponent(Component *component)
Sets the component to be drawn into the OpenGL image. If not set, uses this component.
Definition open_gl_image_component.h:83
void setActive(bool active)
Sets whether this component is active (rendered) or not.
Definition open_gl_image_component.h:113
virtual void init(OpenGlWrapper &open_gl) override
Initializes any OpenGL resources for rendering this component.
Definition open_gl_image_component.cpp:57
virtual void destroy(OpenGlWrapper &open_gl) override
Destroys OpenGL-related resources used by this component.
Definition open_gl_image_component.cpp:69
void setScissor(bool scissor)
Enables or disables scissor testing when drawing the image.
Definition open_gl_image_component.h:89
virtual void redrawImage(bool force)
Redraws the image if necessary, creating or updating the internal Image.
Definition open_gl_image_component.cpp:16
virtual void init(OpenGlWrapper &open_gl) override
Initializes OpenGL buffers and shader attributes.
Definition open_gl_multi_quad.cpp:37
void setQuad(int i, float x, float y, float w, float h)
Sets the position and size of a quad in normalized device space.
Definition open_gl_multi_quad.h:313
void setTargetComponent(Component *target_component)
Sets a target component to help position the quads.
Definition open_gl_multi_quad.h:358
void setFragmentShader(Shaders::FragmentShader shader)
Sets the fragment shader used to render the quads.
Definition open_gl_multi_quad.h:86
virtual void destroy(OpenGlWrapper &open_gl) override
Releases OpenGL resources when the component is destroyed.
Definition open_gl_multi_quad.cpp:69
force_inline void setColor(Colour color)
Sets the base color for the quads.
Definition open_gl_multi_quad.h:102
A convenience class for a single quad rendered via OpenGL.
Definition open_gl_multi_quad.h:447
A component that draws a shape into an OpenGlImageComponent.
Definition open_gl_image_component.h:417
void setShape(Path shape)
Sets the shape to be drawn.
Definition open_gl_image_component.h:441
A text component rendered into an OpenGlImageComponent with configurable font and justification.
Definition open_gl_image_component.h:301
@ kMono
Definition open_gl_image_component.h:311
void setText(String text)
Sets the displayed text and redraws the image.
Definition open_gl_image_component.h:336
void setJustification(Justification justification)
Sets the text justification (e.g., centered, left, right).
Definition open_gl_image_component.h:389
void setFontType(FontType font_type)
Sets the font type (Title, Light, Regular, Mono).
Definition open_gl_image_component.h:381
Manages and provides access to vertex and fragment shaders used by the OpenGL rendering pipeline.
Definition shaders.h:19
@ kCircleFragment
Definition shaders.h:65
@ kIconButtonOff
Definition skin.h:185
@ kIconButtonOn
Definition skin.h:188
@ kIconButtonOffHover
Definition skin.h:186
@ kIconButtonOffPressed
Definition skin.h:187
@ kIconButtonOnPressed
Definition skin.h:190
@ kIconButtonOnHover
Definition skin.h:189
A helper struct containing references to OpenGL context, shaders, and display scale.
Definition shaders.h:174