back to gui 

wxTreeItem

generated from ../src/mod_gui/control/treeitem.cpp

wxTreeItem is not available in wxWidgets. It's main purpose is to concentrate item specific properties and methods in this class which will make it easier to work with tree items. See wxTreeCtrl, wxTreeItemId and getItem

Constants

Properties

Name Type Description
allChildrenCount read only Integer Gets the number of child items. It returns the total number of descendants.
backgroundColour wxColour Get/Set the background colour of the item.
bold Boolean Get/Set the item text in bold.
childrenCount read only Integer Gets the number of child items. Only the children of one level is returned.
data Any Get/Set the associated data of the item.
expanded Boolean Returns true when the item is expanded. When set to true the items is expanded, collapsed when set to false.
font wxFont Get/Set the font of the item.
hasChildren Boolean Returns true when the item has children. When set to true you can force the appearance of the button next to the item. This is useful to allow the user to expand the items which don't have any children now, but instead adding them only when needed, thus minimizing memory usage and loading time.
lastChild read only wxTreeItem Get the last child item. Returns null when the item has no childs.
nextSibling read only wxTreeItem Get the next sibling item. Returns null when there are no items left.
parent read only wxTreeItem Get the parent item. Returns null when this item is the root item.
prevSibling read only wxTreeItem Get the previous sibling item. Returns null when there are no items left.
selected Boolean Returns true when the item is selected. When set to true the items is selected, unselected when set to false.
text String Get/Set the item text.
textColour wxColour Get/Set the colour of the text.
visible Boolean Get/Set the visibility of the item. Setting visible to false doesn't do anything.

Methods

getFirstChild

getFirstChild(Cookie) : wxTreeItem
 
Name Type Default Description
Cookie Integer For this enumeration function you must pass in a 'cookie' parameter which is opaque for the application but is necessary for the library to make these functions reentrant (i.e. allow more than one enumeration on one and the same object simultaneously). The cookie passed to getFirstChild and getNextChild should be the same variable.

Returns the first child item. An invalid item is returned when there is no child item. See wxTreeCtrl getFirstChild method

getImage

getImage(Which) : Integer
 
Name Type Default Description
Which Integer A wxTreeItemIcon constant.

Gets the specified item image. See wxTreeCtrl getItemImage method

getNextChild

getNextChild(Cookie) : wxTreeItem
 
Name Type Default Description
Cookie Integer For this enumeration function you must pass in a 'cookie' parameter which is opaque for the application but is necessary for the library to make these functions reentrant (i.e. allow more than one enumeration on one and the same object simultaneously). The cookie passed to wxTreeItem getFirstChild and getNextChild should be the same variable.

Returns the first child item. An invalid item is returned when there is no child item. See wxTreeCtrl getNextChild method

setImage

setImage(Image, 
         Which)
 
Name Type Default Description
Image Integer Index of the image in the image list
Which Integer A wxTreeItemIcon constant.

Sets the specified item image. See wxTreeCtrl setItemImage method




Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.