diff --git a/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp b/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp index 81ce960ec5..cf70411284 100644 --- a/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp +++ b/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp @@ -151,11 +151,12 @@ private: //============================================================================== TextPropertyComponent::TextPropertyComponent (const String& name, int maxNumChars, - bool isMultiLine, + bool multiLine, bool isEditable) - : PropertyComponent (name) + : PropertyComponent (name), + isMultiLine (multiLine) { - createEditor (maxNumChars, isMultiLine, isEditable); + createEditor (maxNumChars, isEditable); } TextPropertyComponent::TextPropertyComponent (const Value& valueToControl, @@ -198,7 +199,7 @@ Value& TextPropertyComponent::getValue() const return textEditor->getTextValue(); } -void TextPropertyComponent::createEditor (int maxNumChars, bool isMultiLine, bool isEditable) +void TextPropertyComponent::createEditor (int maxNumChars, bool isEditable) { textEditor.reset (new LabelComp (*this, maxNumChars, isMultiLine, isEditable)); addAndMakeVisible (textEditor.get()); diff --git a/modules/juce_gui_basics/properties/juce_TextPropertyComponent.h b/modules/juce_gui_basics/properties/juce_TextPropertyComponent.h index 8d42d34578..46f3407f2e 100644 --- a/modules/juce_gui_basics/properties/juce_TextPropertyComponent.h +++ b/modules/juce_gui_basics/properties/juce_TextPropertyComponent.h @@ -106,6 +106,10 @@ public: /** Returns the text that should be shown in the text editor as a Value object. */ Value& getValue() const; + //============================================================================== + /** Returns true if the text editor allows carriage returns. */ + bool isTextEditorMultiLine() const noexcept { return isMultiLine; } + //============================================================================== /** A set of colour IDs to use to change the colour of various aspects of the component. @@ -164,6 +168,8 @@ public: virtual void textWasEdited(); private: + bool isMultiLine; + class RemapperValueSourceWithDefault; class LabelComp; @@ -173,7 +179,7 @@ private: ListenerList listenerList; void callListeners(); - void createEditor (int maxNumChars, bool isMultiLine, bool isEditable); + void createEditor (int maxNumChars, bool isEditable); JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TextPropertyComponent) };