2023-07-17 13:37:36 +00:00
|
|
|
#pragma once
|
|
|
|
#include <JuceHeader.h>
|
|
|
|
#include "SliderTextBox.h"
|
|
|
|
|
|
|
|
class LabelledTextBox : public juce::Component {
|
|
|
|
public:
|
2023-12-21 18:31:18 +00:00
|
|
|
LabelledTextBox(juce::String text, double min = -999999, double max = 999999, double step = 0.01) : textBox(min, max, step) {
|
2023-07-17 13:37:36 +00:00
|
|
|
addAndMakeVisible(label);
|
|
|
|
addAndMakeVisible(textBox);
|
|
|
|
label.setText(text, juce::dontSendNotification);
|
|
|
|
label.setJustificationType(juce::Justification::centredLeft);
|
|
|
|
label.setFont(juce::Font(14.0f));
|
|
|
|
}
|
|
|
|
|
|
|
|
~LabelledTextBox() override {}
|
|
|
|
|
|
|
|
void resized() override {
|
|
|
|
auto bounds = getLocalBounds();
|
|
|
|
textBox.setBounds(bounds.removeFromRight(90));
|
|
|
|
label.setBounds(bounds);
|
|
|
|
}
|
|
|
|
|
|
|
|
juce::Label label;
|
|
|
|
SliderTextBox textBox;
|
|
|
|
};
|