27 #ifndef _CEGUITreeItem_h_
28 #define _CEGUITreeItem_h_
31 #include "../String.h"
32 #include "../ColourRect.h"
33 #include "../BasicRenderedStringParser.h"
36 # pragma warning(push)
37 # pragma warning(disable : 4251)
62 CEGUI_VECTOR_ALLOC(
TreeItem*)> LBItemList;
79 TreeItem(
const String& text, uint item_id = 0,
void* item_data = 0,
80 bool disabled =
false,
bool auto_delete =
true);
101 const Font* getFont(
void)
const;
111 {
return d_textCols; }
126 void setFont(
const Font* font);
139 void setFont(
const String& font_name);
152 { d_textCols = cols; d_renderedStringValid =
false; }
177 void setTextColours(
Colour top_left_colour,
Colour top_right_colour,
206 const String& getTextVisual()
const;
217 {
return d_tooltipText; }
229 uint getID(
void)
const
243 void* getUserData(
void)
const
244 {
return d_itemData; }
254 bool isSelected(
void)
const
255 {
return d_selected; }
265 bool isDisabled(
void)
const
266 {
return d_disabled; }
281 bool isAutoDeleted(
void)
const
282 {
return d_autoDelete; }
305 {
return d_selectCols; }
315 const Image* getSelectionBrushImage(
void)
const
316 {
return d_selectBrush; }
335 void setText(
const String& text);
349 { d_tooltipText = text; }
364 void setID(uint item_id)
365 { d_itemID = item_id; }
380 void setUserData(
void* item_data)
381 { d_itemData = item_data; }
394 void setSelected(
bool setting)
395 { d_selected = setting; }
408 void setDisabled(
bool setting)
409 { d_disabled = setting; }
426 void setAutoDeleted(
bool setting)
427 { d_autoDelete = setting; }
455 { d_selectCols = cols; }
481 void setSelectionColours(
Colour top_left_colour,
483 Colour bottom_left_colour,
484 Colour bottom_right_colour);
510 void setSelectionBrushImage(
const Image* image)
511 { d_selectBrush = image; }
524 void setSelectionBrushImage(
const String& name);
534 void setButtonLocation(
Rectf& buttonOffset)
535 { d_buttonLocation = buttonOffset; }
537 Rectf& getButtonLocation(
void)
538 {
return d_buttonLocation; }
543 void toggleIsOpen(
void)
544 { d_isOpen = !d_isOpen; }
546 TreeItem *getTreeItemFromIndex(
size_t itemIndex);
548 size_t getItemCount(
void)
const
549 {
return d_listItems.size(); }
551 LBItemList &getItemList(
void)
552 {
return d_listItems; }
554 void addItem(TreeItem* item);
555 void removeItem(
const TreeItem* item);
557 void setIcon(
const Image &theIcon)
558 { d_iconImage = &theIcon; }
570 virtual Sizef getPixelSize(
void)
const;
589 virtual void draw(GeometryBuffer& buffer,
const Rectf& targetRect,
590 float alpha,
const Rectf* clipper)
const;
604 virtual bool handleFontRenderSizeChange(
const Font*
const font);
614 {
return getText() < rhs.
getText(); }
621 {
return getText() > rhs.
getText(); }
640 Colour calculateModulatedAlphaColour(
Colour col,
float alpha)
const;
643 void parseTextString()
const;
694 #if defined(_MSC_VER)
695 # pragma warning(pop)
698 #endif // end of guard _CEGUITreeItem_h_