Browse Source

added ComboBox::showEditor() method

tags/2021-05-28
jules 18 years ago
parent
commit
7e2136a6e5
2 changed files with 15 additions and 1 deletions
  1. +8
    -1
      src/juce_appframework/gui/components/controls/juce_ComboBox.cpp
  2. +7
    -0
      src/juce_appframework/gui/components/controls/juce_ComboBox.h

+ 8
- 1
src/juce_appframework/gui/components/controls/juce_ComboBox.cpp View File

@@ -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()
{


+ 7
- 0
src/juce_appframework/gui/components/controls/juce_ComboBox.h View File

@@ -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();


Loading…
Cancel
Save