diff --git a/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp b/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp index c9aa689836..f765cd0a0f 100644 --- a/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp +++ b/modules/juce_gui_basics/properties/juce_TextPropertyComponent.cpp @@ -138,6 +138,11 @@ void TextPropertyComponent::refresh() void TextPropertyComponent::textWasEdited() { + const String newText (textEditor->getText()); + + if (getText() != newText) + setText (newText); + callListeners(); } diff --git a/modules/juce_gui_basics/properties/juce_TextPropertyComponent.h b/modules/juce_gui_basics/properties/juce_TextPropertyComponent.h index 1005d6a26f..fe1f2c1ac9 100644 --- a/modules/juce_gui_basics/properties/juce_TextPropertyComponent.h +++ b/modules/juce_gui_basics/properties/juce_TextPropertyComponent.h @@ -64,7 +64,11 @@ public: ~TextPropertyComponent(); //============================================================================== - /** Set the value of the text shown in the text editor to the specified string. */ + /** Called when the user edits the text. + + Your subclass must use this callback to change the value of whatever item + this property component represents. + */ virtual void setText (const String& newText); /** Returns the text that should be shown in the text editor. */