Vital
Loading...
Searching...
No Matches
text_selector.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include "JuceHeader.h"
7#include "synth_slider.h"
8
14class TextSelector : public SynthSlider {
15public:
18 TextSelector(String name);
19
22 void mouseDown(const MouseEvent& e) override;
23
26 void mouseUp(const MouseEvent& e) override;
27
30 bool shouldShowPopup() override { return false; }
31
34 void setLongStringLookup(const std::string* lookup) { long_lookup_ = lookup; }
35
36protected:
37 const std::string* long_lookup_;
38
39 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(TextSelector)
40};
41
48public:
51 PaintPatternSelector(String name) : TextSelector(name), padding_(0) { }
52
55 void paint(Graphics& g) override;
56
59 void setPadding(int padding) { padding_ = padding; }
60
61private:
62 int padding_;
63
64 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PaintPatternSelector)
65};
A specialized TextSelector that draws a visual pattern instead of text.
Definition text_selector.h:47
void setPadding(int padding)
Definition text_selector.h:59
PaintPatternSelector(String name)
Definition text_selector.h:51
void paint(Graphics &g) override
Definition text_selector.cpp:44
A specialized slider with extended functionality for modulation, parameter control,...
Definition synth_slider.h:314
A specialized SynthSlider that displays a popup menu of text options.
Definition text_selector.h:14
void mouseDown(const MouseEvent &e) override
Definition text_selector.cpp:17
bool shouldShowPopup() override
Definition text_selector.h:30
void setLongStringLookup(const std::string *lookup)
Definition text_selector.h:34
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 SynthSlider and related classes, providing various slider styles and functionality in th...