Crazy Eddie's GUI System
0.8.7
|
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;
80 bool disabled =
false,
bool auto_delete =
true);
111 {
return d_textCols; }
152 { d_textCols = cols; d_renderedStringValid =
false; }
191 { setTextColours(col, col, col, col); }
217 {
return d_tooltipText; }
244 {
return d_itemData; }
255 {
return d_selected; }
266 {
return d_disabled; }
282 {
return d_autoDelete; }
305 {
return d_selectCols; }
316 {
return d_selectBrush; }
349 { d_tooltipText = text; }
365 { d_itemID = item_id; }
381 { d_itemData = item_data; }
395 { d_selected = setting; }
409 { d_disabled = setting; }
427 { d_autoDelete = setting; }
455 { d_selectCols = cols; }
483 Colour bottom_left_colour,
484 Colour bottom_right_colour);
497 { setSelectionColours(col, col, col, col); }
511 { d_selectBrush = image; }
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; }
590 float alpha,
const Rectf* clipper)
const;
614 {
return getText() < rhs.
getText(); }
621 {
return getText() > rhs.
getText(); }
694 #if defined(_MSC_VER)
695 # pragma warning(pop)
698 #endif // end of guard _CEGUITreeItem_h_
const Image * d_iconImage
Image for the icon to be displayed with this TreeItem.
Definition: TreeItem.h:679
Abstract class defining the interface for objects that buffer geometry for later rendering.
Definition: GeometryBuffer.h:44
bool d_selected
true if item is selected. false if item is not selected.
Definition: TreeItem.h:661
virtual void draw(GeometryBuffer &buffer, const Rectf &targetRect, float alpha, const Rectf *clipper) const
Draw the tree item in its current state.
Class that encapsulates a typeface.
Definition: Font.h:62
void setSelectionColours(Colour col)
Set the colours used for selection highlighting.
Definition: TreeItem.h:496
const Window * d_owner
Pointer to the window that owns this item.
Definition: TreeItem.h:669
void setSelected(bool setting)
Set the selected state for the item.
Definition: TreeItem.h:394
void setAutoDeleted(bool setting)
Set whether this item will be automatically deleted when it is removed from the tree,...
Definition: TreeItem.h:426
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: TreeItem.h:441
TreeItem(const String &text, uint item_id=0, void *item_data=0, bool disabled=false, bool auto_delete=true)
base class constructor
Base class for tree items.
Definition: TreeItem.h:59
void * getUserData(void) const
Return the pointer to any client assigned user data attached to this tree item.
Definition: TreeItem.h:243
ColourRect getSelectionColours(void) const
Return the current colours used for selection highlighting.
Definition: TreeItem.h:304
void setFont(const Font *font)
Set the font to be used by this TreeItem.
virtual ~TreeItem(void)
base class destructor
static BasicRenderedStringParser d_stringParser
Parser used to produce a final RenderedString from the standard String.
Definition: TreeItem.h:685
bool d_disabled
true if item is disabled. false if item is not disabled.
Definition: TreeItem.h:663
void setTextColours(Colour col)
Set the colours used for text rendering.
Definition: TreeItem.h:190
void setSelectionBrushImage(const String &name)
Set the selection highlighting brush image.
bool isSelected(void) const
return whether this item is selected.
Definition: TreeItem.h:254
ColourRect d_selectCols
Colours used for selection highlighting.
Definition: TreeItem.h:671
void setSelectionColours(const ColourRect &cols)
Set the colours used for selection highlighting.
Definition: TreeItem.h:454
LBItemList d_listItems
list of items in this item's tree branch.
Definition: TreeItem.h:681
void setUserData(void *item_data)
Set the client assigned user data attached to this lis box item.
Definition: TreeItem.h:380
bool isAutoDeleted(void) const
return whether this item will be automatically deleted when it is removed from the tree or when the t...
Definition: TreeItem.h:281
const Font * d_font
Font used for rendering text.
Definition: TreeItem.h:677
uint getID(void) const
Return the current ID assigned to this tree item.
Definition: TreeItem.h:229
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
Class representing a rendered string of entities.
Definition: RenderedString.h:52
void setTextColours(const ColourRect &cols)
Set the colours used for text rendering.
Definition: TreeItem.h:151
void setTooltipText(const String &text)
Set the tooltip text to be used for this item.
Definition: TreeItem.h:348
Definition: MemoryAllocatedObject.h:110
Class that holds details of colours for the four corners of a rectangle.
Definition: ColourRect.h:45
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.
Abstract class to wrap a Bidi visual mapping of a text string.
Definition: BidiVisualMapping.h:52
const String & getTextVisual() const
return text string with visual ordering of glyphs.
void setSelectionBrushImage(const Image *image)
Set the selection highlighting brush image.
Definition: TreeItem.h:510
bool isDisabled(void) const
return whether this item is disabled.
Definition: TreeItem.h:265
ColourRect d_textCols
Colours used for rendering the text.
Definition: TreeItem.h:675
String d_textLogical
Text for this tree item. If not rendered, still used for sorting.
Definition: TreeItem.h:649
virtual bool operator>(const TreeItem &rhs) const
Greater-than operator, compares item texts.
Definition: TreeItem.h:620
String d_tooltipText
Text for the individual tooltip of this item.
Definition: TreeItem.h:655
void setText(const String &text)
set the text string for this tree item.
virtual bool handleFontRenderSizeChange(const Font *const font)
Perform any updates needed because the given font's render size has changed.
ColourRect getTextColours(void) const
Return the current colours used for text rendering.
Definition: TreeItem.h:110
RenderedString d_renderedString
RenderedString drawn by this item.
Definition: TreeItem.h:687
void * d_itemData
Pointer to some client code data.
Definition: TreeItem.h:659
const Window * getOwnerWindow(void)
Get the owner window for this TreeItem.
Definition: TreeItem.h:294
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.
bool d_bidiDataValid
whether bidi visual mapping has been updated since last text change.
Definition: TreeItem.h:653
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:151
void parseTextString() const
parse the text visual string into a RenderString representation.
void setButtonLocation(Rectf &buttonOffset)
Tell the treeItem where its button is located. Calculated and set in Tree.cpp.
Definition: TreeItem.h:534
const String & getText() const
return the text string set for this tree item.
Definition: TreeItem.h:203
static const Colour DefaultTextColour
Default text colour.
Definition: TreeItem.h:68
virtual Sizef getPixelSize(void) const
Return the rendered pixel size of this tree item.
static const Colour DefaultSelectionColour
Default selection brush colour.
Definition: TreeItem.h:70
void setID(uint item_id)
Set the ID assigned to this tree item.
Definition: TreeItem.h:364
const Image * getSelectionBrushImage(void) const
Return the current selection highlighting brush.
Definition: TreeItem.h:315
String class used within the GUI system.
Definition: String.h:64
bool d_renderedStringValid
boolean used to track when item state changes (and needs re-parse)
Definition: TreeItem.h:689
ColourRect getModulateAlphaColourRect(const ColourRect &cols, float alpha) const
Return a ColourRect object describing the colours in cols after having their alpha component modulate...
Rectf d_buttonLocation
Location of the 'expand' button for the item.
Definition: TreeItem.h:667
virtual bool operator<(const TreeItem &rhs) const
Less-than operator, compares item texts.
Definition: TreeItem.h:613
void setDisabled(bool setting)
Set the disabled state for the item.
Definition: TreeItem.h:408
const String & getTooltipText(void) const
Return the text string currently set to be used as the tooltip text for this item.
Definition: TreeItem.h:216
Class representing colour values within the system.
Definition: Colour.h:46
Colour calculateModulatedAlphaColour(Colour col, float alpha) const
Return a colour value describing the colour specified by col after having its alpha component modulat...
Basic RenderedStringParser class that offers support for the following tags:
Definition: BasicRenderedStringParser.h:65
Interface for Image.
Definition: Image.h:161
const Font * getFont(void) const
Return a pointer to the font being used by this TreeItem.
uint d_itemID
ID code assigned by client code.
Definition: TreeItem.h:657
bool d_autoDelete
true if the system will destroy this item, false if client code will.
Definition: TreeItem.h:665
bool d_isOpen
true if the this item's tree branch is opened.
Definition: TreeItem.h:683
void setFont(const String &font_name)
Set the font to be used by this TreeItem.
const Image * d_selectBrush
Image used for rendering selection.
Definition: TreeItem.h:673