Crazy Eddies GUI System: CEGUI::TreeItem Class Reference

Crazy Eddies GUI System 0.7.6

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
CEGUI::TreeItem Class Reference

Base class for tree items. More...

Collaboration diagram for CEGUI::TreeItem:
[legend]

List of all members.

## Public Types
typedef std::vector< TreeItem * > | LBItemList
## Public Member Functions
| TreeItem (const String &text, uint item_id=0, void *item_data=0, bool disabled=false, bool auto_delete=true)
| base class constructor
virtual | ~TreeItem (void)
| base class destructor
Font * | getFont (void) const
| Return a pointer to the font being used by this TreeItem.
ColourRect | getTextColours (void) const
| Return the current colours used for text rendering.
void | setFont (Font *font)
| Set the font to be used by this TreeItem.
void | setFont (const String &font_name)
| Set the font to be used by this TreeItem.
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.
const String & | getText () const
| return the text string set for this tree item.
const String & | getTextVisual () const
| return text string with visual ordering of glyphs.
const String & | getTooltipText (void) const
| Return the text string currently set to be used as the tooltip text for this item.
uint | getID (void) const
| Return the current ID assigned to this tree item.
void * | getUserData (void) const
| Return the pointer to any client assigned user data attached to this tree 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 it is removed from the tree or when the the tree it is attached to is destroyed.
const Window * | getOwnerWindow (void)
| Get the owner window for this TreeItem.
ColourRect | getSelectionColours (void) const
| Return the current colours used for selection highlighting.
const Image * | getSelectionBrushImage (void) const
| Return the current selection highlighting brush.
void | setText (const String &text)
| set the text string for this tree item.
void | setTooltipText (const String &text)
| Set the tooltip text to be used for this item.
void | setID (uint item_id)
| Set the ID assigned to this tree item.
void | setUserData (void *item_data)
| Set the client assigned user data attached to this lis box item.
void | setSelected (bool setting)
| Set the selected state for the item.
void | setDisabled (bool setting)
| Set the disabled state for the item.
void | setAutoDeleted (bool setting)
| Set whether this item will be automatically deleted when it is removed from the tree, or when the tree it is attached to is destroyed.
void | setOwnerWindow (const Window *owner)
| Set the owner window for this TreeItem. This is called by the tree widget 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.
void | setButtonLocation (Rect &buttonOffset)
| Tell the treeItem where its button is located. Calculated and set in Tree.cpp.
Rect & | getButtonLocation (void)
bool | getIsOpen (void)
void | toggleIsOpen (void)
TreeItem * | getTreeItemFromIndex (size_t itemIndex)
size_t | getItemCount (void) const
LBItemList & | getItemList (void)
void | addItem (TreeItem *item)
void | removeItem (const TreeItem *item)
void | setIcon (const Image &theIcon)
virtual Size | getPixelSize (void) const
| Return the rendered pixel size of this tree item.
virtual void | draw (GeometryBuffer &buffer, const Rect &targetRect, float alpha, const Rect *clipper) const
| Draw the tree item in its current state.
virtual bool | operator< (const TreeItem &rhs) const
| Less-than operator, compares item texts.
virtual bool | operator> (const TreeItem &rhs) const
| Greater-than operator, compares item texts.
## Static Public Attributes
static const colour | DefaultTextColour
| Default text colour.
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.
void | parseTextString () const
| parse the text visual string into a RenderString representation.
## Protected Attributes
String | d_textLogical
| Text for this tree item. If not rendered, still used for sorting.
BiDiVisualMapping * | d_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.
void * | d_itemData
| Pointer to some client code data.
bool | d_selected
| true if item is selected. false if item is not selected.
bool | d_disabled
| true if item is disabled. false if item is not disabled.
bool | d_autoDelete
| true if the system will destroy this item, false if client code will.
Rect | d_buttonLocation
| Location of the 'expand' button for the item.
const Window * | d_owner
| Pointer to the window that owns this item.
ColourRect | d_selectCols
| Colours used for selection highlighting.
const Image * | d_selectBrush
| Image used for rendering selection.
ColourRect | d_textCols
| Colours used for rendering the text.
Font * | d_font
| Font used for rendering text.
Image * | d_iconImage
| Image for the icon to be displayed with this TreeItem.
LBItemList | d_listItems
| list of items in this item's tree branch.
bool | d_isOpen
| true if the this item's tree branch is opened.
RenderedString | d_renderedString
| RenderedString drawn by this item.
bool | d_renderedStringValid
| boolean used to track when item state changes (and needs re-parse)
## Static Protected Attributes
static BasicRenderedStringParser | d_stringParser
| Parser used to produce a final RenderedString from the standard String.

## Detailed Description

Base class for tree items.

Deprecated:
  The CEGUI::Tree, CEGUI::TreeItem and any other associated classes are deprecated and thier use should be minimised - preferably eliminated - where possible. It is extremely unfortunate that this widget was ever added to CEGUI since its design and implementation are poor and do not meet established standards for the CEGUI project.

  While no alternative currently exists, a superior, replacement tree widget will be provided prior to the final removal of the current implementation.

## Member Function Documentation

virtual void CEGUI::TreeItem::draw | ( | GeometryBuffer & | buffer,
|  | const Rect & | targetRect,
|  | float | alpha,
|  | const Rect * | clipper
| ) |  | const`[virtual]`

Draw the tree item in its current state.

Parameters:

  position | Vector2 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.

Font* CEGUI::TreeItem::getFont | ( | void |  | ) | const

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

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

uint CEGUI::TreeItem::getID | ( | void |  | ) | const`[inline]`

Return the current ID assigned to this tree 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 tree item

const Window* CEGUI::TreeItem::getOwnerWindow | ( | void |  | ) | `[inline]`

Get the owner window for this TreeItem.

The owner of a TreeItem is typically set by the tree widget when an item is added or inserted.

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

virtual Size CEGUI::TreeItem::getPixelSize | ( | void |  | ) | const`[virtual]`

Return the rendered pixel size of this tree item.

Returns:
  Size object describing the size of the tree item in pixels.

const Image* CEGUI::TreeItem::getSelectionBrushImage | ( | void |  | ) | const`[inline]`

Return the current selection highlighting brush.

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

ColourRect CEGUI::TreeItem::getSelectionColours | ( | void |  | ) | const`[inline]`

Return the current colours used for selection highlighting.

Returns:
  ColourRect object describing the currently set colours.

const String& CEGUI::TreeItem::getText | ( |  | ) | const`[inline]`

return the text string set for this tree item.

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

Returns:
  String object containing the current text for the tree item.

Referenced by operator<(), and operator>().

ColourRect CEGUI::TreeItem::getTextColours | ( | void |  | ) | const`[inline]`

Return the current colours used for text rendering.

Returns:
  ColourRect object describing the currently set colours

const String& CEGUI::TreeItem::getTooltipText | ( | void |  | ) | const`[inline]`

Return the text string currently set to be used as the tooltip text for this item.

Returns:
  String object containing the current tooltip text as sued by this item.

void* CEGUI::TreeItem::getUserData | ( | void |  | ) | const`[inline]`

Return the pointer to any client assigned user data attached to this tree 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.

bool CEGUI::TreeItem::isAutoDeleted | ( | void |  | ) | const`[inline]`

return whether this item will be automatically deleted when it is removed from the tree or when the the tree it is attached to is destroyed.

Returns:
  - true if the item object will be deleted by the system when it is removed from the tree, or when the tree it is attached to is destroyed.

- false if client code must destroy the item after it is removed from the tree.

bool CEGUI::TreeItem::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::TreeItem::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::TreeItem::setAutoDeleted | ( | bool | setting | ) | `[inline]`

Set whether this item will be automatically deleted when it is removed from the tree, or when the tree it is attached to is destroyed.

Parameters:

  setting | true if the item object should be deleted by the system when the it is removed from the tree, or when the tree it is attached to is destroyed.

- false if client code will destroy the item after it is removed from the tree.

Returns:
  Nothing.

void CEGUI::TreeItem::setButtonLocation | ( | Rect & | buttonOffset | ) | `[inline]`

Tell the treeItem where its button is located. Calculated and set in Tree.cpp.

Parameters:

  buttonOffset | Location of the button in screenspace.

void CEGUI::TreeItem::setDisabled | ( | bool | setting | ) | `[inline]`

Set the disabled state for the item.

Parameters:

  setting | true if the item should be disabled. false if the item should be enabled.

Returns:
  Nothing.

void CEGUI::TreeItem::setFont | ( | const String & | font_name | ) |

Set the font to be used by this TreeItem.

Parameters:

  font_name | String object containing the name of the Font to be used for rendering this item

Returns:
  Nothing

void CEGUI::TreeItem::setFont | ( | Font * | font | ) |

Set the font to be used by this TreeItem.

Parameters:

  font | Font to be used for rendering this item

Returns:
  Nothing

void CEGUI::TreeItem::setID | ( | uint | item_id | ) | `[inline]`

Set the ID assigned to this tree 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 tree item

Returns:
  Nothing.

void CEGUI::TreeItem::setOwnerWindow | ( | const Window * | owner | ) | `[inline]`

Set the owner window for this TreeItem. This is called by the tree widget when an item is added or inserted.

Parameters:

  owner | Ponter to the window that should be considered the owner of this TreeItem.

Returns:
  Nothing

void CEGUI::TreeItem::setSelected | ( | bool | setting | ) | `[inline]`

Set the selected state for the item.

Parameters:

  setting | true if the item is selected. false if the item is not selected.

Returns:
  Nothing.

void CEGUI::TreeItem::setSelectionBrushImage | ( | const String & | imageset,
|  | const String & | image
| ) |  |

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.

void CEGUI::TreeItem::setSelectionBrushImage | ( | const Image * | image | ) | `[inline]`

Set the selection highlighting brush image.

Parameters:

  image | Pointer to the Image object to be used for selection highlighting.

Returns:
  Nothing.

void CEGUI::TreeItem::setSelectionColours | ( | colour | col | ) | `[inline]`

Set the colours used for selection highlighting.

Parameters:

  col | colour value to be used when rendering.

Returns:
  Nothing.

References setSelectionColours().

Referenced by setSelectionColours().

void CEGUI::TreeItem::setSelectionColours | ( | const ColourRect & | cols | ) | `[inline]`

Set the colours used for selection highlighting.

Parameters:

  cols | ColourRect object describing the colours to be used.

Returns:
  Nothing.

void CEGUI::TreeItem::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_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.

void CEGUI::TreeItem::setText | ( | const String & | text | ) |

set the text string for this tree item.

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

Parameters:

  text | String object containing the text to set for the tree item.

Returns:
  Nothing.

void CEGUI::TreeItem::setTextColours | ( | colour | col | ) | `[inline]`

Set the colours used for text rendering.

Parameters:

  col | colour value to be used when rendering.

Returns:
  Nothing.

References setTextColours().

Referenced by setTextColours().

void CEGUI::TreeItem::setTextColours | ( | const ColourRect & | cols | ) | `[inline]`

Set the colours used for text rendering.

Parameters:

  cols | ColourRect object describing the colours to be used.

Returns:
  Nothing.

void CEGUI::TreeItem::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.

void CEGUI::TreeItem::setTooltipText | ( | const String & | text | ) | `[inline]`

Set the tooltip text to be used for this item.

Parameters:

  text | String object holding the text to be used in the tooltip displayed for this item.

Returns:
  Nothing.

void CEGUI::TreeItem::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_data | Pointer to the user data to attach to this tree item.

Returns:
  Nothing.

## Member Data Documentation

String CEGUI::TreeItem::d_textLogical`[protected]`

Text for this tree item. If not rendered, still used for sorting.

text rendered by this component.