mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-31 03:00:05 +00:00
Added Value support to Labels and ComboBoxes. Altered all the PropertyComponent classes so that as well as being used as abstract base classes, they can now also be instantiated directly as controllers for a Value. This allows property panels to be built to control a set of Value objects without writing any custom classes.
This commit is contained in:
parent
55306275b1
commit
e73a0fb874
17 changed files with 129392 additions and 181113 deletions
|
|
@ -79,9 +79,40 @@ public:
|
|||
|
||||
//==============================================================================
|
||||
TextPropertyComponent::TextPropertyComponent (const String& name,
|
||||
const int maxNumChars,
|
||||
const bool isMultiLine)
|
||||
const int maxNumChars,
|
||||
const bool isMultiLine)
|
||||
: PropertyComponent (name)
|
||||
{
|
||||
createEditor (maxNumChars, isMultiLine);
|
||||
}
|
||||
|
||||
TextPropertyComponent::TextPropertyComponent (const Value& valueToControl,
|
||||
const String& name,
|
||||
const int maxNumChars,
|
||||
const bool isMultiLine)
|
||||
: PropertyComponent (name)
|
||||
{
|
||||
createEditor (maxNumChars, isMultiLine);
|
||||
|
||||
textEditor->getTextValue().referTo (valueToControl);
|
||||
}
|
||||
|
||||
TextPropertyComponent::~TextPropertyComponent()
|
||||
{
|
||||
deleteAllChildren();
|
||||
}
|
||||
|
||||
void TextPropertyComponent::setText (const String& newText)
|
||||
{
|
||||
textEditor->setText (newText, true);
|
||||
}
|
||||
|
||||
const String TextPropertyComponent::getText() const
|
||||
{
|
||||
return textEditor->getText();
|
||||
}
|
||||
|
||||
void TextPropertyComponent::createEditor (const int maxNumChars, const bool isMultiLine)
|
||||
{
|
||||
addAndMakeVisible (textEditor = new TextPropLabel (*this, maxNumChars, isMultiLine));
|
||||
|
||||
|
|
@ -92,11 +123,6 @@ TextPropertyComponent::TextPropertyComponent (const String& name,
|
|||
}
|
||||
}
|
||||
|
||||
TextPropertyComponent::~TextPropertyComponent()
|
||||
{
|
||||
deleteAllChildren();
|
||||
}
|
||||
|
||||
void TextPropertyComponent::refresh()
|
||||
{
|
||||
textEditor->setText (getText(), false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue