OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
numericeditbox.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_NUMERIC_EDIT_BOX_H
2 #define OPENMW_NUMERIC_EDIT_BOX_H
3 
4 #include <MyGUI_EditBox.h>
5 
6 #include "fontwrapper.hpp"
7 
8 namespace Gui
9 {
10 
14  class NumericEditBox : public FontWrapper<MyGUI::EditBox>
15  {
16  MYGUI_RTTI_DERIVED(NumericEditBox)
17 
18  public:
20  : mValue(0), mMinValue(std::numeric_limits<int>::min()),
21  mMaxValue(std::numeric_limits<int>::max())
22  {
23  }
24 
25  void initialiseOverride();
26  void shutdownOverride();
27 
28  typedef MyGUI::delegates::CMultiDelegate1<int> EventHandle_ValueChanged;
30 
32  void setValue (int value);
33  int getValue();
34 
35  void setMinValue(int minValue);
36  void setMaxValue(int maxValue);
37  private:
38  void onEditTextChange(MyGUI::EditBox* sender);
39  void onKeyLostFocus(MyGUI::Widget* _new);
40  void onKeyButtonPressed(MyGUI::KeyCode key, MyGUI::Char character);
41 
42  int mValue;
43 
44  int mMinValue;
45  int mMaxValue;
46  };
47 
48 }
49 
50 #endif
A variant of the EditBox that only allows integer inputs.
Definition: numericeditbox.hpp:14
EventHandle_ValueChanged eventValueChanged
Definition: numericeditbox.hpp:29
void onKeyButtonPressed(MyGUI::KeyCode key, MyGUI::Char character)
Definition: numericeditbox.cpp:83
void shutdownOverride()
Definition: numericeditbox.cpp:17
void onEditTextChange(MyGUI::EditBox *sender)
Definition: numericeditbox.cpp:23
void setMinValue(int minValue)
Definition: numericeditbox.cpp:67
MyGUI::delegates::CMultiDelegate1< int > EventHandle_ValueChanged
Definition: numericeditbox.hpp:28
void onKeyLostFocus(MyGUI::Widget *_new)
Definition: numericeditbox.cpp:77
int getValue()
Definition: numericeditbox.cpp:62
void setValue(int value)
Definition: numericeditbox.cpp:53
Definition: fontwrapper.hpp:11
void setMaxValue(int maxValue)
Definition: numericeditbox.cpp:72
int mMaxValue
Definition: numericeditbox.hpp:45
int mValue
Definition: numericeditbox.hpp:42
int mMinValue
Definition: numericeditbox.hpp:44
void initialiseOverride()
Definition: numericeditbox.cpp:8
NumericEditBox()
Definition: numericeditbox.hpp:19
KeyCode
Keyboard scan codes.
Definition: OISCompat.hpp:10