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

Last change on this file since 1a3c42d 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
RevLine 
[87b3ee2]1#ifndef _TEXTBOX_H
2#define _TEXTBOX_H
3
4#include "GuiComponent.h"
5
6#include <string>
[e607c0f]7#include <map>
[87b3ee2]8
9using namespace std;
10
11class Textbox :
12 public GuiComponent
13{
14private:
15 string str;
16 bool selected;
[e607c0f]17 bool shiftPressed;
18 map<char, char> shiftMap;
[87b3ee2]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.