Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CEGUI::ListboxTextItem Class Reference

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

#include <CEGUIListboxTextItem.h>

Inheritance diagram for CEGUI::ListboxTextItem:

Inheritance graph
[legend]
Collaboration diagram for CEGUI::ListboxTextItem:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ListboxTextItem (const String &text, uint item_id=0, void *item_data=NULL, bool disabled=false, bool auto_delete=true)
 base class constructor
virtual ~ListboxTextItem (void)
 base class destructor
const FontgetFont (void) const
 Return a pointer to the font being used by this ListboxTextItem.
ColourRect getTextColours (void) const
 Return the current colours used for text rendering.
void setFont (const Font *font)
 Set the font to be used by this ListboxTextItem.
void setFont (const String &font_name)
 Set the font to be used by this ListboxTextItem.
void setTextColours (const ColourRect &cols)
 Set the colours used for text rendering.
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.
void setTextColours (colour col)
 Set the colours used for text rendering.
Size getPixelSize (void) const
 Return the rendered pixel size of this list box item.
void draw (const Vector3 &position, float alpha, const Rect &clipper) const
 Draw the list box item in its current state.
void draw (RenderCache &cache, const Rect &targetRect, float zBase, float alpha, const Rect *clipper) const
const StringgetText (void) const
 return the text string set for this list box item.
const StringgetTooltipText (void) const
uint getID (void) const
 Return the current ID assigned to this list box item.
void * getUserData (void) const
 Return the pointer to any client assigned user data attached to this lis box item.
bool isSelected (void) const
 return whether this item is selected.
bool isDisabled (void) const
 return whether this item is disabled.
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.
const WindowgetOwnerWindow (const Window *owner)
 Get the owner window for this ListboxItem.
ColourRect getSelectionColours (void) const
 Return the current colours used for selection highlighting.
const ImagegetSelectionBrushImage (void) const
 Return the current selection highlighting brush.
void setText (const String &text)
 set the text string for this list box item.
void setTooltipText (const String &text)
void setID (uint item_id)
 Set the ID assigned to this list box item.
void setUserData (void *item_data)
 Set the client assigned user data attached to this lis box item.
void setSelected (bool setting)
 set whether this item is selected.
void setDisabled (bool setting)
 set whether this item is disabled.
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.
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.
void setSelectionColours (const ColourRect &cols)
 Set the colours used for selection highlighting.
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.
void setSelectionColours (colour col)
 Set the colours used for selection highlighting.
void setSelectionBrushImage (const Image *image)
 Set the selection highlighting brush image.
void setSelectionBrushImage (const String &imageset, const String &image)
 Set the selection highlighting brush image.
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 const colour DefaultSelectionColour = 0xFF4444AA
 Default selection brush colour.

Protected Member Functions

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.

Protected Attributes

ColourRect d_textCols
 Colours used for rendering the text.
const Fontd_font
 Font used for rendering text.
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.

Detailed Description

Class used for textual items in a list box.

Definition at line 38 of file CEGUIListboxTextItem.h.


Constructor & Destructor Documentation

CEGUI::ListboxTextItem::ListboxTextItem const String text,
uint  item_id = 0,
void *  item_data = NULL,
bool  disabled = false,
bool  auto_delete = true
 

base class constructor

Definition at line 44 of file CEGUIListboxTextItem.cpp.

virtual CEGUI::ListboxTextItem::~ListboxTextItem void   )  [inline, virtual]
 

base class destructor

Definition at line 61 of file CEGUIListboxTextItem.h.


Member Function Documentation

colour CEGUI::ListboxItem::calculateModulatedAlphaColour colour  col,
float  alpha
const [protected, inherited]
 

Return a colour value describing the colour specified by col after having its alpha component modulated by the value alpha.

Definition at line 86 of file CEGUIListboxItem.cpp.

References CEGUI::colour::getAlpha(), and CEGUI::colour::setAlpha().

Referenced by CEGUI::ListboxItem::getModulateAlphaColourRect().

void CEGUI::ListboxTextItem::draw RenderCache cache,
const Rect targetRect,
float  zBase,
float  alpha,
const Rect clipper
const [virtual]
 

Implements CEGUI::ListboxItem.

Definition at line 124 of file CEGUIListboxTextItem.cpp.

References CEGUI::RenderCache::cacheImage(), CEGUI::RenderCache::cacheText(), CEGUI::ListboxItem::d_itemText, CEGUI::ListboxItem::d_selectBrush, CEGUI::ListboxItem::d_selectCols, CEGUI::ListboxItem::d_selected, d_textCols, CEGUI::Rect::d_top, CEGUI::Font::getBaseline(), getFont(), CEGUI::Font::getLineSpacing(), CEGUI::ListboxItem::getModulateAlphaColourRect(), and CEGUI::LeftAligned.

void CEGUI::ListboxTextItem::draw const Vector3 position,
float  alpha,
const Rect clipper
const [virtual]
 

Draw the list box item in its current state.

Parameters:
position Vecor3 object describing the upper-left corner of area that should be rendered in to for the draw operation.
alpha Alpha value to be used when rendering the item (between 0.0f and 1.0f).
clipper Rect object describing the clipping rectangle for the draw operation.
Returns:
Nothing.

Implements CEGUI::ListboxItem.

Definition at line 106 of file CEGUIListboxTextItem.cpp.

References CEGUI::ListboxItem::d_itemText, CEGUI::ListboxItem::d_selectBrush, CEGUI::ListboxItem::d_selectCols, CEGUI::ListboxItem::d_selected, d_textCols, CEGUI::Vector3::d_y, CEGUI::Vector3::d_z, CEGUI::Image::draw(), CEGUI::Font::drawText(), CEGUI::Font::getBaseline(), getFont(), CEGUI::Font::getLineSpacing(), CEGUI::ListboxItem::getModulateAlphaColourRect(), and PixelAligned.

const 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

Definition at line 55 of file CEGUIListboxTextItem.cpp.

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

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

uint CEGUI::ListboxItem::getID void   )  const [inline, inherited]
 

Return the current ID assigned to this list box item.

Note that the system does not make use of this value, client code can assign any meaning it wishes to the ID.

Returns:
ID code currently assigned to this list box item

Definition at line 93 of file CEGUIListboxItem.h.

ColourRect CEGUI::ListboxItem::getModulateAlphaColourRect const ColourRect cols,
float  alpha
const [protected, inherited]
 

Return a ColourRect object describing the colours in cols after having their alpha component modulated by the value alpha.

Definition at line 70 of file CEGUIListboxItem.cpp.

References CEGUI::ListboxItem::calculateModulatedAlphaColour(), CEGUI::ColourRect::d_bottom_left, CEGUI::ColourRect::d_bottom_right, CEGUI::ColourRect::d_top_left, and CEGUI::ColourRect::d_top_right.

Referenced by draw().

const Window* CEGUI::ListboxItem::getOwnerWindow const Window owner  )  [inline, inherited]
 

Get the owner window for this ListboxItem.

The owner of a ListboxItem is typically set by the list box widgets when an item is added or inserted.

Returns:
Ponter to the window that is considered the owner of this ListboxItem.

Definition at line 151 of file CEGUIListboxItem.h.

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.

Definition at line 87 of file CEGUIListboxTextItem.cpp.

References CEGUI::Size::d_height, CEGUI::ListboxItem::d_itemText, CEGUI::Size::d_width, getFont(), CEGUI::Font::getLineSpacing(), CEGUI::Font::getTextExtent(), and PixelAligned.

const Image* CEGUI::ListboxItem::getSelectionBrushImage void   )  const [inline, inherited]
 

Return the current selection highlighting brush.

Returns:
Pointer to the Image object currently used for selection highlighting.

Definition at line 171 of file CEGUIListboxItem.h.

ColourRect CEGUI::ListboxItem::getSelectionColours void   )  const [inline, inherited]
 

Return the current colours used for selection highlighting.

Returns:
ColourRect object describing the currently set colours

Definition at line 161 of file CEGUIListboxItem.h.

const String& CEGUI::ListboxItem::getText void   )  const [inline, inherited]
 

return the text string set for this list box item.

Note that even if the item does not render text, the text string can still be useful, since it is used for sorting list box items.

Returns:
String object containing the current text for the list box item.

Definition at line 80 of file CEGUIListboxItem.h.

Referenced by CEGUI::Combobox::droplist_SelectionAcceptedHandler(), CEGUI::MultiColumnList::ListRow::operator<(), CEGUI::ListboxItem::operator<(), CEGUI::MultiColumnList::ListRow::operator>(), and CEGUI::ListboxItem::operator>().

ColourRect CEGUI::ListboxTextItem::getTextColours void   )  const [inline]
 

Return the current colours used for text rendering.

Returns:
ColourRect object describing the currently set colours

Definition at line 87 of file CEGUIListboxTextItem.h.

const String& CEGUI::ListboxItem::getTooltipText void   )  const [inline, inherited]
 

Definition at line 81 of file CEGUIListboxItem.h.

Referenced by CEGUI::Listbox::onMouseMove().

void* CEGUI::ListboxItem::getUserData void   )  const [inline, inherited]
 

Return the pointer to any client assigned user data attached to this lis box item.

Note that the system does not make use of this data, client code can assign any meaning it wishes to the attached data.

Returns:
Pointer to the currently assigned user data.

Definition at line 106 of file CEGUIListboxItem.h.

bool CEGUI::ListboxItem::isAutoDeleted void   )  const [inline, inherited]
 

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.

Returns:
true if the item object will be deleted by the system when the list box it is attached to is destroyed, or when the item is removed from the list. false if client code must destroy the item after it is removed from the list.

Definition at line 139 of file CEGUIListboxItem.h.

Referenced by CEGUI::MultiColumnList::removeColumn(), CEGUI::Listbox::removeItem(), CEGUI::MultiColumnList::removeRow(), CEGUI::MultiColumnList::resetList_impl(), and CEGUI::MultiColumnList::setItem().

bool CEGUI::ListboxItem::isDisabled void   )  const [inline, inherited]
 

return whether this item is disabled.

Returns:
true if the item is disabled, false if the item is enabled.

Definition at line 126 of file CEGUIListboxItem.h.

bool CEGUI::ListboxItem::isSelected void   )  const [inline, inherited]
 

return whether this item is selected.

Returns:
true if the item is selected, false if the item is not selected.

Definition at line 116 of file CEGUIListboxItem.h.

Referenced by CEGUI::MultiColumnList::clearAllSelections_impl(), CEGUI::MultiColumnList::getNextSelected(), CEGUI::MultiColumnList::getSelectedCount(), CEGUI::MultiColumnList::isItemSelected(), CEGUI::MultiColumnList::onMouseButtonDown(), and CEGUI::Listbox::onMouseButtonDown().

virtual bool CEGUI::ListboxItem::operator< const ListboxItem rhs  )  const [inline, virtual, inherited]
 

Less-than operator, compares item texts.

Definition at line 398 of file CEGUIListboxItem.h.

References CEGUI::ListboxItem::getText().

virtual bool CEGUI::ListboxItem::operator> const ListboxItem rhs  )  const [inline, virtual, inherited]
 

Greater-than operator, compares item texts.

Definition at line 405 of file CEGUIListboxItem.h.

References CEGUI::ListboxItem::getText().

void CEGUI::ListboxItem::setAutoDeleted bool  setting  )  [inline, inherited]
 

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.

Parameters:
setting true if the item object should be deleted by the system when the list box it is attached to is destroyed, or when the item is removed from the list. false if client code will destroy the item after it is removed from the list.
Returns:
Nothing.

Definition at line 264 of file CEGUIListboxItem.h.

void CEGUI::ListboxItem::setDisabled bool  setting  )  [inline, inherited]
 

set whether this item is disabled.

Parameters:
setting true if the item is disabled, false if the item is enabled.
Returns:
Nothing.

Definition at line 249 of file CEGUIListboxItem.h.

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

Set the font to be used by this ListboxTextItem.

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

Definition at line 79 of file CEGUIListboxTextItem.cpp.

References getFont(), CEGUI::FontManager::getSingleton(), and setFont().

void CEGUI::ListboxTextItem::setFont const Font font  )  [inline]
 

Set the font to be used by this ListboxTextItem.

Parameters:
font Font to be used for rendering this item
Returns:
Nothing

Definition at line 103 of file CEGUIListboxTextItem.h.

Referenced by setFont().

void CEGUI::ListboxItem::setID uint  item_id  )  [inline, inherited]
 

Set the ID assigned to this list box item.

Note that the system does not make use of this value, client code can assign any meaning it wishes to the ID.

Parameters:
item_id ID code to be assigned to this list box item
Returns:
Nothing.

Definition at line 207 of file CEGUIListboxItem.h.

void CEGUI::ListboxItem::setOwnerWindow const Window owner  )  [inline, inherited]
 

Set the owner window for this ListboxItem. This is called by all the list box widgets when an item is added or inserted.

Parameters:
owner Ponter to the window that should be considered the owner of this ListboxItem.
Returns:
Nothing

Definition at line 278 of file CEGUIListboxItem.h.

Referenced by CEGUI::Listbox::addItem(), CEGUI::MultiColumnList::addRow(), CEGUI::Listbox::insertItem(), and CEGUI::MultiColumnList::setItem().

void CEGUI::ListboxItem::setSelected bool  setting  )  [inline, inherited]
 

set whether this item is selected.

Parameters:
setting true if the item is selected, false if the item is not selected.
Returns:
Nothing.

Definition at line 236 of file CEGUIListboxItem.h.

Referenced by CEGUI::MultiColumnList::clearAllSelections_impl(), CEGUI::Listbox::onMouseButtonDown(), CEGUI::Listbox::setMultiselectEnabled(), CEGUI::MultiColumnList::setSelectForItemsInColumn(), and CEGUI::MultiColumnList::setSelectForItemsInRow().

void CEGUI::ListboxItem::setSelectionBrushImage const String imageset,
const String image
[inherited]
 

Set the selection highlighting brush image.

Parameters:
imageset Name of the imagest containing the image to be used.
image Name of the image to be used
Returns:
Nothing.

Definition at line 60 of file CEGUIListboxItem.cpp.

References CEGUI::ImagesetManager::getSingleton(), and CEGUI::ListboxItem::setSelectionBrushImage().

void CEGUI::ListboxItem::setSelectionBrushImage const Image image  )  [inline, inherited]
 

Set the selection highlighting brush image.

Parameters:
image Pointer to the Image object to be used for selection highlighting.
Returns:
Nothing.

Definition at line 339 of file CEGUIListboxItem.h.

Referenced by CEGUI::ListboxItem::setSelectionBrushImage().

void CEGUI::ListboxItem::setSelectionColours colour  col  )  [inline, inherited]
 

Set the colours used for selection highlighting.

Parameters:
col colour value to be used when rendering.
Returns:
Nothing.

Definition at line 326 of file CEGUIListboxItem.h.

void CEGUI::ListboxItem::setSelectionColours colour  top_left_colour,
colour  top_right_colour,
colour  bottom_left_colour,
colour  bottom_right_colour
[inherited]
 

Set the colours used for selection highlighting.

Parameters:
top_left_colour Colour (as ARGB value) to be applied to the top-left corner of the selection area.
top_right_colour Colour (as ARGB value) to be applied to the top-right corner of the selection area.
bottom_left_colour Colour (as ARGB value) to be applied to the bottom-left corner of the selection area.
bottom_right_colour Colour (as ARGB value) to be applied to the bottom-right corner of the selection area.
Returns:
Nothing.

Definition at line 97 of file CEGUIListboxItem.cpp.

References CEGUI::ColourRect::d_bottom_left, CEGUI::ColourRect::d_bottom_right, CEGUI::ListboxItem::d_selectCols, CEGUI::ColourRect::d_top_left, and CEGUI::ColourRect::d_top_right.

void CEGUI::ListboxItem::setSelectionColours const ColourRect cols  )  [inline, inherited]
 

Set the colours used for selection highlighting.

Parameters:
cols ColourRect object describing the colours to be used.
Returns:
Nothing.

Definition at line 291 of file CEGUIListboxItem.h.

void CEGUI::ListboxItem::setText const String text  )  [inline, inherited]
 

set the text string for this list box item.

Note that even if the item does not render text, the text string can still be useful, since it is used for sorting list box items.

Parameters:
text String object containing the text to set for the list box item.
Returns:
Nothing.

Definition at line 190 of file CEGUIListboxItem.h.

void CEGUI::ListboxTextItem::setTextColours colour  col  )  [inline]
 

Set the colours used for text rendering.

Parameters:
col colour value to be used when rendering.
Returns:
Nothing.

Definition at line 164 of file CEGUIListboxTextItem.h.

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_colour Colour (as ARGB value) to be applied to the top-left corner of each text glyph rendered.
top_right_colour Colour (as ARGB value) to be applied to the top-right corner of each text glyph rendered.
bottom_left_colour Colour (as ARGB value) to be applied to the bottom-left corner of each text glyph rendered.
bottom_right_colour Colour (as ARGB value) to be applied to the bottom-right corner of each text glyph rendered.
Returns:
Nothing.

Definition at line 145 of file CEGUIListboxTextItem.cpp.

References CEGUI::ColourRect::d_bottom_left, CEGUI::ColourRect::d_bottom_right, d_textCols, CEGUI::ColourRect::d_top_left, and CEGUI::ColourRect::d_top_right.

void CEGUI::ListboxTextItem::setTextColours const ColourRect cols  )  [inline]
 

Set the colours used for text rendering.

Parameters:
cols ColourRect object describing the colours to be used.
Returns:
Nothing.

Definition at line 129 of file CEGUIListboxTextItem.h.

void CEGUI::ListboxItem::setTooltipText const String text  )  [inline, inherited]
 

Definition at line 192 of file CEGUIListboxItem.h.

void CEGUI::ListboxItem::setUserData void *  item_data  )  [inline, inherited]
 

Set the client assigned user data attached to this lis box item.

Note that the system does not make use of this data, client code can assign any meaning it wishes to the attached data.

Parameters:
item_data Pointer to the user data to attach to this list item.
Returns:
Nothing.

Definition at line 223 of file CEGUIListboxItem.h.


Member Data Documentation

bool CEGUI::ListboxItem::d_autoDelete [protected, inherited]
 

true if the system should destroy this item, false if client code will destroy the item.

Definition at line 437 of file CEGUIListboxItem.h.

bool CEGUI::ListboxItem::d_disabled [protected, inherited]
 

true if this item is disabled. false if the item is not disabled.

Definition at line 436 of file CEGUIListboxItem.h.

const Font* CEGUI::ListboxTextItem::d_font [protected]
 

Font used for rendering text.

Definition at line 179 of file CEGUIListboxTextItem.h.

Referenced by getFont().

void* CEGUI::ListboxItem::d_itemData [protected, inherited]
 

Pointer to some client code data. This has no meaning within the GUI system.

Definition at line 434 of file CEGUIListboxItem.h.

uint CEGUI::ListboxItem::d_itemID [protected, inherited]
 

ID code assigned by client code. This has no meaning within the GUI system.

Definition at line 433 of file CEGUIListboxItem.h.

String CEGUI::ListboxItem::d_itemText [protected, inherited]
 

Text for this list box item. If not rendered, this is still used for list sorting.

Definition at line 431 of file CEGUIListboxItem.h.

Referenced by draw(), and getPixelSize().

const Window* CEGUI::ListboxItem::d_owner [protected, inherited]
 

Pointer to the window that owns this item.

Definition at line 438 of file CEGUIListboxItem.h.

Referenced by getFont().

const Image* CEGUI::ListboxItem::d_selectBrush [protected, inherited]
 

Image used for rendering selection.

Definition at line 440 of file CEGUIListboxItem.h.

Referenced by draw().

ColourRect CEGUI::ListboxItem::d_selectCols [protected, inherited]
 

Colours used for selection highlighting.

Definition at line 439 of file CEGUIListboxItem.h.

Referenced by draw(), and CEGUI::ListboxItem::setSelectionColours().

bool CEGUI::ListboxItem::d_selected [protected, inherited]
 

true if this item is selected. false if the item is not selected.

Definition at line 435 of file CEGUIListboxItem.h.

Referenced by draw().

ColourRect CEGUI::ListboxTextItem::d_textCols [protected]
 

Colours used for rendering the text.

Definition at line 178 of file CEGUIListboxTextItem.h.

Referenced by draw(), and setTextColours().

String CEGUI::ListboxItem::d_tooltipText [protected, inherited]
 

Text for the individual tooltip of this item.

Definition at line 432 of file CEGUIListboxItem.h.

const colour CEGUI::ListboxItem::DefaultSelectionColour = 0xFF4444AA [static, inherited]
 

Default selection brush colour.

Definition at line 38 of file CEGUIListboxItem.cpp.

const colour CEGUI::ListboxTextItem::DefaultTextColour = 0xFFFFFFFF [static]
 

Default text colour.

Definition at line 38 of file CEGUIListboxTextItem.cpp.


The documentation for this class was generated from the following files:
Generated on Wed Sep 7 10:08:29 2005 for Crazy Eddies GUI System by  doxygen 1.4.3