![]() |
ManaPlus
|
#include <inttextfield.h>
Public Member Functions | |
| IntTextField (const Widget2 *const widget, const int def, const int min, const int max, const Enable enabled, const int width) | |
| void | setRange (const int minimum, const int maximum) |
| int | getValue () const |
| void | reset () |
| void | setValue (const int value) |
| void | setDefaultValue (const int value) |
| void | keyPressed (KeyEvent &event) |
Public Member Functions inherited from TextField | |
| TextField (const Widget2 *const widget, const std::string &text, const LoseFocusOnTab loseFocusOnTab, ActionListener *const listener, const std::string &eventId, const bool sendAlwaysEvents) | |
| ~TextField () | |
| void | draw (Graphics *const graphics) |
| void | safeDraw (Graphics *const graphics) |
| void | updateAlpha () |
| void | drawFrame (Graphics *const graphics) |
| void | safeDrawFrame (Graphics *const graphics) |
| void | setNumeric (const bool numeric) |
| void | setRange (const int min, const int max) |
| void | keyPressed (KeyEvent &event) |
| void | setMinimum (const int min) |
| void | setMaximum (const int max) |
| int | getValue () const |
| void | setSendAlwaysEvents (const bool b) |
| void | adjustSize () |
| void | adjustHeight () |
| void | setCaretPosition (unsigned int position) |
| void | mousePressed (MouseEvent &event) |
| void | handlePaste () |
| void | handleCopy () const |
| void | focusGained (const Event &event) |
| void | focusLost (const Event &event) |
| void | moveCaretBack () |
| void | moveCaretForward () |
| void | moveCaretWordBack () |
| void | moveCaretWordForward () |
| void | caretDelete () |
| void | caretDeleteToStart () |
| void | caretDeleteWord () |
| void | setAllowSpecialActions (const bool b) |
| std::string | getTextBeforeCaret () const |
| void | setText (const std::string &text) |
| const std::string & | getText () const |
| unsigned int | getCaretPosition () const |
| void | mouseDragged (MouseEvent &event) |
| void | widgetHidden (const Event &event) |
| void | setParent (Widget *widget) |
| void | setWindow (Widget *const widget) |
| void | signalEvent () |
Public Member Functions inherited from Widget | |
| Widget (const Widget2 *const widget) | |
| ~Widget () | |
| void | setFrameSize (const unsigned int frameSize) |
| unsigned int | getFrameSize () const |
| virtual void | logic () |
| Widget * | getParent () const |
| void | setWidth (const int width) |
| int | getWidth () const |
| void | setHeight (const int height) |
| int | getHeight () const |
| void | setSize (const int width, const int height) |
| void | setX (const int x) |
| int | getX () const |
| void | setY (const int y) |
| int | getY () const |
| void | setPosition (const int x, const int y) |
| void | setDimension (const Rect &dimension) |
| const Rect & | getDimension () const |
| void | setFocusable (const bool focusable) |
| bool | isFocusable () const |
| virtual bool | isFocused () const |
| void | setEnabled (const bool enabled) |
| bool | isEnabled () const |
| void | setVisible (Visible visible) |
| bool | isVisible () const |
| void | setBaseColor (const Color &color) |
| const Color & | getBaseColor () const |
| void | setForegroundColor (const Color &color) |
| const Color & | getForegroundColor () const |
| void | setBackgroundColor (const Color &color) |
| const Color & | getBackgroundColor () const |
| virtual void | requestFocus () |
| virtual void | requestMoveToTop () |
| virtual void | requestMoveToBottom () |
| virtual void | setFocusHandler (FocusHandler *const focusHandler) |
| FocusHandler * | getFocusHandler () |
| void | addActionListener (ActionListener *const actionListener) |
| void | removeActionListener (ActionListener *const actionListener) |
| void | addDeathListener (WidgetDeathListener *const deathListener) |
| void | removeDeathListener (WidgetDeathListener *const deathListener) |
| void | addMouseListener (MouseListener *const mouseListener) |
| void | removeMouseListener (MouseListener *const mouseListener) |
| void | addKeyListener (KeyListener *const keyListener) |
| void | removeKeyListener (KeyListener *const keyListener) |
| void | addFocusListener (FocusListener *const focusListener) |
| void | removeFocusListener (FocusListener *const focusListener) |
| void | addWidgetListener (WidgetListener *const widgetListener) |
| void | removeWidgetListener (WidgetListener *const widgetListener) |
| void | setActionEventId (const std::string &actionEventId) |
| const std::string & | getActionEventId () const |
| virtual void | getAbsolutePosition (int &x, int &y) const |
| Font * | getFont () const |
| void | setFont (Font *const font) |
| bool | isTabInEnabled () const |
| void | setTabInEnabled (const bool enabled) |
| bool | isTabOutEnabled () const |
| void | setTabOutEnabled (const bool enabled) |
| void | requestModalFocus () |
| virtual void | requestModalMouseInputFocus () |
| virtual void | releaseModalFocus () |
| virtual void | releaseModalMouseInputFocus () |
| virtual bool | isModalFocused () const |
| virtual bool | isModalMouseInputFocused () const |
| virtual Widget * | getWidgetAt (int x, int y) |
| const std::list< MouseListener * > & | getMouseListeners () const A_CONST |
| const std::list< KeyListener * > & | getKeyListeners () const A_CONST |
| const std::list< FocusListener * > & | getFocusListeners () const A_CONST |
| virtual Rect | getChildrenArea () |
| virtual FocusHandler * | getInternalFocusHandler () |
| void | setInternalFocusHandler (FocusHandler *const internalFocusHandler) |
| virtual void | moveToTop (Widget *widget) |
| virtual void | moveToBottom (Widget *widget) |
| virtual void | focusNext () |
| virtual void | focusPrevious () |
| virtual void | showWidgetPart (Widget *const widget, const Rect &area) |
| void | setId (const std::string &id) |
| const std::string & | getId () const |
| virtual void | showPart (const Rect &rectangle) |
| bool | isAllowLogic () const |
| void | setMouseConsume (const bool b) |
| bool | isMouseConsume () const |
| void | setRedraw (const bool b) |
| virtual bool | isSelectable () const |
| void | setSelectable (const bool selectable) |
| void | windowResized () |
| virtual void | postInit () |
Public Member Functions inherited from Widget2 | |
| virtual | ~Widget2 () |
| const Color & | getThemeColor (const ThemeColorIdT type, const unsigned int alpha) const A_INLINE |
| const Color & | getThemeCharColor (const signed char c, bool &valid) const A_INLINE |
| virtual void | setWidget2 (const Widget2 *const widget) |
| void | setPalette (int palette) |
| void | checkPalette () |
| void | setForegroundColor2 (const Color &color) |
| Widget * | getWindow () const |
Public Member Functions inherited from FocusListener | |
| virtual | ~FocusListener () |
Public Member Functions inherited from KeyListener | |
| virtual | ~KeyListener () |
| virtual void | keyReleased (KeyEvent &event) |
Public Member Functions inherited from MouseListener | |
| virtual | ~MouseListener () |
| virtual void | mouseEntered (MouseEvent &event) |
| virtual void | mouseExited (MouseEvent &event) |
| virtual void | mouseReleased (MouseEvent &event) |
| virtual void | mouseClicked (MouseEvent &event) |
| virtual void | mouseWheelMovedUp (MouseEvent &event) |
| virtual void | mouseWheelMovedDown (MouseEvent &event) |
| virtual void | mouseMoved (MouseEvent &event) |
Public Member Functions inherited from WidgetListener | |
| virtual | ~WidgetListener () |
| virtual void | widgetResized (const Event &event) |
| virtual void | widgetMoved (const Event &event) |
| virtual void | widgetShown (const Event &event) |
Private Attributes | |
| int | mMin |
| int | mMax |
| int | mDefault |
| int | mValue |
Additional Inherited Members | |
Static Public Member Functions inherited from Widget | |
| static void | setGlobalFont (Font *const font) |
| static Font * | getGloablFont () |
| static void | cleanGlobalFont () |
| static bool | widgetExists (const Widget *const widget) |
| static void | distributeWindowResizeEvent () |
| static Widget * | callPostInit (Widget *const widget) |
Data Fields inherited from Widget | |
| Visible | mVisible |
Protected Types inherited from Widget | |
| typedef std::list< MouseListener * > | MouseListenerList |
| typedef MouseListenerList::iterator | MouseListenerIterator |
| typedef std::list< KeyListener * > | KeyListenerList |
| typedef KeyListenerList::iterator | KeyListenerIterator |
| typedef std::list< ActionListener * > | ActionListenerList |
| typedef ActionListenerList::iterator | ActionListenerIterator |
| typedef std::list< WidgetDeathListener * > | WidgetDeathListenerList |
| typedef WidgetDeathListenerList::iterator | WidgetDeathListenerIterator |
| typedef std::list< FocusListener * > | FocusListenerList |
| typedef FocusListenerList::iterator | FocusListenerIterator |
| typedef std::list< WidgetListener * > | WidgetListenerList |
| typedef WidgetListenerList::iterator | WidgetListenerIterator |
Protected Member Functions inherited from TextField | |
| void | drawCaret (Graphics *graphics, int x) |
| void | fixScroll () |
| void | fontChanged () |
| bool | handleNormalKeys (const InputActionT action, bool &consumed) |
| void | handleCtrlKeys (const InputActionT action, bool &consumed) |
Protected Member Functions inherited from Widget | |
| void | distributeActionEvent () |
| void | distributeResizedEvent () |
| void | distributeMovedEvent () |
| void | distributeHiddenEvent () |
| void | distributeShownEvent () |
Protected Member Functions inherited from Widget2 | |
| Widget2 (const Widget2 *const widget) | |
Protected Member Functions inherited from FocusListener | |
| FocusListener () | |
Protected Member Functions inherited from KeyListener | |
| KeyListener () | |
Protected Member Functions inherited from MouseListener | |
| MouseListener () | |
Protected Member Functions inherited from WidgetListener | |
| WidgetListener () | |
Protected Attributes inherited from TextField | |
| std::string | mText |
| TextChunk | mTextChunk |
| unsigned int | mCaretPosition |
| int | mXScroll |
| const Color * | mCaretColor |
| int | mMinimum |
| int | mMaximum |
| time_t | mLastEventPaste |
| int | mPadding |
| bool | mNumeric |
| LoseFocusOnTab | mLoseFocusOnTab |
| bool | mAllowSpecialActions |
| bool | mSendAlwaysEvents |
| bool | mTextChanged |
Protected Attributes inherited from Widget | |
| MouseListenerList | mMouseListeners |
| KeyListenerList | mKeyListeners |
| ActionListenerList | mActionListeners |
| WidgetDeathListenerList | mDeathListeners |
| FocusListenerList | mFocusListeners |
| WidgetListenerList | mWidgetListeners |
| Color | mForegroundColor |
| Color | mBackgroundColor |
| Color | mBaseColor |
| Rect | mDimension |
| std::string | mActionEventId |
| std::string | mId |
| FocusHandler * | mFocusHandler |
| FocusHandler * | mInternalFocusHandler |
| Widget * | mParent |
| Font * | mCurrentFont |
| unsigned int | mFrameSize |
| bool | mFocusable |
| bool | mTabIn |
| bool | mTabOut |
| bool | mEnabled |
| bool | mAllowLogic |
| bool | mMouseConsume |
| bool | mRedraw |
| bool | mSelectable |
Protected Attributes inherited from Widget2 | |
| int | mPaletteOffset |
| Widget * | mWindow |
| Color | mForegroundColor2 |
Static Protected Attributes inherited from TextField | |
| static Skin * | mSkin |
| static int | instances = 0 |
| static float | mAlpha = 1.0 |
| static ImageRect | skin |
Static Protected Attributes inherited from Widget | |
| static Font * | mGlobalFont = 0 |
TextBox which only accepts numbers as input.
Definition at line 34 of file inttextfield.h.
| IntTextField::IntTextField | ( | const Widget2 *const | widget, |
| const int | def, | ||
| const int | min, | ||
| const int | max, | ||
| const Enable | enabled, | ||
| const int | width | ||
| ) |
Constructor, sets default value.
Definition at line 36 of file inttextfield.cpp.
References Enable_true, Widget::setEnabled(), setRange(), and Widget::setWidth().
| int IntTextField::getValue | ( | ) | const |
Returns the value in the text box.
Definition at line 118 of file inttextfield.cpp.
References TextField::getText(), mMin, and mValue.
Referenced by BankWindow::action(), BuyDialog::action(), EditServerDialog::action(), ItemAmountWindow::action(), NpcDialog::action(), ItemAmountWindow::keyReleased(), NpcDialog::move(), TextCommandEditor::save(), and MailEditWindow::sendMail().
|
virtual |
Responds to key presses.
Reimplemented from KeyListener.
Definition at line 57 of file inttextfield.cpp.
References Widget::distributeActionEvent(), KeyEvent::getKey(), TextField::getText(), InputAction::GUI_BACKSPACE, InputAction::GUI_DELETE, Key::isNumber(), TextField::keyPressed(), TextField::mSendAlwaysEvents, TextField::setText(), setValue(), and KeyValue::TEXTINPUT.
| void IntTextField::reset | ( | ) |
Reset the field to the default value.
Definition at line 147 of file inttextfield.cpp.
References mDefault, and setValue().
| void IntTextField::setDefaultValue | ( | const int | value | ) |
| void IntTextField::setRange | ( | const int | minimum, |
| const int | maximum | ||
| ) |
Sets the minimum and maximum values of the text box.
Definition at line 102 of file inttextfield.cpp.
References mDefault, mMax, mMin, and mValue.
Referenced by NpcDialog::integerRequest(), IntTextField(), ItemAmountWindow::ItemAmountWindow(), TextCommandEditor::TextCommandEditor(), and BuyDialog::valueChanged().
| void IntTextField::setValue | ( | const int | value | ) |
Set the value of the text box to the specified value.
Definition at line 123 of file inttextfield.cpp.
References CAST_U32, mMax, mMin, mValue, TextField::setCaretPosition(), TextField::setText(), and Catch::toString().
Referenced by SetupItemIntTextField::action(), BuyDialog::action(), ItemAmountWindow::action(), NpcDialog::action(), EditServerDialog::EditServerDialog(), NpcDialog::integerRequest(), keyPressed(), NpcDialog::move(), reset(), ItemAmountWindow::resetAmount(), TextCommandEditor::TextCommandEditor(), and BuyDialog::valueChanged().
|
private |
Default value
Definition at line 82 of file inttextfield.h.
Referenced by reset(), setDefaultValue(), and setRange().
|
private |
Maximum value
Definition at line 81 of file inttextfield.h.
Referenced by setDefaultValue(), setRange(), and setValue().
|
private |
Minimum value
Definition at line 80 of file inttextfield.h.
Referenced by getValue(), setDefaultValue(), setRange(), and setValue().
|
private |
Current value
Definition at line 83 of file inttextfield.h.
Referenced by getValue(), setRange(), and setValue().