Crazy Eddies GUI System  0.6.0
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
CEGUI::ListboxTextItem Class Reference

Class used for textual items in a list box. More...

+ Inheritance diagram for CEGUI::ListboxTextItem:
+ Collaboration diagram for CEGUI::ListboxTextItem:

Public Member Functions

 ListboxTextItem (const String &text, uint item_id=0, void *item_data=0, bool disabled=false, bool auto_delete=true)
 base class constructor
 
virtual ~ListboxTextItem (void)
 base class destructor
 
FontgetFont (void) const
 Return a pointer to the font being used by this ListboxTextItem. More...
 
ColourRect getTextColours (void) const
 Return the current colours used for text rendering. More...
 
void setFont (Font *font)
 Set the font to be used by this ListboxTextItem. More...
 
void setFont (const String &font_name)
 Set the font to be used by this ListboxTextItem. More...
 
void setTextColours (const ColourRect &cols)
 Set the colours used for text rendering. More...
 
void setTextColours (colour top_left_colour, colour top_right_colour, colour bottom_left_colour, colour bottom_right_colour)
 Set the colours used for text rendering. More...
 
void setTextColours (colour col)
 Set the colours used for text rendering. More...
 
Size getPixelSize (void) const
 Return the rendered pixel size of this list box item. More...
 
void draw (const Vector3 &position, float alpha, const Rect &clipper) const
 Draw the list box item in its current state. More...
 
void draw (RenderCache &cache, const Rect &targetRect, float zBase, float alpha, const Rect *clipper) const
 
- Public Member Functions inherited from CEGUI::ListboxItem
 ListboxItem (const String &text, uint item_id=0, void *item_data=0, bool disabled=false, bool auto_delete=true)
 base class constructor
 
virtual ~ListboxItem (void)
 base class destructor
 
const StringgetText (void) const
 return the text string set for this list box item. More...
 
const StringgetTooltipText (void) const
 
uint getID (void) const
 Return the current ID assigned to this list box item. More...
 
void * getUserData (void) const
 Return the pointer to any client assigned user data attached to this lis box item. More...
 
bool isSelected (void) const
 return whether this item is selected. More...
 
bool isDisabled (void) const
 return whether this item is disabled. More...
 
bool isAutoDeleted (void) const
 return whether this item will be automatically deleted when the list box it is attached to is destroyed, or when the item is removed from the list box. More...
 
const WindowgetOwnerWindow () const
 Get the owner window for this ListboxItem. More...
 
ColourRect getSelectionColours (void) const
 Return the current colours used for selection highlighting. More...
 
const ImagegetSelectionBrushImage (void) const
 Return the current selection highlighting brush. More...
 
void setText (const String &text)
 set the text string for this list box item. More...
 
void setTooltipText (const String &text)
 
void setID (uint item_id)
 Set the ID assigned to this list box item. More...
 
void setUserData (void *item_data)
 Set the client assigned user data attached to this lis box item. More...
 
void setSelected (bool setting)
 set whether this item is selected. More...
 
void setDisabled (bool setting)
 set whether this item is disabled. More...
 
void setAutoDeleted (bool setting)
 Set whether this item will be automatically deleted when the list box it is attached to is destroyed, or when the item is removed from the list box. More...
 
void setOwnerWindow (const Window *owner)
 Set the owner window for this ListboxItem. This is called by all the list box widgets when an item is added or inserted. More...
 
void setSelectionColours (const ColourRect &cols)
 Set the colours used for selection highlighting. More...
 
void setSelectionColours (colour top_left_colour, colour top_right_colour, colour bottom_left_colour, colour bottom_right_colour)
 Set the colours used for selection highlighting. More...
 
void setSelectionColours (colour col)
 Set the colours used for selection highlighting. More...
 
void setSelectionBrushImage (const Image *image)
 Set the selection highlighting brush image. More...
 
void setSelectionBrushImage (const String &imageset, const String &image)
 Set the selection highlighting brush image. More...
 
virtual bool operator< (const ListboxItem &rhs) const
 Less-than operator, compares item texts.
 
virtual bool operator> (const ListboxItem &rhs) const
 Greater-than operator, compares item texts.
 

Static Public Attributes

static const colour DefaultTextColour = 0xFFFFFFFF
 Default text colour.
 
- Static Public Attributes inherited from CEGUI::ListboxItem
static const colour DefaultSelectionColour = 0xFF4444AA
 Default selection brush colour.
 

Protected Attributes

ColourRect d_textCols
 Colours used for rendering the text.
 
Fontd_font
 Font used for rendering text.
 
- Protected Attributes inherited from CEGUI::ListboxItem
String d_itemText
 Text for this list box item. If not rendered, this is still used for list sorting.
 
String d_tooltipText
 Text for the individual tooltip of this item.
 
uint d_itemID
 ID code assigned by client code. This has no meaning within the GUI system.
 
void * d_itemData
 Pointer to some client code data. This has no meaning within the GUI system.
 
bool d_selected
 true if this item is selected. false if the item is not selected.
 
bool d_disabled
 true if this item is disabled. false if the item is not disabled.
 
bool d_autoDelete
 true if the system should destroy this item, false if client code will destroy the item.
 
const Windowd_owner
 Pointer to the window that owns this item.
 
ColourRect d_selectCols
 Colours used for selection highlighting.
 
const Imaged_selectBrush
 Image used for rendering selection.
 

Additional Inherited Members

- Protected Member Functions inherited from CEGUI::ListboxItem
ColourRect getModulateAlphaColourRect (const ColourRect &cols, float alpha) const
 Return a ColourRect object describing the colours in cols after having their alpha component modulated by the value alpha.
 
colour calculateModulatedAlphaColour (colour col, float alpha) const
 Return a colour value describing the colour specified by col after having its alpha component modulated by the value alpha.
 

Detailed Description

Class used for textual items in a list box.

Member Function Documentation

void CEGUI::ListboxTextItem::draw ( const Vector3 position,
float  alpha,
const Rect clipper 
) const
virtual

Draw the list box item in its current state.

Parameters
positionVecor3 object describing the upper-left corner of area that should be rendered in to for the draw operation.
alphaAlpha value to be used when rendering the item (between 0.0f and 1.0f).
clipperRect object describing the clipping rectangle for the draw operation.
Returns
Nothing.

Implements CEGUI::ListboxItem.

References CEGUI::ListboxItem::d_itemText, CEGUI::ListboxItem::d_selectBrush, CEGUI::ListboxItem::d_selectCols, CEGUI::ListboxItem::d_selected, d_textCols, CEGUI::Image::draw(), CEGUI::Font::drawText(), getFont(), CEGUI::Font::getFontHeight(), CEGUI::Font::getLineSpacing(), and CEGUI::ListboxItem::getModulateAlphaColourRect().

Font * CEGUI::ListboxTextItem::getFont ( void  ) const

Return a pointer to the font being used by this ListboxTextItem.

    This method will try a number of places to find a font to be used.  If no font can be
    found, NULL is returned.
Returns
Font to be used for rendering this item

References d_font, CEGUI::ListboxItem::d_owner, CEGUI::System::getDefaultFont(), CEGUI::Window::getFont(), and CEGUI::System::getSingleton().

Referenced by draw(), getPixelSize(), and setFont().

Size CEGUI::ListboxTextItem::getPixelSize ( void  ) const
virtual

Return the rendered pixel size of this list box item.

Returns
Size object describing the size of the list box item in pixels.

Implements CEGUI::ListboxItem.

References CEGUI::ListboxItem::d_itemText, getFont(), CEGUI::Font::getLineSpacing(), and CEGUI::Font::getTextExtent().

ColourRect CEGUI::ListboxTextItem::getTextColours ( void  ) const
inline

Return the current colours used for text rendering.

Returns
ColourRect object describing the currently set colours
void CEGUI::ListboxTextItem::setFont ( Font font)
inline

Set the font to be used by this ListboxTextItem.

Parameters
fontFont to be used for rendering this item
Returns
Nothing

Referenced by setFont().

void CEGUI::ListboxTextItem::setFont ( const String font_name)

Set the font to be used by this ListboxTextItem.

Parameters
font_nameString object containing the name of the Font to be used for rendering this item
Returns
Nothing

References getFont(), and setFont().

void CEGUI::ListboxTextItem::setTextColours ( const ColourRect cols)
inline

Set the colours used for text rendering.

Parameters
colsColourRect object describing the colours to be used.
Returns
Nothing.
void CEGUI::ListboxTextItem::setTextColours ( colour  top_left_colour,
colour  top_right_colour,
colour  bottom_left_colour,
colour  bottom_right_colour 
)

Set the colours used for text rendering.

Parameters
top_left_colourColour (as ARGB value) to be applied to the top-left corner of each text glyph rendered.
top_right_colourColour (as ARGB value) to be applied to the top-right corner of each text glyph rendered.
bottom_left_colourColour (as ARGB value) to be applied to the bottom-left corner of each text glyph rendered.
bottom_right_colourColour (as ARGB value) to be applied to the bottom-right corner of each text glyph rendered.
Returns
Nothing.

References d_textCols.

void CEGUI::ListboxTextItem::setTextColours ( colour  col)
inline

Set the colours used for text rendering.

Parameters
colcolour value to be used when rendering.
Returns
Nothing.

References setTextColours().

Referenced by setTextColours().