source: network-game/client/Client/Textbox.h@ cbc595d

Last change on this file since cbc595d was 87b3ee2, checked in by dportnoy <dmp1488@…>, 12 years ago

Created a simple gui for the client

  • Property mode set to 100644
File size: 623 bytes
Line 
1#ifndef _TEXTBOX_H
2#define _TEXTBOX_H
3
4#include "GuiComponent.h"
5
6#include <string>
7
8using namespace std;
9
10class Textbox :
11 public GuiComponent
12{
13private:
14 string str;
15 bool selected;
16
17public:
18 Textbox(int x, int y, int width, int height, ALLEGRO_FONT *font);
19 ~Textbox(void);
20
21 // This might lead to a memory leak if the textbox is deleted because it
22 // returns a reference to the string.
23 // string getStr() const; will copy the string and return it instead
24 const string& getStr() const;
25
26 void clear(void);
27 void draw(ALLEGRO_DISPLAY *display);
28 bool handleEvent(ALLEGRO_EVENT& e);
29};
30
31#endif
32
Note: See TracBrowser for help on using the repository browser.