diff --git a/src/juce_appframework/gui/components/controls/juce_ComboBox.cpp b/src/juce_appframework/gui/components/controls/juce_ComboBox.cpp index 0956c1be14..80c497f02f 100644 --- a/src/juce_appframework/gui/components/controls/juce_ComboBox.cpp +++ b/src/juce_appframework/gui/components/controls/juce_ComboBox.cpp @@ -81,7 +81,7 @@ void ComboBox::setEditableText (const bool isEditable) bool ComboBox::isTextEditable() const throw() { - return label->isEditableOnDoubleClick() || label->isEditableOnSingleClick(); + return label->isEditable(); } void ComboBox::setJustificationType (const Justification& justification) throw() @@ -376,6 +376,13 @@ void ComboBox::setText (const String& newText, repaint(); } +void ComboBox::showEditor() +{ + jassert (isTextEditable()); // you probably shouldn't do this to a non-editable combo box? + + label->showEditor(); +} + //============================================================================== void ComboBox::setTextWhenNothingSelected (const String& newMessage) throw() { diff --git a/src/juce_appframework/gui/components/controls/juce_ComboBox.h b/src/juce_appframework/gui/components/controls/juce_ComboBox.h index 28e78c0cf6..f824ef6007 100644 --- a/src/juce_appframework/gui/components/controls/juce_ComboBox.h +++ b/src/juce_appframework/gui/components/controls/juce_ComboBox.h @@ -264,6 +264,13 @@ public: void setText (const String& newText, const bool dontSendChangeMessage = false) throw(); + /** Programmatically opens the text editor to allow the user to edit the current item. + + This is the same effect as when the box is clicked-on. + @see Label::showEditor(); + */ + void showEditor(); + //============================================================================== /** Registers a listener that will be called when the box's content changes. */ void addListener (ComboBoxListener* const listener) throw();