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; }
176 void setTextColours(
colour top_left_colour,
colour top_right_colour,
205 const String& getTextVisual()
const;
216 {
return d_tooltipText; }
228 uint getID(
void)
const
242 void* getUserData(
void)
const
243 {
return d_itemData; }
253 bool isSelected(
void)
const
254 {
return d_selected; }
264 bool isDisabled(
void)
const
265 {
return d_disabled; }
280 bool isAutoDeleted(
void)
const
281 {
return d_autoDelete; }
304 {
return d_selectCols; }
314 const Image* getSelectionBrushImage(
void)
const
315 {
return d_selectBrush; }
334 void setText(
const String& text);
348 { d_tooltipText = text; }
363 void setID(uint item_id)
364 { d_itemID = item_id; }
379 void setUserData(
void* item_data)
380 { d_itemData = item_data; }
393 void setSelected(
bool setting)
394 { d_selected = setting; }
407 void setDisabled(
bool setting)
408 { d_disabled = setting; }
425 void setAutoDeleted(
bool 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);
509 void setSelectionBrushImage(
const Image* image)
510 { d_selectBrush = image; }
526 void setSelectionBrushImage(
const String& imageset,
const String& image);
536 void setButtonLocation(
Rect &buttonOffset)
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_