forked from teamnwah/openmw-tes3coop
Support Up/DownArrow keys to change NumericEditBox value
This commit is contained in:
parent
67dc4e019a
commit
76ddf8d794
2 changed files with 17 additions and 0 deletions
|
@ -75,4 +75,20 @@ namespace Gui
|
||||||
setCaption(MyGUI::utility::toString(mValue));
|
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));
|
||||||
|
eventValueChanged(mValue);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Base::onKeyButtonPressed(key, character);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ namespace Gui
|
||||||
private:
|
private:
|
||||||
void onEditTextChange(MyGUI::EditBox* sender);
|
void onEditTextChange(MyGUI::EditBox* sender);
|
||||||
void onKeyLostFocus(MyGUI::Widget* _new);
|
void onKeyLostFocus(MyGUI::Widget* _new);
|
||||||
|
void onKeyButtonPressed(MyGUI::KeyCode key, MyGUI::Char character);
|
||||||
|
|
||||||
int mValue;
|
int mValue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue