28 #ifndef _CEGUITreeItem_h_
29 #define _CEGUITreeItem_h_
32 #include "../String.h"
33 #include "../ColourRect.h"
34 #include "../BasicRenderedStringParser.h"
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
63 CEGUI_VECTOR_ALLOC(
TreeItem*)> LBItemList;
80 TreeItem(
const String& text, uint item_id = 0,
void* item_data = 0,
81 bool disabled =
false,
bool auto_delete =
true);
102 const Font* getFont(
void)
const;
112 {
return d_textCols; }
127 void setFont(
const Font* font);
140 void setFont(
const String& font_name);
153 { d_textCols = cols; d_renderedStringValid =
false; }
178 void setTextColours(
Colour top_left_colour,
Colour top_right_colour,
207 const String& getTextVisual()
const;
218 {
return d_tooltipText; }
230 uint getID(
void)
const
244 void* getUserData(
void)
const
245 {
return d_itemData; }
255 bool isSelected(
void)
const
256 {
return d_selected; }
266 bool isDisabled(
void)
const
267 {
return d_disabled; }
282 bool isAutoDeleted(
void)
const
283 {
return d_autoDelete; }
306 {
return d_selectCols; }
316 const Image* getSelectionBrushImage(
void)
const
317 {
return d_selectBrush; }
336 void setText(
const String& text);
350 { d_tooltipText = text; }
365 void setID(uint item_id)
366 { d_itemID = item_id; }
381 void setUserData(
void* item_data)
382 { d_itemData = item_data; }
395 void setSelected(
bool setting)
396 { d_selected = setting; }
409 void setDisabled(
bool setting)
410 { d_disabled = setting; }
427 void setAutoDeleted(
bool setting)
428 { d_autoDelete = setting; }
456 { d_selectCols = cols; }
482 void setSelectionColours(
Colour top_left_colour,
484 Colour bottom_left_colour,
485 Colour bottom_right_colour);
511 void setSelectionBrushImage(
const Image* image)
512 { d_selectBrush = image; }
525 void setSelectionBrushImage(
const String& name);
535 void setButtonLocation(
Rectf& buttonOffset)
536 { d_buttonLocation = buttonOffset; }
538 Rectf& getButtonLocation(
void)
539 {
return d_buttonLocation; }
544 void toggleIsOpen(
void)
545 { d_isOpen = !d_isOpen; }
547 TreeItem *getTreeItemFromIndex(
size_t itemIndex);
549 size_t getItemCount(
void)
const
550 {
return d_listItems.size(); }
552 LBItemList &getItemList(
void)
553 {
return d_listItems; }
555 void addItem(TreeItem* item);
556 void removeItem(
const TreeItem* item);
558 void setIcon(
const Image &theIcon)
559 { d_iconImage = &theIcon; }
571 virtual Sizef getPixelSize(
void)
const;
590 virtual void draw(GeometryBuffer& buffer,
const Rectf& targetRect,
591 float alpha,
const Rectf* clipper)
const;
605 virtual bool handleFontRenderSizeChange(
const Font*
const font);
615 {
return getText() < rhs.
getText(); }
622 {
return getText() > rhs.
getText(); }
641 Colour calculateModulatedAlphaColour(
Colour col,
float alpha)
const;
644 void parseTextString()
const;
695 #if defined(_MSC_VER)
696 # pragma warning(pop)
699 #endif // end of guard _CEGUITreeItem_h_