Browse Source

added a showTextBox() method

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

+ 8
- 0
src/juce_appframework/gui/components/controls/juce_Slider.cpp View File

@@ -288,6 +288,14 @@ void Slider::setTextBoxIsEditable (const bool shouldBeEditable) throw()
valueBox->setEditable (shouldBeEditable && isEnabled());
}
void Slider::showTextBox()
{
jassert (editableText); // this should probably be avoided in read-only sliders.
if (valueBox != 0)
valueBox->showEditor();
}
void Slider::hideTextBox (const bool discardCurrentEditorContents)
{
if (valueBox != 0)


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

@@ -289,6 +289,13 @@ public:
*/
bool isTextBoxEditable() const throw() { return editableText; }
/** If the text-box is editable, this will give it the focus so that the user can
type directly into it.
This is basically the effect as the user clicking on it.
*/
void showTextBox();
/** If the text-box currently has focus and is being edited, this resets it and takes keyboard
focus away from it.


Loading…
Cancel
Save