Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CText.h
Go to the documentation of this file.
1 /* Copyright (C) 2009 Wildfire Games.
2  * This file is part of 0 A.D.
3  *
4  * 0 A.D. is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * 0 A.D. is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 /*
19 GUI Object - Text [field]
20 
21 --Overview--
22 
23  GUI Object representing a text field
24 
25 --More info--
26 
27  Check GUI.h
28 
29 */
30 
31 #ifndef INCLUDED_CTEXT
32 #define INCLUDED_CTEXT
33 
34 //--------------------------------------------------------
35 // Includes / Compiler directives
36 //--------------------------------------------------------
37 #include "GUI.h"
38 
39 // TODO Gee: Remove
40 class IGUIScrollBar;
41 
42 //--------------------------------------------------------
43 // Macros
44 //--------------------------------------------------------
45 
46 //--------------------------------------------------------
47 // Types
48 //--------------------------------------------------------
49 
50 //--------------------------------------------------------
51 // Declarations
52 //--------------------------------------------------------
53 
54 /**
55  * Text field that just displays static text.
56  *
57  * @see IGUIObject
58  */
59 class CText : public IGUIScrollBarOwner, public IGUITextOwner
60 {
62 
63 public:
64  CText();
65  virtual ~CText();
66 
67  /**
68  * @see IGUIObject#ResetStates()
69  */
71 
72  /**
73  * Test if mouse position is over an icon
74  */
75  virtual bool MouseOverIcon();
76 
77 protected:
78  /**
79  * Sets up text, should be called every time changes has been
80  * made that can change the visual.
81  */
82  void SetupText();
83 
84  /**
85  * @see IGUIObject#HandleMessage()
86  */
87  virtual void HandleMessage(SGUIMessage &Message);
88 
89  /**
90  * Draws the Text
91  */
92  virtual void Draw();
93 
94  /**
95  * Placement of text. Ignored when scrollbars are active.
96  */
98 };
99 
100 #endif
CPos m_TextPos
Placement of text.
Definition: CText.h:97
void SetupText()
Sets up text, should be called every time changes has been made that can change the visual...
Definition: CText.cpp:72
virtual void ResetStates()
Definition: CText.h:70
virtual ~CText()
Definition: CText.cpp:68
Framework for handling Output text.
Definition: IGUITextOwner.h:60
Made to represent screen positions and delta values.
Definition: Overlay.h:167
CText()
Definition: CText.cpp:33
virtual void HandleMessage(SGUIMessage &Message)
Definition: CText.cpp:130
virtual void ResetStates()
Text field that just displays static text.
Definition: CText.h:59
The GUI Scroll-bar, used everywhere there is a scroll-bar in the game.
Message send to IGUIObject::HandleMessage() in order to give life to Objects manually with a derived ...
Definition: GUIbase.h:106
Base-class this if you want an object to contain one, or several, scroll-bars.
virtual void Draw()
Draws the Text.
Definition: CText.cpp:194
#define GUI_OBJECT(obj)
Definition: GUIbase.h:62
virtual bool MouseOverIcon()
Test if mouse position is over an icon.
Definition: CText.cpp:254