From 79e3a141d2febca846a44883efb6f6c7a4fc3c26 Mon Sep 17 00:00:00 2001 From: Timur Doumler Date: Wed, 12 Aug 2015 10:13:44 +0100 Subject: [PATCH] Fixed a bug in TextPropertyComponent that broke the Introjucer's GUI editor. --- .../properties/juce_TextPropertyComponent.cpp | 5 +++++ .../juce_gui_basics/properties/juce_TextPropertyComponent.h | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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. */