Torque2D Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Classes | Public Types | Public Member Functions | Public Attributes | List of all members
GuiTreeViewCtrl::Item Struct Reference

`#include <guiTreeViewCtrl.h>`

## Classes
struct | InspectorTag
struct | ScriptTag

## Public Types
enum | ItemState { Selected = BIT(0), Expanded = BIT(1), Focus = BIT(2), MouseOverBmp = BIT(3), MouseOverText = BIT(4), InspectorData = BIT(5), VirtualParent = BIT(6) }

## Public Member Functions
| Item (GuiControlProfile *pProfile)
| ~Item ()

## Public Attributes
BitSet32 | mState
SimObjectPtr< GuiControlProfile > | mProfile
S16 | mId
U16 | mTabLevel
Item * | mParent
Item * | mChild
Item * | mNext
Item * | mPrevious
S32 | mIcon
S32 | mDataRenderWidth
struct GuiTreeViewCtrl::Item::ScriptTag | mScriptInfo
struct GuiTreeViewCtrl::Item::InspectorTag | mInspectorInfo

## Get Methods
const S8 | getNormalImage () const
const S8 | getExpandedImage () const
char * | getText ()
char * | getValue ()
const S16 | getID () const
SimObject * | getObject ()
const U32 | getDisplayTextLength ()
const S32 | getDisplayTextWidth (GFont *font)
void | getDisplayText (U32 bufLen, char *buf)

## Set Methods
void | setExpanded (const bool f)
| Set whether an item is expanded or not (showing children or having them hidden) More...
void | setExpandedImage (const S8 id)
| Set the image to display when an item IS expanded. More...
void | setNormalImage (const S8 id)
| Set the image to display when an item is NOT expanded. More...
void | setObject (SimObject *obj)
| Assign a SimObject pointer to an inspector data item. More...
void | setText (char *txt)
| Set the items displayable text (caption) More...
void | setValue (const char *val)
| Set the items script value (data) More...
void | setVirtualParent (bool value)
| Set the items virtual parent flag. More...

## State Retrieval
const bool | isExpanded () const
const bool | isInspectorData () const
const bool | isParent () const

## Searching Methods
Item * | findChildByValue (const SimObject *obj)
| Find an inspector data item by it's SimObject pointer. More...
Item * | findChildByValue (StringTableEntry Value)
| Find a regular data item by it's script value. More...

## Detailed Description

# Introduction

## Member Enumeration Documentation

enum ItemState

Enumerator
Selected |
Expanded |
Focus |
MouseOverBmp |
MouseOverText |
InspectorData | Set if we're representing some inspector info (ie, use mInspectorInfo, not mScriptInfo)
VirtualParent | This indicates that we should be rendered as a parent even though we don't have any children. This is useful for preventing scenarios where we might want to create thousands of Items that might never be shown (for instance if we're browsing the object hierarchy in Torque, which might have thousands of objects).

## Constructor & Destructor Documentation

Item | ( | GuiControlProfile * | pProfile | ) |

this stores the pixel width needed to render the item's data in the onRenderCell function to optimize for speed.

~Item | ( |  | ) |

## Member Function Documentation

GuiTreeViewCtrl::Item * findChildByValue | ( | const SimObject * | obj | ) |

Find an inspector data item by it's SimObject pointer.

GuiTreeViewCtrl::Item * findChildByValue | ( | StringTableEntry | Value | ) |

Find a regular data item by it's script value.

void getDisplayText | ( | U32 | bufLen,
|  | char * | buf
| ) |  |

const U32 getDisplayTextLength | ( |  | ) |

const S32 getDisplayTextWidth | ( | GFont * | font | ) |

const S8 getExpandedImage | ( |  | ) | const

const S16 getID | ( |  | ) | const
| inline

const S8 getNormalImage | ( |  | ) | const

SimObject * getObject | ( |  | ) |

char * getText | ( |  | ) |

char * getValue | ( |  | ) |

const bool isExpanded | ( |  | ) | const

Returns true if this item is expanded. For inspector objects, the expansion is stored on the SimObject, for other things we use our bit vector.

const bool isInspectorData | ( |  | ) | const
| inline

Returns true if an item is inspector data or false if it's just an item.

const bool isParent | ( |  | ) | const

Returns true if we should show the expand art and make the item interact with the mouse as if it were a parent.

void setExpanded | ( | const bool | f | ) |

Set whether an item is expanded or not (showing children or having them hidden)

void setExpandedImage | ( | const S8 | id | ) |

Set the image to display when an item IS expanded.

void setNormalImage | ( | const S8 | id | ) |

Set the image to display when an item is NOT expanded.

void setObject | ( | SimObject * | obj | ) |

Assign a SimObject pointer to an inspector data item.

void setText | ( | char * | txt | ) |

Set the items displayable text (caption)

void setValue | ( | const char * | val | ) |

Set the items script value (data)

void setVirtualParent | ( | bool | value | ) |

Set the items virtual parent flag.

## Member Data Documentation

Item* mChild

S32 mDataRenderWidth

S32 mIcon

S16 mId

struct GuiTreeViewCtrl::Item::InspectorTag mInspectorInfo

Item* mNext

Item* mParent

Item* mPrevious

SimObjectPtr<GuiControlProfile> mProfile

struct GuiTreeViewCtrl::Item::ScriptTag mScriptInfo

BitSet32 mState

U16 mTabLevel

The documentation for this struct was generated from the following files:

- gui/guiTreeViewCtrl.h
- gui/guiTreeViewCtrl.cc