18 if (e.mods.isPopupMenu()) {
26 for (
int i = 0; i <= getMaximum(); ++i)
35 if (e.mods.isPopupMenu()) {
45 static constexpr float kLineWidthHeightRatio = 0.05f;
48 int height = getHeight() - 2 * padding_ - 1;
49 int width = getWidth() - 2 * padding_ - 1;
50 float buffer = padding_ + 0.5f;
52 path.startNewSubPath(buffer, buffer + height);
53 for (
auto& pair : pattern)
54 path.lineTo(buffer + pair.first * width, buffer + (1.0f - pair.second) * height);
56 path.lineTo(buffer + width, buffer + height);
71 int line_width = getHeight() * kLineWidthHeightRatio;
72 line_width += (line_width + 1) % 2;
73 g.strokePath(path, PathStrokeType(line_width, PathStrokeType::curved, PathStrokeType::rounded));
static std::vector< std::pair< float, float > > getPaintPattern(int pattern)
Retrieves a paint pattern as a vector of (x, y) pairs.
Definition lfo_section.h:54
SynthSection * parent_
The parent SynthSection.
Definition synth_slider.h:289
bool isActive() const
Definition synth_slider.h:172
void paint(Graphics &g) override
Definition text_selector.cpp:44
@ kWidgetSecondary1
Definition skin.h:168
@ kLightenScreen
Definition skin.h:141
@ kWidgetCenterLine
Definition skin.h:164
@ kWidgetSecondary2
Definition skin.h:169
void showPopupSelector(Component *source, Point< int > position, const PopupItems &options, std::function< void(int)> callback, std::function< void()> cancel={ })
Shows a popup selector with options.
Definition synth_section.cpp:119
A specialized slider with extended functionality for modulation, parameter control,...
Definition synth_slider.h:314
virtual void mouseDown(const MouseEvent &e) override
Mouse event overrides for custom behavior.
Definition synth_slider.cpp:234
virtual void mouseUp(const MouseEvent &e) override
Definition synth_slider.cpp:302
const std::string * string_lookup_
Definition synth_slider.h:763
void mouseDown(const MouseEvent &e) override
Definition text_selector.cpp:17
const std::string * long_lookup_
Optional alternate lookup table for longer strings.
Definition text_selector.h:37
TextSelector(String name)
Constructs a TextSelector with the given name.
Definition text_selector.cpp:12
void mouseUp(const MouseEvent &e) override
Definition text_selector.cpp:34
Declares the TextSelector class and PaintPatternSelector class for selecting text-based options and d...