diff options
author | David Athay <ko2fan@gmail.com> | 2009-02-11 09:30:26 +0000 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2009-02-11 09:30:26 +0000 |
commit | 91111ca5d13072ea3b834e23835df9c077329e39 (patch) | |
tree | f0af8dd08b766164835cf9b5412a9aa3267dbad7 /src/gui/npcintegerdialog.cpp | |
parent | 8046bb2626b30fecdcea54eb0aa3349cdb7d277b (diff) | |
parent | 63ac001daa7dfc0735dfefd9c2829c8786b4edaf (diff) | |
download | mana-client-91111ca5d13072ea3b834e23835df9c077329e39.tar.gz mana-client-91111ca5d13072ea3b834e23835df9c077329e39.tar.bz2 mana-client-91111ca5d13072ea3b834e23835df9c077329e39.tar.xz mana-client-91111ca5d13072ea3b834e23835df9c077329e39.zip |
Merge branch 'master' of git@gitorious.org:tmw/eathena
Diffstat (limited to 'src/gui/npcintegerdialog.cpp')
-rw-r--r-- | src/gui/npcintegerdialog.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/gui/npcintegerdialog.cpp b/src/gui/npcintegerdialog.cpp index ec91d736..c58fc460 100644 --- a/src/gui/npcintegerdialog.cpp +++ b/src/gui/npcintegerdialog.cpp @@ -19,27 +19,23 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "npcintegerdialog.h" - -#include <limits> -#include <sstream> - #include "button.h" #include "inttextfield.h" +#include "npcintegerdialog.h" + +#include "widgets/layout.h" #include "../npc.h" #include "../utils/gettext.h" -#include "../utils/tostring.h" - -#include "widgets/layout.h" NpcIntegerDialog::NpcIntegerDialog(): Window(_("NPC Number Request")) { + mValueField = new IntTextField(); + mDecButton = new Button("-", "decvalue", this); mIncButton = new Button("+", "incvalue", this); - mValueField = new IntTextField(); okButton = new Button(_("OK"), "ok", this); cancelButton = new Button(_("Cancel"), "cancel", this); resetButton = new Button(_("Reset"), "reset", this); @@ -61,9 +57,6 @@ NpcIntegerDialog::NpcIntegerDialog(): reflowLayout(175, 0); setLocationRelativeTo(getParent()); - - mValueField->setActionEventId("valuefield"); - mValueField->addKeyListener(this); } void NpcIntegerDialog::setRange(const int min, const int max) @@ -107,5 +100,16 @@ void NpcIntegerDialog::action(const gcn::ActionEvent &event) setVisible(false); current_npc->integerInput(mValueField->getValue()); current_npc = 0; + mValueField->reset(); } } + +bool NpcIntegerDialog::isInputFocused() +{ + return mValueField->isFocused(); +} + +void NpcIntegerDialog::requestFocus() +{ + mValueField->requestFocus(); +} |