summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textfield.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-27 00:34:08 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-27 00:34:08 +0300
commitfaed590f56414ee53717afe01d050a03d5ea11e5 (patch)
tree5da8b0f60220932f09b4dd689c7b5fd4168533bd /src/gui/widgets/textfield.h
parent84bccd97832136dd8f59640244ca9e66e388ba23 (diff)
downloadmv-faed590f56414ee53717afe01d050a03d5ea11e5.tar.gz
mv-faed590f56414ee53717afe01d050a03d5ea11e5.tar.bz2
mv-faed590f56414ee53717afe01d050a03d5ea11e5.tar.xz
mv-faed590f56414ee53717afe01d050a03d5ea11e5.zip
Use local textchunk in textfield for draw text strings.
Diffstat (limited to 'src/gui/widgets/textfield.h')
-rw-r--r--src/gui/widgets/textfield.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h
index 3a5db3c3c..ffd956ed2 100644
--- a/src/gui/widgets/textfield.h
+++ b/src/gui/widgets/textfield.h
@@ -69,6 +69,9 @@
#include "listeners/focuslistener.h"
#include "listeners/keylistener.h"
#include "listeners/mouselistener.h"
+#include "listeners/widgetlistener.h"
+
+#include "gui/fonts/textchunk.h"
#include "gui/widgets/widget.h"
@@ -82,7 +85,8 @@
class TextField notfinal : public Widget,
public FocusListener,
public KeyListener,
- public MouseListener
+ public MouseListener,
+ public WidgetListener
{
public:
/**
@@ -223,6 +227,10 @@ class TextField notfinal : public Widget,
void mouseDragged(MouseEvent& event) override final;
+ void widgetHidden(const Event &event) override final;
+
+ void setParent(Widget *widget) override final;
+
protected:
void drawCaret(Graphics* graphics, int x);
@@ -241,6 +249,8 @@ class TextField notfinal : public Widget,
*/
std::string mText;
+ TextChunk mTextChunk;
+
/**
* Holds the caret position.
*/
@@ -265,6 +275,7 @@ class TextField notfinal : public Widget,
bool mLoseFocusOnTab;
bool mAllowSpecialActions;
bool mSendAlwaysEvents;
+ bool mTextChanged;
};
#endif // GUI_WIDGETS_TEXTFIELD_H