Torque3D Documentation / _generateds / GuiTreeViewCtrl

GuiTreeViewCtrl

Engine/source/gui/controls/guiTreeViewCtrl.h

More...

Classes:

Enums

enum
TreeState {
  RebuildVisible = BIT(0)
  IsInspector = BIT(1)
  IsEditable = BIT(2)
  ShowTreeLines = BIT(3)
  BuildingVisTree = BIT(4)
}
enum
_Anonymous_ {  MaxIcons = 32
}
enum
Icons {
  Default1 = 0
  SimGroup1 
  SimGroup2 
  SimGroup3 
  SimGroup4 
  Hidden 
  Lock1 
  Lock2 
  Default 
  Icon31 
  Icon32 
}
enum
mDragMidPointFlags {
  NomDragMidPoint 
  AbovemDragMidPoint 
  BelowmDragMidPoint 
}
enum
HitFlags {
  OnIndent = BIT(0)
  OnImage = BIT(1)
  OnIcon = BIT(2)
  OnText = BIT(3)
  OnRow = BIT(4)
}
enum
BmpIndices {
  BmpFirstChild 
  BmpLastChild 
  BmpChild 
  BmpExp 
  BmpExpN 
  BmpExpP 
  BmpExpPN 
  BmpCon 
  BmpConN 
  BmpConP 
  BmpConPN 
  BmpLine 
  BmpGlow 
}

Callbacks

DECLARE_CALLBACK(bool , onDeleteObject , (SimObject *object) )
DECLARE_CALLBACK(void , onDefineIcons , () )
DECLARE_CALLBACK(void , onAddGroupSelected , (SimGroup *group) )
DECLARE_CALLBACK(void , onAddSelection , (S32 itemOrObjectId, bool isLastSelection) )
DECLARE_CALLBACK(void , onSelect , (S32 itemOrObjectId) )
DECLARE_CALLBACK(void , onInspect , (S32 itemOrObjectId) )
DECLARE_CALLBACK(void , onRemoveSelection , (S32 itemOrObjectId) )
DECLARE_CALLBACK(void , onUnselect , (S32 itemOrObjectId) )
DECLARE_CALLBACK(void , onDeleteSelection , () )
DECLARE_CALLBACK(void , onObjectDeleteCompleted , () )
DECLARE_CALLBACK(void , onKeyDown , (S32 modifier, S32 keyCode) )
DECLARE_CALLBACK(void , onMouseUp , (S32 hitItemId, S32 mouseClickCount) )
DECLARE_CALLBACK(void , onRightMouseDown , (S32 itemId, const Point2I &mousePos, SimObject *object=<a href="/coding/file/typesx86unix_8h/#typesx86unix_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>) )
DECLARE_CALLBACK(void , onRightMouseUp , (S32 itemId, const Point2I &mousePos, SimObject *object=<a href="/coding/file/typesx86unix_8h/#typesx86unix_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>) )
DECLARE_CALLBACK(void , onBeginReparenting , () )
DECLARE_CALLBACK(void , onEndReparenting , () )
DECLARE_CALLBACK(void , onReparent , (S32 itemOrObjectId, S32 oldParentItemOrObjectId, S32 newParentItemOrObjectId) )
DECLARE_CALLBACK(void , onDragDropped , () )
DECLARE_CALLBACK(void , onAddMultipleSelectionBegin , () )
DECLARE_CALLBACK(void , onAddMultipleSelectionEnd , () )
DECLARE_CALLBACK(bool , canRenameObject , (SimObject *object) )
DECLARE_CALLBACK(bool , handleRenameObject , (const char *newName, SimObject *object) )

Filtering

Get the current filter expression.

Set the pattern by which to filter items in the tree.

setFilterChildren(bool doFilter)
setItemFilterException(U32 item, bool isExempt)
setItemHidden(U32 item, bool isHidden)

Clear the current item filtering pattern.

reparentItems(Vector< Item * > selectedItems, Item * newParent)

Private Types

Parent 

Public Friends

class

Protected Attributes

bool

If true clicking on a selected item ( that is an object ) will allow you to rename it.

bool

When clicking on an already selected item, clear all other selections.

bool

If true, a trace of actions taken by the control is logged to the console.

bool

If true, all items are filtered. If false, then children of items that successfully pass filter are not filtered.

Current filter that determines which items in the tree are displayed and which are hidden.

A combination of TreeState flags.

Item *

We do our own free list, as we we want to be able to recycle item ids and do some other clever things.

bool

If true then object renaming operates on the internalName rather than the object name.

Used for tracking stuff that was selected, but may not have been created at time of selection.

bool

If true, class names will be used as object names for unnamed objects.

bool

If true, class names will be included in inspector tree item labels.

bool

If true, internal names will be included in inspector tree item labels.

bool

If true, object IDs will be included in inspector tree item labels.

bool

If true, object names will be included in inspector tree item labels.

bool

Used to hide the root tree element, defaults to true.

bool

If true then only render item tooltips if the item extends past the displayable width.

bool

If true then tooltips will be automatically generated for all Inspector items.

Protected Functions

_buildItem(Item * item, U32 tabLevel, bool bForceFullUpdate, bool skipFlter)
_destroyChildren(Item * item, Item * parent, bool deleteObjects)
_destroyItem(Item * item, bool deleteObject)
Item *
_findItemByAmbiguousId(S32 itemOrObjectId, bool buildVirtual)
bool
_hitTest(const Point2I & pnt, Item *& item, BitSet32 & flags)
bool

For inspector tree views, this is hooked to the SetModificationSignal of sets so that the tree view knows when it needs to refresh.

bool
bool
onVirtualParentBuild(Item * item, bool bForceFullUpdate)

Public Functions

addSelection(S32 itemId, bool update, bool isLastSelection)
bool
buildIconTable(const char * icons)
buildVisibleTree(bool bForceFullUpdate)
bool
bool
childSearch(Item * item, SimObject * obj, bool yourBaby)

Returns false if the object is a child of one of the inner items.

DECLARE_CATEGORY("Gui Lists" )
DECLARE_DESCRIPTION("Hierarchical list of text items with optional icons.\nCan also be used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> inspect <a href="/coding/class/classsimobject/">SimObject</a> hierarchies." )
bool
editItem(S32 itemId, const char * newText, const char * newValue)
findItemByName(const char * name)
findItemByValue(const char * name)
getIcon(const char * iconString)
Item *
getItem(S32 itemId)
const char *
getItemText(S32 itemId)
const char *
getItemValue(S32 itemId)
getTextToRoot(S32 itemId, const char * delimiter)
hideSelection(bool hide)
insertItem(S32 parentId, const char * text, const char * value, const char * iconString, S16 normalImage, S16 expandedImage)
insertObject(S32 parentId, SimObject * obj, bool okToEdit)
inspectObject(SimObject * obj, bool okToEdit)
inspectorSearch(Item * item, Item * parent, SimSet * parentSet, SimSet * newParentSet)

Find immediately available inspector items (eg ones that aren't children of other inspector items) and then update their sets.

bool
bool
isSelected(Item * item)
bool
isSelected(S32 itemId)
lockSelection(bool lock)
bool
markItem(S32 itemId, bool mark)
bool
objectSearch(const SimObject * object, Item ** item)

Find the Item associated with a sceneObject, returns true if it found one.

bool

Called when this object is added to the scene.

bool

Happens when a key is depressed.

Do special pre-render processing.

onRender(Point2I offset, const RectI & updateRect)

Called when this control is to render itself.

onRenderCell(Point2I offset, Point2I cell, bool , bool )

Called when this object is asked to sleep.

bool

Called when this object is asked to wake up returns true if it's actually awake at the end.

bool
removeItem(S32 itemId, bool deleteObjects)

Should use addSelection and removeSelection when calling from script instead of setItemSelected.

bool
renderTooltip(const Point2I & hoverPos, const Point2I & cursorPos, const char * tipText)
bool
bool
bool
setDebug(bool value)
bool
setItemExpanded(S32 itemId, bool expand)
bool
setItemSelected(S32 itemId, bool select)

Sets the flag of the item with the matching itemId.

bool
sortTree(bool caseSensitive, bool traverseHierarchy, bool parentsFirst)

Used for syncing the mSelected and mSelectedItems lists.

Public Static Functions

Detailed Description

Enums

TreeState

Enumerator

RebuildVisible = BIT(0)

Temporary flag, we have to rebuild the tree.

IsInspector = BIT(1)

We are mapping a SimObject hierarchy.

IsEditable = BIT(2)

We allow items to be moved around.

ShowTreeLines = BIT(3)

Should we render tree lines or just icons?

BuildingVisTree = BIT(4)

We are currently building the visible tree (prevent recursion)

@100

Enumerator

MaxIcons = 32
Icons

Enumerator

Default1 = 0
SimGroup1
SimGroup2
SimGroup3
SimGroup4
Hidden
Lock1
Lock2
Default
Icon31
Icon32
mDragMidPointFlags

Enumerator

NomDragMidPoint
AbovemDragMidPoint
BelowmDragMidPoint
HitFlags

Enumerator

OnIndent = BIT(0)
OnImage = BIT(1)
OnIcon = BIT(2)
OnText = BIT(3)
OnRow = BIT(4)
BmpIndices

Enumerator

BmpFirstChild
BmpLastChild
BmpChild
BmpExp
BmpExpN
BmpExpP
BmpExpPN
BmpCon
BmpConN
BmpConP
BmpConPN
BmpLine
BmpGlow

Callbacks

DECLARE_CALLBACK(bool , onDeleteObject , (SimObject *object) )

DECLARE_CALLBACK(bool , isValidDragTarget , (S32 id, const char *value) )

DECLARE_CALLBACK(void , onDefineIcons , () )

DECLARE_CALLBACK(void , onAddGroupSelected , (SimGroup *group) )

DECLARE_CALLBACK(void , onAddSelection , (S32 itemOrObjectId, bool isLastSelection) )

DECLARE_CALLBACK(void , onSelect , (S32 itemOrObjectId) )

DECLARE_CALLBACK(void , onInspect , (S32 itemOrObjectId) )

DECLARE_CALLBACK(void , onRemoveSelection , (S32 itemOrObjectId) )

DECLARE_CALLBACK(void , onUnselect , (S32 itemOrObjectId) )

DECLARE_CALLBACK(void , onDeleteSelection , () )

DECLARE_CALLBACK(void , onObjectDeleteCompleted , () )

DECLARE_CALLBACK(void , onKeyDown , (S32 modifier, S32 keyCode) )

DECLARE_CALLBACK(void , onMouseUp , (S32 hitItemId, S32 mouseClickCount) )

DECLARE_CALLBACK(void , onMouseDragged , () )

DECLARE_CALLBACK(void , onRightMouseDown , (S32 itemId, const Point2I &mousePos, SimObject *object=<a href="/coding/file/typesx86unix_8h/#typesx86unix_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>) )

DECLARE_CALLBACK(void , onRightMouseUp , (S32 itemId, const Point2I &mousePos, SimObject *object=<a href="/coding/file/typesx86unix_8h/#typesx86unix_8h_1a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>) )

DECLARE_CALLBACK(void , onBeginReparenting , () )

DECLARE_CALLBACK(void , onEndReparenting , () )

DECLARE_CALLBACK(void , onReparent , (S32 itemOrObjectId, S32 oldParentItemOrObjectId, S32 newParentItemOrObjectId) )

DECLARE_CALLBACK(void , onDragDropped , () )

DECLARE_CALLBACK(void , onAddMultipleSelectionBegin , () )

DECLARE_CALLBACK(void , onAddMultipleSelectionEnd , () )

DECLARE_CALLBACK(bool , canRenameObject , (SimObject *object) )

DECLARE_CALLBACK(bool , handleRenameObject , (const char *newName, SimObject *object) )

DECLARE_CALLBACK(void , onClearSelection , () )

Filtering

getFilterText()

Get the current filter expression.

Only tree items whose text matches this expression are displayed. By default, the expression is empty and all items are shown.

setFilterText(const String & text)

Set the pattern by which to filter items in the tree.

Only items in the tree whose text matches this pattern are displayed.

setFilterChildren(bool doFilter)

setItemFilterException(U32 item, bool isExempt)

setItemHidden(U32 item, bool isHidden)

clearHiddenItems()

clearFilterText()

Clear the current item filtering pattern.

reparentItems(Vector< Item * > selectedItems, Item * newParent)

getTabLevel(S32 itemId)

Private Types

typedef GuiArrayCtrl Parent 

Public Friends

Protected Attributes

ColorI mAltFontColor 
ColorI mAltFontColorHL 
ColorI mAltFontColorSE 
StringTableEntry mBitmapBase 
bool mCanRenameObjects 

If true clicking on a selected item ( that is an object ) will allow you to rename it.

bool mClearAllOnSingleSelection 

When clicking on an already selected item, clear all other selections.

bool mCompareToObjectID 
S32 mCurrentDragCell 
bool mDebug 

If true, a trace of actions taken by the control is logged to the console.

Can be turned on with the setDebug() script method.

bool mDeleteObjectAllowed 
bool mDestroyOnSleep 
bool mDoFilterChildren 

If true, all items are filtered. If false, then children of items that successfully pass filter are not filtered.

S32 mDraggedToItem 
S32 mDragMidPoint 
bool mDragStartInSelection 
bool mDragToItemAllowed 
String mFilterText 

Current filter that determines which items in the tree are displayed and which are hidden.

BitSet32 mFlags 

A combination of TreeState flags.

bool mFullRowSelect 
Vector< U32 > mHiddenItemsList 
GFXTexHandle mIconTable [MaxIcons]
S32 mItemCount 
Vector< U32 > mItemFilterExceptionList 
Item * mItemFreeList 

We do our own free list, as we we want to be able to recycle item ids and do some other clever things.

S32 mItemHeight 
Vector< Item * > mItems 
S32 mMaxWidth 
Point2I mMouseDownPoint 
bool mMouseDragged 
bool mMultipleSelections 
Item * mPossibleRenameItem 
S32 mPreviousDragCell 
GuiTextEditCtrl * mRenameCtrl 
bool mRenameInternal 

If true then object renaming operates on the internalName rather than the object name.

Item * mRenamingItem 
Item * mRoot 
SimObjectPtr< SimObject > mRootObject 
Vector< S32 > mSelected 

Used for tracking stuff that was selected, but may not have been created at time of selection.

S32 mSelectedItem 
Vector< Item * > mSelectedItems 
bool mShowClassNameForUnnamedObjects 

If true, class names will be used as object names for unnamed objects.

bool mShowClassNames 

If true, class names will be included in inspector tree item labels.

bool mShowInternalNames 

If true, internal names will be included in inspector tree item labels.

bool mShowObjectIds 

If true, object IDs will be included in inspector tree item labels.

bool mShowObjectNames 

If true, object names will be included in inspector tree item labels.

bool mShowRoot 

Used to hide the root tree element, defaults to true.

S32 mStart 
bool mSupportMouseDragging 
S32 mTabSize 
Item * mTempItem 
GFXTexHandle mTexRollover 
GFXTexHandle mTexSelected 
S32 mTextOffset 
bool mTooltipOnWidthOnly 

If true then only render item tooltips if the item extends past the displayable width.

bool mUseInspectorTooltips 

If true then tooltips will be automatically generated for all Inspector items.

Vector< Item * > mVisibleItems 

Protected Functions

_buildItem(Item * item, U32 tabLevel, bool bForceFullUpdate, bool skipFlter)

_deleteItem(Item * item)

_destroyChildren(Item * item, Item * parent, bool deleteObjects)

_destroyItem(Item * item, bool deleteObject)

_destroyTree()

_expandObjectHierarchy(SimGroup * group)

_findItemByAmbiguousId(S32 itemOrObjectId, bool buildVirtual)

_hitTest(const Point2I & pnt, Item *& item, BitSet32 & flags)

_isRootLevelItem(Item * item)

_onInspectorSetObjectModified(SetModification modification, SimSet * set, SimObject * object)

For inspector tree views, this is hooked to the SetModificationSignal of sets so that the tree view knows when it needs to refresh.

addInspectorDataItem(Item * parent, SimObject * obj)

getInspectorItemIconsWidth(Item *& item)

isValidDragTarget(Item * item)

onClearSelection()

onItemSelected(Item * item)

Reimplemented by: GuiFileTreeCtrl

onRemoveSelection(Item * item)

onVirtualParentBuild(Item * item, bool bForceFullUpdate)

onVirtualParentCollapse(Item * item)

onVirtualParentExpand(Item * item)

Reimplemented by: GuiFileTreeCtrl

Public Functions

GuiTreeViewCtrl()

~GuiTreeViewCtrl()

addSelection(S32 itemId, bool update, bool isLastSelection)

buildIconTable(const char * icons)

buildVisibleTree(bool bForceFullUpdate)

canAddSelection(Item * item)

cancelRename()

childSearch(Item * item, SimObject * obj, bool yourBaby)

Returns false if the object is a child of one of the inner items.

clearSelection()

createItem(S32 icon)

DECLARE_CATEGORY("Gui Lists" )

DECLARE_CONOBJECT(GuiTreeViewCtrl )

DECLARE_DESCRIPTION("Hierarchical list of text items with optional icons.\nCan also be used <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> inspect <a href="/coding/class/classsimobject/">SimObject</a> hierarchies." )

deleteSelection()

editItem(S32 itemId, const char * newText, const char * newValue)

findItemByName(const char * name)

findItemByObjectId(S32 iObjId)

findItemByValue(const char * name)

getChildItem(S32 itemId)

getFirstRootItem()

getIcon(const char * iconString)

getItem(S32 itemId)

getItemAtPosition(Point2I position)

getItemCount()

getItemObject(S32 itemId)

getItems()

getItemText(S32 itemId)

getItemValue(S32 itemId)

getNextSiblingItem(S32 itemId)

getParentItem(S32 itemId)

getPrevSiblingItem(S32 itemId)

getRootItem()

getSelected()

getSelectedItem()

getSelectedItem(S32 index)

getSelectedItems()

getSelectedItemsCount()

getSelectedObjectList()

getTextToRoot(S32 itemId, const char * delimiter)

hideSelection(bool hide)

insertItem(S32 parentId, const char * text, const char * value, const char * iconString, S16 normalImage, S16 expandedImage)

insertObject(S32 parentId, SimObject * obj, bool okToEdit)

inspectObject(SimObject * obj, bool okToEdit)

inspectorSearch(Item * item, Item * parent, SimSet * parentSet, SimSet * newParentSet)

Find immediately available inspector items (eg ones that aren't children of other inspector items) and then update their sets.

isItemSelected(S32 itemId)

isSelected(Item * item)

isSelected(S32 itemId)

lockSelection(bool lock)

markItem(S32 itemId, bool mark)

moveItemDown(S32 itemId)

moveItemUp(S32 itemId)

objectSearch(const SimObject * object, Item ** item)

Find the Item associated with a sceneObject, returns true if it found one.

onAdd()

Reimplemented from: GuiControl

onKeyDown(const GuiEvent & event)

Reimplemented from: GuiControl

onMiddleMouseDown(const GuiEvent & event)

Reimplemented from: GuiControl

onMouseDown(const GuiEvent & event)

Reimplemented from: GuiControl

onMouseDragged(const GuiEvent & event)

Reimplemented from: GuiControl

onMouseEnter(const GuiEvent & event)

Reimplemented from: GuiControl

onMouseLeave(const GuiEvent & event)

Reimplemented from: GuiControl

onMouseMove(const GuiEvent & event)

Reimplemented from: GuiControl

onMouseUp(const GuiEvent & event)

Reimplemented from: GuiControl

onPreRender()

Reimplemented from: GuiControl

onRenameValidate()

onRender(Point2I offset, const RectI & updateRect)

Reimplemented from: GuiControl

onRenderCell(Point2I offset, Point2I cell, bool , bool )

Reimplemented from: GuiArrayCtrl

onRightMouseDown(const GuiEvent & event)

Reimplemented from: GuiControl

onRightMouseUp(const GuiEvent & event)

Reimplemented from: GuiControl

onSleep()

Reimplemented from: GuiControl

onWake()

Reimplemented from: GuiControl

removeAllChildren(S32 itemId)

removeItem(S32 itemId, bool deleteObjects)

removeSelection(S32 itemId)

Should use addSelection and removeSelection when calling from script instead of setItemSelected.

Use setItemSelected when you want to select something in the treeview as it has script call backs.

renderTooltip(const Point2I & hoverPos, const Point2I & cursorPos, const char * tipText)

scrollVisible(Item * item)

scrollVisible(S32 itemId)

scrollVisibleByObjectId(S32 objID)

setAddGroup(SimObject * obj)

setDebug(bool value)

setItemExpanded(S32 itemId, bool expand)

setItemSelected(S32 itemId, bool select)

Sets the flag of the item with the matching itemId.

setItemValue(S32 itemId, StringTableEntry Value)

showItemRenameCtrl(Item * item)

sortTree(bool caseSensitive, bool traverseHierarchy, bool parentsFirst)

syncSelection()

Used for syncing the mSelected and mSelectedItems lists.

toggleHideSelection()

toggleLockSelection()

unlinkItem(Item * item)

Public Static Functions

initPersistFields()