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

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

The client uses nonblocking calls to check for server messages and textboxes can now process all the standard keyboard keys

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