Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
textinputdisplay.h
Go to the documentation of this file.
1 /*
2  * Vega Strike
3  * Copyright (C) 2003 Mike Byron
4  *
5  * http://vegastrike.sourceforge.net/
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  */
21 
22 #ifndef __TEXTINPUTDISPLAY_H__
23 #define __TEXTINPUTISPLAY_H__
24 
25 #include "staticdisplay.h"
26 #include <vector>
27 
28 //See cpp file for detailed descriptions of classes, functions, etc.
29 
30 //The TextInputDisplay class is used to get text input from the user.
31 
33 {
34  std::vector< unsigned int > local_keyboard_queue;
35  std::vector< unsigned int > *keyboard_queue;
36  char *disallowed;
37  bool isFocused;
38  char passwordChar;
39 public: TextInputDisplay( std::vector< unsigned int > *keyboard_input_queue, const char *disallowed );
40 //OVERRIDES - used for focusing input.
41  virtual void processUnfocus( const InputEvent &event );
42  virtual bool processMouseDown( const InputEvent &event );
43  virtual bool processKeypress( unsigned int pressedKey );
44 
45  void setPassword( char passchar )
46  {
47  passwordChar = passchar;
48  }
49 
50  virtual ~TextInputDisplay();
51  virtual void draw();
52 };
53 
54 #endif //__TEXTINPUTDISPLAY_H__
55