00001 /************************************************************************ 00002 filename: CEGUIListboxTextItem.h 00003 created: 12/6/2004 00004 author: Paul D Turner 00005 00006 purpose: Interface for list box text items 00007 *************************************************************************/ 00008 /************************************************************************* 00009 Crazy Eddie's GUI System (http://www.cegui.org.uk) 00010 Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk) 00011 00012 This library is free software; you can redistribute it and/or 00013 modify it under the terms of the GNU Lesser General Public 00014 License as published by the Free Software Foundation; either 00015 version 2.1 of the License, or (at your option) any later version. 00016 00017 This library is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 Lesser General Public License for more details. 00021 00022 You should have received a copy of the GNU Lesser General Public 00023 License along with this library; if not, write to the Free Software 00024 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 *************************************************************************/ 00026 #ifndef _CEGUIListboxTextItem_h_ 00027 #define _CEGUIListboxTextItem_h_ 00028 #include "elements/CEGUIListboxItem.h" 00029 00030 00031 // Start of CEGUI namespace section 00032 namespace CEGUI 00033 { 00038 class CEGUIEXPORT ListboxTextItem : public ListboxItem 00039 { 00040 public: 00041 /************************************************************************* 00042 Constants 00043 *************************************************************************/ 00044 static const colour DefaultTextColour; 00045 00046 00047 /************************************************************************* 00048 Construction and Destruction 00049 *************************************************************************/ 00054 ListboxTextItem(const String& text, uint item_id = 0, void* item_data = NULL, bool disabled = false, bool auto_delete = true); 00055 00056 00061 virtual ~ListboxTextItem(void) {} 00062 00063 00064 /************************************************************************* 00065 Accessor methods 00066 *************************************************************************/ 00077 const Font* getFont(void) const; 00078 00079 00087 ColourRect getTextColours(void) const {return d_textCols;} 00088 00089 00090 /************************************************************************* 00091 Manipulator methods 00092 *************************************************************************/ 00103 void setFont(const Font* font) {d_font = font;} 00104 00105 00116 void setFont(const String& font_name); 00117 00118 00129 void setTextColours(const ColourRect& cols) {d_textCols = cols;} 00130 00131 00151 void setTextColours(colour top_left_colour, colour top_right_colour, colour bottom_left_colour, colour bottom_right_colour); 00152 00153 00164 void setTextColours(colour col) {setTextColours(col, col, col, col);} 00165 00166 00167 /************************************************************************* 00168 Required implementations of pure virtuals from the base class. 00169 *************************************************************************/ 00170 Size getPixelSize(void) const; 00171 void draw(const Vector3& position, float alpha, const Rect& clipper) const; 00172 void draw(RenderCache& cache,const Rect& targetRect, float zBase, float alpha, const Rect* clipper) const; 00173 00174 protected: 00175 /************************************************************************* 00176 Implementation Data 00177 *************************************************************************/ 00178 ColourRect d_textCols; 00179 const Font* d_font; 00180 }; 00181 00182 } // End of CEGUI namespace section 00183 00184 00185 #endif // end of guard _CEGUIListboxTextItem_h_