Torque3D Documentation / _generateds / GuiTreeViewCtrl::Item

GuiTreeViewCtrl::Item

Engine/source/gui/controls/guiTreeViewCtrl.h

More...

Classes:

Set Methods

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

Set the image to display when an item IS expanded.

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

Assign a SimObject pointer to an inspector data item.

Set the items displayable text (caption)

Set the items script value (data)

setVirtualParent(bool value)

Set the items virtual parent flag.

setFiltered(bool value)

Set whether the item is filtered out or not.

State Retrieval

bool

Returns true if this item is expanded.

bool

Return whether the item is current filtered out or not.

bool

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

bool

Returns true if we've been manually set to allow dragging overrides.

bool

Returns true if we've been manually set to allow dragging overrides.

bool

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

bool

Return true if text label for inspector item should include internal name only.

bool

Return true if text label for inspector item should include object name only.

Searching Methods

Item *
findChildByName(const char * name)

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

Item *

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

Item *

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

Public Types

enum
ItemState {
  Selected = BIT( 0 )
  Expanded = BIT( 1 )
  Marked = BIT( 2 )
  Filtered = BIT( 3 )
  MouseOverBmp = BIT( 4 )
  MouseOverText = BIT( 5 )
  MouseOverIcon = BIT( 6 )
  InspectorData = BIT( 7 )
  VirtualParent = BIT( 8 )
  RebuildVisited = BIT( 9 )
  ShowObjectId = BIT( 10 )
  ShowClassName = BIT( 11 )
  ShowObjectName = BIT( 12 )
  ShowInternalName = BIT( 13 )
  ShowClassNameForUnnamed = BIT( 14 )
  ForceItemName = BIT(15)
  ForceDragTarget = BIT(16)
  DenyDrag = BIT(17)
}

Public Functions

Item(GuiTreeViewCtrl * parent, GuiControlProfile * pProfile)

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

sort(bool caseSensitive, bool traverseHierarchy, bool parentsFirst)

Sort the childs of the item by their text.

Detailed Description

Introduction

Get Methods

getNormalImage()

getExpandedImage()

getText()

getValue()

getID()

getObject()

getDisplayTextLength()

getDisplayTextWidth(GFont * font)

getDisplayText(U32 bufLen, char * buf)

hasObjectBasedTooltip()

getTooltipText(U32 bufLen, char * buf)

Set Methods

setExpanded(const bool f)

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

setExpandedImage(const S8 id)

Set the image to display when an item IS expanded.

setNormalImage(const S8 id)

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

setObject(SimObject * obj)

Assign a SimObject pointer to an inspector data item.

setText(StringTableEntry txt)

Set the items displayable text (caption)

setValue(StringTableEntry val)

Set the items script value (data)

setVirtualParent(bool value)

Set the items virtual parent flag.

setFiltered(bool value)

Set whether the item is filtered out or not.

State Retrieval

isExpanded()

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.

isFiltered()

Return whether the item is current filtered out or not.

note:

Parent items may be filtered and yet still be visible if they have children that are not filtered.

isInspectorData()

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

isDragTargetAllowed()

Returns true if we've been manually set to allow dragging overrides.

As it's a manually set flag, by default it is false.

isDragAllowed()

Returns true if we've been manually set to allow dragging overrides.

As it's a manually set flag, by default it is false.

isParent()

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

showInternalNameOnly()

Return true if text label for inspector item should include internal name only.

showObjectNameOnly()

Return true if text label for inspector item should include object name only.

Searching Methods

findChildByName(const char * name)

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

findChildByValue(const SimObject * obj)

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

findChildByValue(StringTableEntry Value)

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

Public Types

ItemState

Enumerator

Selected = BIT( 0 )
Expanded = BIT( 1 )
Marked = BIT( 2 )

Marked items are drawn with a border around them.

This is

Filtered = BIT( 3 )

different than "Selected" because it can only be set by script.

Whether the item is currently filtered out.

MouseOverBmp = BIT( 4 )
MouseOverText = BIT( 5 )
MouseOverIcon = BIT( 6 )
InspectorData = BIT( 7 )

Set if we're representing some inspector.

VirtualParent = BIT( 8 )

info (ie, use mInspectorInfo, not mScriptInfo)

This indicates that we should be rendered as

RebuildVisited = BIT( 9 )

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). Rebuild traversal for virtual parents has visited and validated this item.

ShowObjectId = BIT( 10 )
ShowClassName = BIT( 11 )
ShowObjectName = BIT( 12 )
ShowInternalName = BIT( 13 )
ShowClassNameForUnnamed = BIT( 14 )
ForceItemName = BIT(15)
ForceDragTarget = BIT(16)
DenyDrag = BIT(17)

Public Attributes

Item * mChild 
S32 mDataRenderWidth 
S32 mIcon 
S16 mId 
struct GuiTreeViewCtrl::Item::InspectorTag mInspectorInfo 
Item * mNext 
Item * mParent 
GuiTreeViewCtrl * mParentControl 
Item * mPrevious 
SimObjectPtr< GuiControlProfile > mProfile 
struct GuiTreeViewCtrl::Item::ScriptTag mScriptInfo 
BitSet32 mState 
U16 mTabLevel 
String mTooltip 

Public Functions

Item(GuiTreeViewCtrl * parent, GuiControlProfile * pProfile)

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

~Item()

sort(bool caseSensitive, bool traverseHierarchy, bool parentsFirst)

Sort the childs of the item by their text.

Parameters:

caseSensitive

If true, sorting is case-sensitive.

traverseHierarchy

If true, also triggers a sort() on all child items.

parentsFirst

If true, parents are grouped before children in the resulting sort.