summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textfield.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-30 16:00:06 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-30 16:00:06 +0300
commit6e5d8181b830694a90bba7ad5651fa0b726e4a75 (patch)
tree27c2cc174c5b327a75604c1c99a270143879be7c /src/gui/widgets/textfield.cpp
parent8a24c37deef374bf138569d50221e34fbc97ee98 (diff)
downloadmv-6e5d8181b830694a90bba7ad5651fa0b726e4a75.tar.gz
mv-6e5d8181b830694a90bba7ad5651fa0b726e4a75.tar.bz2
mv-6e5d8181b830694a90bba7ad5651fa0b726e4a75.tar.xz
mv-6e5d8181b830694a90bba7ad5651fa0b726e4a75.zip
Add popup menu for text fields.
This menu allow copy/paste text to/from clipboard.
Diffstat (limited to 'src/gui/widgets/textfield.cpp')
-rw-r--r--src/gui/widgets/textfield.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 260b0fe57..3a6212b79 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -27,6 +27,7 @@
#include "keyevent.h"
#include "gui/sdlinput.h"
+#include "gui/viewport.h"
#include "resources/image.h"
@@ -515,3 +516,13 @@ void TextField::fontChanged()
{
fixScroll();
}
+
+void TextField::mousePressed(gcn::MouseEvent &mouseEvent)
+{
+ if (mouseEvent.getButton() == gcn::MouseEvent::RIGHT)
+ {
+ if (viewport)
+ viewport->showTextFieldPopup(this);
+ }
+ else gcn::TextField::mousePressed(mouseEvent);
+}