@ -75,4 +75,20 @@ namespace Gui
setCaption(MyGUI::utility::toString(mValue));
}
void NumericEditBox::onKeyButtonPressed(MyGUI::KeyCode key, MyGUI::Char character)
{
if (key == MyGUI::KeyCode::ArrowUp)
setValue(std::min(mValue+1, mMaxValue));
eventValueChanged(mValue);
else if (key == MyGUI::KeyCode::ArrowDown)
setValue(std::max(mValue-1, mMinValue));
else
Base::onKeyButtonPressed(key, character);
@ -33,6 +33,7 @@ namespace Gui
private:
void onEditTextChange(MyGUI::EditBox* sender);
void onKeyLostFocus(MyGUI::Widget* _new);
void onKeyButtonPressed(MyGUI::KeyCode key, MyGUI::Char character);
int mValue;