Crazy Eddie's GUI System  0.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CEGUI::ListboxItem Class Referenceabstract

Base class for list box items. More...

+ Inheritance diagram for CEGUI::ListboxItem:
+ Collaboration diagram for CEGUI::ListboxItem:

Public Member Functions

 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 StringgetTooltipText (void) const
 return the text string set for this list box item. More...
 
const StringgetText (void) const
 
const StringgetTextVisual () const
 return text string with visual ordering of glyphs.
 
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...
 
virtual 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 &name)
 Set the selection highlighting brush image. More...
 
virtual bool handleFontRenderSizeChange (const Font *const font)
 Perform any updates needed because the given font's render size has changed. More...
 
virtual Sizef getPixelSize (void) const =0
 Return the rendered pixel size of this list box item. More...
 
virtual void draw (GeometryBuffer &buffer, const Rectf &targetRect, float alpha, const Rectf *clipper) const =0
 Draw the list box item in its current state. 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 DefaultSelectionColour
 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

String d_textLogical
 
BidiVisualMappingd_bidiVisualMapping
 pointer to bidirection support object
 
bool d_bidiDataValid
 whether bidi visual mapping has been updated since last text change.
 
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

Base class for list box items.

Member Function Documentation

virtual void CEGUI::ListboxItem::draw ( GeometryBuffer buffer,
const Rectf targetRect,
float  alpha,
const Rectf clipper 
) const
pure virtual

Draw the list box item in its current state.

Parameters
positionVecor2 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.

Implemented in CEGUI::ListboxTextItem.

uint CEGUI::ListboxItem::getID ( void  ) const
inline

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
const Window* CEGUI::ListboxItem::getOwnerWindow ( ) const
inline

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.
virtual Sizef CEGUI::ListboxItem::getPixelSize ( void  ) const
pure virtual

Return the rendered pixel size of this list box item.

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

Implemented in CEGUI::ListboxTextItem.

const Image* CEGUI::ListboxItem::getSelectionBrushImage ( void  ) const
inline

Return the current selection highlighting brush.

Returns
Pointer to the Image object currently used for selection highlighting.
ColourRect CEGUI::ListboxItem::getSelectionColours ( void  ) const
inline

Return the current colours used for selection highlighting.

Returns
ColourRect object describing the currently set colours
const String& CEGUI::ListboxItem::getTooltipText ( void  ) const
inline

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.
void* CEGUI::ListboxItem::getUserData ( void  ) const
inline

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.
virtual bool CEGUI::ListboxItem::handleFontRenderSizeChange ( const Font *const  font)
virtual

Perform any updates needed because the given font's render size has changed.

/note The base implementation just returns false.

Parameters
fontPointer to the Font whose render size has changed.
Returns
  • true if some action was taken.
  • false if no action was taken (i.e font is not used here).

Reimplemented in CEGUI::ListboxTextItem.

bool CEGUI::ListboxItem::isAutoDeleted ( void  ) const
inline

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.
bool CEGUI::ListboxItem::isDisabled ( void  ) const
inline

return whether this item is disabled.

Returns
true if the item is disabled, false if the item is enabled.
bool CEGUI::ListboxItem::isSelected ( void  ) const
inline

return whether this item is selected.

Returns
true if the item is selected, false if the item is not selected.
void CEGUI::ListboxItem::setAutoDeleted ( bool  setting)
inline

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
settingtrue 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.
void CEGUI::ListboxItem::setDisabled ( bool  setting)
inline

set whether this item is disabled.

Parameters
settingtrue if the item is disabled, false if the item is enabled.
Returns
Nothing.
void CEGUI::ListboxItem::setID ( uint  item_id)
inline

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_idID code to be assigned to this list box item
Returns
Nothing.
void CEGUI::ListboxItem::setOwnerWindow ( const Window owner)
inline

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

Parameters
ownerPonter to the window that should be considered the owner of this ListboxItem.
Returns
Nothing
void CEGUI::ListboxItem::setSelected ( bool  setting)
inline

set whether this item is selected.

Parameters
settingtrue if the item is selected, false if the item is not selected.
Returns
Nothing.
void CEGUI::ListboxItem::setSelectionBrushImage ( const Image image)
inline

Set the selection highlighting brush image.

Parameters
imagePointer to the Image object to be used for selection highlighting.
Returns
Nothing.
void CEGUI::ListboxItem::setSelectionBrushImage ( const String name)

Set the selection highlighting brush image.

Parameters
nameName of the image to be used
Returns
Nothing.
void CEGUI::ListboxItem::setSelectionColours ( const ColourRect cols)
inline

Set the colours used for selection highlighting.

Parameters
colsColourRect object describing the colours to be used.
Returns
Nothing.
void CEGUI::ListboxItem::setSelectionColours ( Colour  top_left_colour,
Colour  top_right_colour,
Colour  bottom_left_colour,
Colour  bottom_right_colour 
)

Set the colours used for selection highlighting.

Parameters
top_left_colourColour (as ARGB value) to be applied to the top-left corner of the selection area.
top_right_colourColour (as ARGB value) to be applied to the top-right corner of the selection area.
bottom_left_colourColour (as ARGB value) to be applied to the bottom-left corner of the selection area.
bottom_right_colourColour (as ARGB value) to be applied to the bottom-right corner of the selection area.
Returns
Nothing.
void CEGUI::ListboxItem::setSelectionColours ( Colour  col)
inline

Set the colours used for selection highlighting.

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

References setSelectionColours().

Referenced by setSelectionColours().

virtual void CEGUI::ListboxItem::setText ( const String text)
virtual

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
textString object containing the text to set for the list box item.
Returns
Nothing.

Reimplemented in CEGUI::ListboxTextItem.

void CEGUI::ListboxItem::setUserData ( void *  item_data)
inline

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_dataPointer to the user data to attach to this list item.
Returns
Nothing.