28 #ifndef _CEGUITreeItem_h_
29 #define _CEGUITreeItem_h_
31 #include "../CEGUIBase.h"
32 #include "../CEGUIString.h"
33 #include "../CEGUIColourRect.h"
34 #include "../CEGUIBasicRenderedStringParser.h"
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
61 typedef std::vector<TreeItem*> LBItemList;
78 TreeItem(
const String& text, uint item_id = 0,
void* item_data = 0,
79 bool disabled =
false,
bool auto_delete =
true);
100 Font* getFont(
void)
const;
110 {
return d_textCols; }
125 void setFont(
Font* font);
138 void setFont(
const String& font_name);
151 { d_textCols = cols; d_renderedStringValid =
false; }
176 void setTextColours(
colour top_left_colour,
colour top_right_colour,
190 { setTextColours(col, col, col, col); }
205 const String& getTextVisual()
const;
216 {
return d_tooltipText; }
243 {
return d_itemData; }
254 {
return d_selected; }
265 {
return d_disabled; }
281 {
return d_autoDelete; }
304 {
return d_selectCols; }
315 {
return d_selectBrush; }
334 void setText(
const String& text);
348 { d_tooltipText = text; }
364 { d_itemID = item_id; }
380 { d_itemData = item_data; }
394 { d_selected = setting; }
408 { d_disabled = setting; }
426 { d_autoDelete = setting; }
454 { d_selectCols = cols; }
480 void setSelectionColours(
colour top_left_colour,
482 colour bottom_left_colour,
483 colour bottom_right_colour);
496 { setSelectionColours(col, col, col, col); }
510 { d_selectBrush = image; }
526 void setSelectionBrushImage(
const String& imageset,
const String& image);
537 { d_buttonLocation = buttonOffset; }
539 Rect &getButtonLocation(
void)
540 {
return d_buttonLocation; }
545 void toggleIsOpen(
void)
546 { d_isOpen = !d_isOpen; }
548 TreeItem *getTreeItemFromIndex(
size_t itemIndex);
550 size_t getItemCount(
void)
const
551 {
return d_listItems.size(); }
553 LBItemList &getItemList(
void)
554 {
return d_listItems; }
556 void addItem(TreeItem* item);
557 void removeItem(
const TreeItem* item);
559 void setIcon(
const Image &theIcon)
560 { d_iconImage = (Image *) & theIcon; }
572 virtual Size getPixelSize(
void)
const;
591 virtual void draw(GeometryBuffer& buffer,
const Rect& targetRect,
592 float alpha,
const Rect* clipper)
const;
602 {
return getText() < rhs.
getText(); }
609 {
return getText() > rhs.
getText(); }
628 colour calculateModulatedAlphaColour(
colour col,
float alpha)
const;
631 void parseTextString()
const;
682 #if defined(_MSC_VER)
683 # pragma warning(pop)
686 #endif // end of guard _CEGUITreeItem_h_
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 in...
Definition: CEGUITreeItem.h:440
bool d_disabled
true if item is disabled. false if item is not disabled.
Definition: CEGUITreeItem.h:651
bool d_selected
true if item is selected. false if item is not selected.
Definition: CEGUITreeItem.h:649
const Window * d_owner
Pointer to the window that owns this item.
Definition: CEGUITreeItem.h:657
void setSelectionColours(const ColourRect &cols)
Set the colours used for selection highlighting.
Definition: CEGUITreeItem.h:453
void setSelected(bool setting)
Set the selected state for the item.
Definition: CEGUITreeItem.h:393
bool d_autoDelete
true if the system will destroy this item, false if client code will.
Definition: CEGUITreeItem.h:653
bool isSelected(void) const
return whether this item is selected.
Definition: CEGUITreeItem.h:253
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.
Definition: CEGUITreeItem.h:425
uint d_itemID
ID code assigned by client code.
Definition: CEGUITreeItem.h:645
bool d_isOpen
true if the this item's tree branch is opened.
Definition: CEGUITreeItem.h:671
static BasicRenderedStringParser d_stringParser
Parser used to produce a final RenderedString from the standard String.
Definition: CEGUITreeItem.h:673
const Image * d_selectBrush
Image used for rendering selection.
Definition: CEGUITreeItem.h:661
virtual bool operator<(const TreeItem &rhs) const
Less-than operator, compares item texts.
Definition: CEGUITreeItem.h:601
static const colour DefaultTextColour
Default text colour.
Definition: CEGUITreeItem.h:67
Class that represents a single Image of an Imageset.
Definition: CEGUIImage.h:57
void setTextColours(const ColourRect &cols)
Set the colours used for text rendering.
Definition: CEGUITreeItem.h:150
LBItemList d_listItems
list of items in this item's tree branch.
Definition: CEGUITreeItem.h:669
void setTooltipText(const String &text)
Set the tooltip text to be used for this item.
Definition: CEGUITreeItem.h:347
const String & getTooltipText(void) const
Return the text string currently set to be used as the tooltip text for this item.
Definition: CEGUITreeItem.h:215
void setSelectionColours(colour col)
Set the colours used for selection highlighting.
Definition: CEGUITreeItem.h:495
Image * d_iconImage
Image for the icon to be displayed with this TreeItem.
Definition: CEGUITreeItem.h:667
void * getUserData(void) const
Return the pointer to any client assigned user data attached to this tree item.
Definition: CEGUITreeItem.h:242
Class representing colour values within the system.
Definition: CEGUIcolour.h:45
void setUserData(void *item_data)
Set the client assigned user data attached to this lis box item.
Definition: CEGUITreeItem.h:379
ColourRect d_textCols
Colours used for rendering the text.
Definition: CEGUITreeItem.h:663
Class that holds details of colours for the four corners of a rectangle.
Definition: CEGUIColourRect.h:44
Base class for tree items.
Definition: CEGUITreeItem.h:58
String d_tooltipText
Text for the individual tooltip of this item.
Definition: CEGUITreeItem.h:643
bool isAutoDeleted(void) const
return whether this item will be automatically deleted when it is removed from the tree or when the t...
Definition: CEGUITreeItem.h:280
Rect d_buttonLocation
Location of the 'expand' button for the item.
Definition: CEGUITreeItem.h:655
ColourRect d_selectCols
Colours used for selection highlighting.
Definition: CEGUITreeItem.h:659
ColourRect getTextColours(void) const
Return the current colours used for text rendering.
Definition: CEGUITreeItem.h:109
Class representing a rendered string of entities.
Definition: CEGUIRenderedString.h:50
Abstract class to wrap a BiDi visual mapping of a text string.
Definition: CEGUIBiDiVisualMapping.h:51
const Image * getSelectionBrushImage(void) const
Return the current selection highlighting brush.
Definition: CEGUITreeItem.h:314
String d_textLogical
Text for this tree item. If not rendered, still used for sorting.
Definition: CEGUITreeItem.h:637
Class that encapsulates a typeface.
Definition: CEGUIFont.h:58
static const colour DefaultSelectionColour
Default selection brush colour.
Definition: CEGUITreeItem.h:69
void setSelectionBrushImage(const Image *image)
Set the selection highlighting brush image.
Definition: CEGUITreeItem.h:509
void setTextColours(colour col)
Set the colours used for text rendering.
Definition: CEGUITreeItem.h:189
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: CEGUIWindow.h:138
RenderedString d_renderedString
RenderedString drawn by this item.
Definition: CEGUITreeItem.h:675
bool d_bidiDataValid
whether bidi visual mapping has been updated since last text change.
Definition: CEGUITreeItem.h:641
void * d_itemData
Pointer to some client code data.
Definition: CEGUITreeItem.h:647
Basic RenderedStringParser class that offers support for the following tags:
Definition: CEGUIBasicRenderedStringParser.h:65
ColourRect getSelectionColours(void) const
Return the current colours used for selection highlighting.
Definition: CEGUITreeItem.h:303
const Window * getOwnerWindow(void)
Get the owner window for this TreeItem.
Definition: CEGUITreeItem.h:293
bool isDisabled(void) const
return whether this item is disabled.
Definition: CEGUITreeItem.h:264
virtual bool operator>(const TreeItem &rhs) const
Greater-than operator, compares item texts.
Definition: CEGUITreeItem.h:608
void setID(uint item_id)
Set the ID assigned to this tree item.
Definition: CEGUITreeItem.h:363
const String & getText() const
return the text string set for this tree item.
Definition: CEGUITreeItem.h:202
Font * d_font
Font used for rendering text.
Definition: CEGUITreeItem.h:665
void setDisabled(bool setting)
Set the disabled state for the item.
Definition: CEGUITreeItem.h:407
void setButtonLocation(Rect &buttonOffset)
Tell the treeItem where its button is located. Calculated and set in Tree.cpp.
Definition: CEGUITreeItem.h:536
uint getID(void) const
Return the current ID assigned to this tree item.
Definition: CEGUITreeItem.h:228
Class encapsulating operations on a Rectangle.
Definition: CEGUIRect.h:44
String class used within the GUI system.
Definition: CEGUIString.h:57
bool d_renderedStringValid
boolean used to track when item state changes (and needs re-parse)
Definition: CEGUITreeItem.h:677