summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textfield.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-09 00:47:31 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-09 00:47:57 +0300
commite72f26151bca6c5a73d0377e385c0f7dd7cab3aa (patch)
tree6960f1846e0258a5f3658cae6e2f40f643074e3f /src/gui/widgets/textfield.cpp
parentf1c17766c66394ce875854430f8f028c0fa5b3a5 (diff)
downloadmanaplus-e72f26151bca6c5a73d0377e385c0f7dd7cab3aa.tar.gz
manaplus-e72f26151bca6c5a73d0377e385c0f7dd7cab3aa.tar.bz2
manaplus-e72f26151bca6c5a73d0377e385c0f7dd7cab3aa.tar.xz
manaplus-e72f26151bca6c5a73d0377e385c0f7dd7cab3aa.zip
Add to inventory filter by letters from item names.
Diffstat (limited to 'src/gui/widgets/textfield.cpp')
-rw-r--r--src/gui/widgets/textfield.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index d9f5bed9a..5d4fbc0b4 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -48,12 +48,14 @@ float TextField::mAlpha = 1.0;
ImageRect TextField::skin;
TextField::TextField(const std::string &text, bool loseFocusOnTab,
- gcn::ActionListener* listener, std::string eventId):
+ gcn::ActionListener* listener, std::string eventId,
+ bool sendAlwaysEvents):
gcn::TextField(text),
mNumeric(false),
mMinimum(0),
mMaximum(0),
- mLastEventPaste(false)
+ mLastEventPaste(false),
+ mSendAlwaysEvents(sendAlwaysEvents)
{
setFrameSize(2);
@@ -276,7 +278,9 @@ void TextField::keyPressed(gcn::KeyEvent &keyEvent)
case Key::ENTER:
distributeActionEvent();
- break;
+ keyEvent.consume();
+ fixScroll();
+ return;
case Key::HOME:
mCaretPosition = 0;
@@ -337,6 +341,9 @@ void TextField::keyPressed(gcn::KeyEvent &keyEvent)
break;
}
+ if (mSendAlwaysEvents)
+ distributeActionEvent();
+
keyEvent.consume();
fixScroll();
}