Crazy Eddies GUI System  0.6.0
CEGUIListboxTextItem.h
1 /***********************************************************************
2  filename: CEGUIListboxTextItem.h
3  created: 12/6/2004
4  author: Paul D Turner
5 
6  purpose: Interface for list box text items
7 *************************************************************************/
8 /***************************************************************************
9  * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining
12  * a copy of this software and associated documentation files (the
13  * "Software"), to deal in the Software without restriction, including
14  * without limitation the rights to use, copy, modify, merge, publish,
15  * distribute, sublicense, and/or sell copies of the Software, and to
16  * permit persons to whom the Software is furnished to do so, subject to
17  * the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be
20  * included in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  * OTHER DEALINGS IN THE SOFTWARE.
29  ***************************************************************************/
30 #ifndef _CEGUIListboxTextItem_h_
31 #define _CEGUIListboxTextItem_h_
32 #include "elements/CEGUIListboxItem.h"
33 
34 
35 // Start of CEGUI namespace section
36 namespace CEGUI
37 {
42 class CEGUIEXPORT ListboxTextItem : public ListboxItem
43 {
44 public:
45  /*************************************************************************
46  Constants
47  *************************************************************************/
48  static const colour DefaultTextColour;
49 
50 
51  /*************************************************************************
52  Construction and Destruction
53  *************************************************************************/
58  ListboxTextItem(const String& text, uint item_id = 0, void* item_data = 0, bool disabled = false, bool auto_delete = true);
59 
60 
65  virtual ~ListboxTextItem(void) {}
66 
67 
68  /*************************************************************************
69  Accessor methods
70  *************************************************************************/
81  Font* getFont(void) const;
82 
83 
91  ColourRect getTextColours(void) const {return d_textCols;}
92 
93 
94  /*************************************************************************
95  Manipulator methods
96  *************************************************************************/
107  void setFont(Font* font) {d_font = font;}
108 
109 
120  void setFont(const String& font_name);
121 
122 
133  void setTextColours(const ColourRect& cols) {d_textCols = cols;}
134 
135 
155  void setTextColours(colour top_left_colour, colour top_right_colour, colour bottom_left_colour, colour bottom_right_colour);
156 
157 
168  void setTextColours(colour col) {setTextColours(col, col, col, col);}
169 
170 
171  /*************************************************************************
172  Required implementations of pure virtuals from the base class.
173  *************************************************************************/
174  Size getPixelSize(void) const;
175  void draw(const Vector3& position, float alpha, const Rect& clipper) const;
176  void draw(RenderCache& cache,const Rect& targetRect, float zBase, float alpha, const Rect* clipper) const;
177 
178 protected:
179  /*************************************************************************
180  Implementation Data
181  *************************************************************************/
184 };
185 
186 } // End of CEGUI namespace section
187 
188 
189 #endif // end of guard _CEGUIListboxTextItem_h_