Vital
Loading...
Searching...
No Matches
CurveLookAndFeel Class Reference

A specialized LookAndFeel class for drawing curve-shaped rotary sliders. More...

#include <curve_look_and_feel.h>

Inheritance diagram for CurveLookAndFeel:
DefaultLookAndFeel

Public Member Functions

virtual ~CurveLookAndFeel ()
 Destructor.
 
void drawRotarySlider (Graphics &g, int x, int y, int width, int height, float slider_t, float start_angle, float end_angle, Slider &slider) override
 Draws a rotary slider with a curve-shaped indicator.
 
void drawCurve (Graphics &g, Slider &slider, int x, int y, int width, int height, bool active, bool bipolar)
 Draws the power-scale curve for the slider.
 
- Public Member Functions inherited from DefaultLookAndFeel
 ~DefaultLookAndFeel ()
 Destructor.
 
virtual int getPopupMenuBorderSize () override
 Returns the border size for popup menus.
 
void drawTextEditorOutline (Graphics &g, int width, int height, TextEditor &text_editor) override
 Draws no outline for TextEditors by default.
 
void fillTextEditorBackground (Graphics &g, int width, int height, TextEditor &text_editor) override
 Fills the background of a TextEditor with a rounded rectangle and border.
 
void drawPopupMenuBackground (Graphics &g, int width, int height) override
 Draws the background for a popup menu with a rounded rectangle and border.
 
virtual void drawScrollbar (Graphics &g, ScrollBar &scroll_bar, int x, int y, int width, int height, bool vertical, int thumb_position, int thumb_size, bool mouse_over, bool mouse_down) override
 Draws a custom scrollbar, potentially aligned differently if it's a LeftAlignedScrollBar.
 
void drawComboBox (Graphics &g, int width, int height, const bool button_down, int button_x, int button_y, int button_w, int button_h, ComboBox &box) override
 Draws the background and arrow of a ComboBox.
 
void drawTickBox (Graphics &g, Component &component, float x, float y, float w, float h, bool ticked, bool enabled, bool mouse_over, bool button_down) override
 Draws a tick box (check box) with a filled rectangle if ticked.
 
void drawCallOutBoxBackground (CallOutBox &call_out_box, Graphics &g, const Path &path, Image &) override
 Draws the background of a CallOutBox with a simple rounded rectangle and stroke.
 
void drawButtonBackground (Graphics &g, Button &button, const Colour &background_color, bool hover, bool down) override
 Draws the background of a generic button, using a rounded rectangle.
 
int getSliderPopupPlacement (Slider &slider) override
 Gets the popup placement for a slider. Delegates to SynthSlider if present.
 
Font getPopupMenuFont () override
 Returns the font to use for popup menus.
 
Font getSliderPopupFont (Slider &slider) override
 Returns the font to use for slider popup text.
 
int getMenuWindowFlags () override
 Returns the window flags for menu windows. Defaults to 0.
 

Static Public Member Functions

static CurveLookAndFeelinstance ()
 Gets the singleton instance of CurveLookAndFeel.
 
- Static Public Member Functions inherited from DefaultLookAndFeel
static DefaultLookAndFeelinstance ()
 Singleton instance accessor.
 

Additional Inherited Members

- Static Public Attributes inherited from DefaultLookAndFeel
static constexpr int kPopupMenuBorder = 4
 Border size for popup menus.
 
- Protected Member Functions inherited from DefaultLookAndFeel
 DefaultLookAndFeel ()
 Protected constructor to enforce singleton usage.
 

Detailed Description

A specialized LookAndFeel class for drawing curve-shaped rotary sliders.

This LookAndFeel renders a rotary slider as a power-scale curve instead of a standard arc. The curve shape can represent a parameter's response curve visually. It supports both active/inactive states and bipolar values.

Constructor & Destructor Documentation

◆ ~CurveLookAndFeel()

virtual CurveLookAndFeel::~CurveLookAndFeel ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ drawCurve()

void CurveLookAndFeel::drawCurve ( Graphics & g,
Slider & slider,
int x,
int y,
int width,
int height,
bool active,
bool bipolar )

Draws the power-scale curve for the slider.

Parameters
gThe Graphics context.
sliderReference to the Slider being drawn.
xThe X coordinate of the curve area.
yThe Y coordinate of the curve area.
widthThe width of the curve area.
heightThe height of the curve area.
activeTrue if the slider is active (enabled).
bipolarTrue if the slider value is bipolar (e.g., can be negative).

◆ drawRotarySlider()

void CurveLookAndFeel::drawRotarySlider ( Graphics & g,
int x,
int y,
int width,
int height,
float slider_t,
float start_angle,
float end_angle,
Slider & slider )
override

Draws a rotary slider with a curve-shaped indicator.

Parameters
gThe Graphics context.
xThe X coordinate of the slider's bounding box.
yThe Y coordinate of the slider's bounding box.
widthThe width of the slider's bounding box.
heightThe height of the slider's bounding box.
slider_tThe slider's current normalized value (0 to 1).
start_angleThe start angle for the rotary slider (not used for this curve).
end_angleThe end angle for the rotary slider (not used for this curve).
sliderReference to the slider being drawn.

◆ instance()

static CurveLookAndFeel * CurveLookAndFeel::instance ( )
inlinestatic

Gets the singleton instance of CurveLookAndFeel.

Returns
Pointer to the singleton instance.

The documentation for this class was generated from the following files: