From 2deeb15d4de7d3747f1d65637f429cedf794cd35 Mon Sep 17 00:00:00 2001 From: Jonas Suhr Christensen Date: Wed, 5 Nov 2014 14:39:44 +0100 Subject: Added scrollbar. --- plugingui/textedit.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'plugingui/textedit.h') diff --git a/plugingui/textedit.h b/plugingui/textedit.h index e26a88c..3f27575 100644 --- a/plugingui/textedit.h +++ b/plugingui/textedit.h @@ -27,12 +27,14 @@ #ifndef __DRUMGIZMO_TEXTEDIT_H__ #define __DRUMGIZMO_TEXTEDIT_H__ - #include +#include + #include "widget.h" #include "font.h" #include "painter.h" +#include "scrollbar.h" namespace GUI { @@ -48,25 +50,31 @@ public: void setReadOnly(bool readonly); bool readOnly(); - void registerEnterPressedHandler(void (*handler)(void *), void *ptr); + void resize(int width, int height); + + + void preprocessText(); //protected: - virtual void keyEvent(KeyEvent *e); +// virtual void keyEvent(KeyEvent *e); virtual void repaintEvent(RepaintEvent *e); - virtual void buttonEvent(ButtonEvent *e); +// virtual void buttonEvent(ButtonEvent *e); protected: virtual void textChanged() {} private: Painter::Box box; - + ScrollBar scroll; Font font; std::string _text; size_t pos; bool readonly; + + std::list< std::string > preprocessedtext; +// size_t numoflines; void (*handler)(void *); void *ptr; -- cgit v1.2.3