PyCTreeCtrl Object

A class which encapsulates an MFC CTreeCtrl object. Derived from a PyCWnd object.

Methods

CreateWindow
Creates the actual window for the object. 

GetCount
Retrieves the number of tree items associated with a tree view control. 

GetIndent
Retrieves the offset (in pixels) of a tree view item from its parent. 

SetIndent
Sets the offset (in pixels) of a tree view item from its parent. 

GetImageList
Retrieves the current image list. 

SetImageList
Assigns an image list to a list view control. 

GetNextItem
Retrieves the next item. 

ItemHasChildren
Returns nonzero if the specified item has child items. 

GetChildItem
Retrieves the child item of the specified tree view item. 

GetNextSiblingItem
Retrieves the next sibling of the specified tree view item. 

GetPrevSiblingItem
Retrieves the previous sibling of the specified tree view item. 

GetParentItem
Retrieves the parent item of the specified tree view item. 

GetFirstVisibleItem
Retrieves the first visible item of the specified tree view item. 

GetNextVisibleItem
Retrieves the next visible item of the specified tree view item. 

GetNextVisibleItem
Retrieves the previous visible item of the specified tree view item. 

GetSelectedItem
Retrieves the currently selected tree view item. 

GetDropHilightItem
Retrieves the target of a drag-and-drop operation. 

GetRootItem
Retrieves the root of the specified tree view item. 

GetToolTips
Returns the tooltip control 

GetItem
Retrieves the details of an items attributes. 

SetItem
Sets some of all of an items attributes. 

GetItemState
Retrieves the state of an item. 

SetItemState
Sets the state of an item. 

GetItemImage
Retrieves the index of an items images. 

SetItemImage
Sets the index of an items images. 

SetItemText
Changes the text of a list view item or subitem. 

GetItemText
Retrieves the text of a list view item or subitem. 

GetItemData
Retrieves the application-specific value associated with an item. 

SetItemData
Sets the item's application-specific value 

GetItemRect
Retrieves the bounding rectangle of a tree view item. 

GetEditControl
Retrieves the handle of the edit control used to edit the specified tree view item. 

GetVisibleCount
Retrieves the number of visible tree items associated with a tree view control. 

InsertItem
Inserts an item into the list. 

DeleteItem
Deletes an item from the list. 

DeleteAllItems
Deletes all items from the list. 

Expand
Expands, or collapses, the child items of the specified tree view item. 

Select
Selects, scrolls into view, or redraws a specified tree view item. 

SelectItem
Selects a specified tree view item. 

SelectDropTarget
Redraws the tree item as the target of a drag-and-drop operation. 

SelectSetFirstVisible
Selects a specified tree view item as the first visible item. 

EditLabel
Edits a specified tree view item in-place. 

CreateDragImage
Creates a dragging bitmap for the specified tree view item. 

SortChildren
Sorts the children of a given parent item. 

EnsureVisible
Ensures that a tree view item is visible in its tree view control. 

HitTest
Determines which tree view item, if any, is at a specified position. 

Comments

Sam Rushing has found the following tidbits:
You can implement dynamic collapsing and expanding of events for large collections yourself - see KB Q130697
The MFC docs tell you to use TVE_COLLAPSERESET in order to throw away the child items when collapsing a node. They neglect to tell you a very important tidbit: that you need to combine the flag with TVE_COLLAPSE. This is pointed out in the docs for TreeView_Expand(), but not in those for CTreeCtrl::Expand.