From 6e5d8181b830694a90bba7ad5651fa0b726e4a75 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 30 Dec 2012 16:00:06 +0300 Subject: Add popup menu for text fields. This menu allow copy/paste text to/from clipboard. --- src/gui/widgets/textfield.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gui/widgets/textfield.cpp') 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); +} -- cgit v1.2.3-70-g09d2