]> Shamusworld >> Repos - apple2/blob - src/gui/textedit.h
Moved stuff into trunk (part 2)...
[apple2] / src / gui / textedit.h
1 //
2 // TEXTEDIT.H
3 //
4 // Graphical User Interface text edit class
5 //
6
7 #ifndef __TEXTEDIT_H__
8 #define __TEXTEDIT_H__
9
10 #include <string>
11 #include "element.h"
12
13 class TextEdit: public Element
14 {
15         public:
16                 TextEdit(uint32 x = 0, uint32 y = 0, uint32 w = 0, uint32 h = 0, std::string s = "", Element * parent = NULL);
17                 ~TextEdit();
18                 virtual void HandleKey(SDLKey key);
19                 virtual void HandleMouseMove(uint32 x, uint32 y);
20                 virtual void HandleMouseButton(uint32 x, uint32 y, bool mouseDown);
21                 virtual void Draw(void);
22                 virtual void Notify(Element *);
23                 std::string GetText(void);
24                 void SaveStateVariables(void);
25                 void CheckStateAndRedrawIfNeeded(void);
26
27         protected:
28                 bool activated, clicked, inside;
29                 SDL_Surface * img;
30                 std::string text;
31                 uint32 caretPos, scrollPos;
32
33         private:
34                 bool activatedSave, clickedSave, insideSave;
35                 uint32 caretPosSave, scrollPosSave, lengthSave;
36                 uint32 hiliteColor, cursorColor;
37 };
38
39 #endif  // __TEXTEDIT_H__