From faed590f56414ee53717afe01d050a03d5ea11e5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 27 May 2015 00:34:08 +0300 Subject: Use local textchunk in textfield for draw text strings. --- src/gui/widgets/textfield.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/gui/widgets/textfield.h') 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 -- cgit v1.2.3-60-g2f50