TreeCtrl.TreeCtrl Class Reference

List of all members.

Classes

class   __Node
  The internal data structure used by the tree control. More...

Public Member Functions

  __init__ ()
  GetGraphic ()
  LoadGraphics ()
  AddGraphics ()
  GetLabelFont ()
  SetMaxLabelLength ()
  EnsureVisible ()
  Scrolls the tree window so that a tree node is visible.
  EnsureVisibleIds ()
  Given an iterable of tree item identifiers, ensure that at least one of the corresponding tree items is visible, possibly scrolling the window to make this true.
  Add ()
  index is used to determine the position of the new nodes in the list of children.
  AddChildren ()
  Same as calling Add many times, but only updates the tree once.
  AddPath ()
  This is a convenience function.
  Clear ()
  Removes all items from the tree.
  Collapse ()
  notifyBeforeCollapsing is similar to notifyBeforeExpanding described above.
  Contains ()
  CreateItem ()
  Creates a new node (not yet in the tree).
  DeleteChildren ()
  Obliterates the children and their descendents.
  Delete ()
  Obliterates the node and its descendents.
  Expand ()
  If you want to give people the chance to veto this operation or update the list of children before the item is expanded, set notifyBeforeExpanding to True (the default).
  GetAllItems ()
  GetChildrenById ()
  HasChildren ()
  GetData ()
  GetStyle ()
  GetItem ()
  This method returns a reference to the internal tree node.
  GetParent ()
  Returns an id, or None if id corresponds to the root node.
  GetParentIds ()
  Given a tree id, return the tree ids of the parents.
  GetRoot ()
  GetPath ()
  Given the unique identifier of a node in the tree, return the path to that node as a tuple of the labels of the nodes in the tree from the root to the specified node.
  IsAncestor ()
  GetSelection ()
  If minimal is True, then this function returns all of the selected nodes which do not have selected parents.
  GetRawSelection ()
  GetRawHits ()
  HasSelection ()
  GetLabel ()
  GetLabelStyle ()
  GetTooltip ()
  HasBeenExpanded ()
  IsExpanded ()
  IsLeaf ()
  GetExpandedIds ()
  IsSelected ()
  __iter__ ()
  iterVisibleNodes ()
  Iterate preorder through visible nodes in the tree, returning nodes.
  iterVisibleNodeIds ()
  Iterate preorder through visible nodes in the tree, returning node identifiers.
  visibleNodesCount ()
  Return the number of visible nodes in the tree.
  iterSubtree ()
  Iterates throught the subtree rooted at treeid.
  iterchildren ()
  RemoveChildren ()
  Remove ()
  Select ()
  mode is one of kAdd, kRemove, kReplace.
  SetEmptyFoldersExpandable ()
  AreEmptyFoldersExpandable ()
  SetData ()
  SetFilter ()
  The filter function allows you to determine which nodes will be shown in the tree and which won't.
  SetImages ()
  SetIsLeaf ()
  SetIcon ()
  SetLabelStyle ()
  Style is one of TreeCtrl.kNormal, TreeCtrl.kBold, TreeCtrl.kItalic, TreeCtrl.kLightItalic, or TreeCtrl.kStrikethrough.
  SetColour ()
  SetLabel ()
  SetRootHidden ()
  IsRootHidden ()
  SetTooltip ()
  SetNumLeaves ()
  Use this function to update the number of leaves and selected leaves of a node.
  Size ()
  SortChildren ()
  func is a comparator function.
  __str__ ()
  EnableRebuild ()
  Enable or disable rebuilding the ui.
  requiredWidth ()
  requiredHeight ()
  scrollStep ()
  setShowIcons ()
  showIcons ()
  rebuild ()
  drawItem ()
  drawItemBorder ()
  drawDragCursor ()
  ResetLastSelectedItem ()
  LeftPress ()
  LeftRelease ()
  RightPress ()
  RightRelease ()
  DragAndDrop ()
  DoubleClick ()
  onAcceptRename ()
  onCancelRename ()

Public Attributes

int  kNormal = 0
int  kBold = 1
int  kItalic = 2
int  kLightItalic = 3
int  kStrikethrough = 4
int  kButton = 0
int  kIcon = 1
int  kLabel = 2
int  kAdd = 0
int  kRemove = 1
int  kReplace = 2

Member Function Documentation

TreeCtrl.TreeCtrl.__init__ ( )
TreeCtrl.TreeCtrl.GetGraphic ( )
TreeCtrl.TreeCtrl.LoadGraphics ( )
TreeCtrl.TreeCtrl.AddGraphics ( )
TreeCtrl.TreeCtrl.GetLabelFont ( )
TreeCtrl.TreeCtrl.SetMaxLabelLength ( )
TreeCtrl.TreeCtrl.EnsureVisible ( )

Scrolls the tree window so that a tree node is visible.

TreeCtrl.TreeCtrl.EnsureVisibleIds ( )

Given an iterable of tree item identifiers, ensure that at least one of the corresponding tree items is visible, possibly scrolling the window to make this true.

The parents of the tree items must be expanded.

TreeCtrl.TreeCtrl.Add ( )

index is used to determine the position of the new nodes in the list of children.

If it is -1 as it is by default the item is appended to the list. If parentId is None, then the node is considered the root.

To move a node, Add it somewhere else in the tree.

TreeCtrl.TreeCtrl.AddChildren ( )

Same as calling Add many times, but only updates the tree once.

Useful if you are adding a lot of children.

TreeCtrl.TreeCtrl.AddPath ( )

This is a convenience function.

A similar effect can be achieved by a number of calls to Add. However, this function will not create a new node if the uniqueId is already being used, in this case it will use the existing node which corresponds to this id.

path must be a list of ids.

TreeCtrl.TreeCtrl.Clear ( )

Removes all items from the tree.

TreeCtrl.TreeCtrl.Collapse ( )

notifyBeforeCollapsing is similar to notifyBeforeExpanding described above.

If recursive is True, then each item in the subtree is also collapsed.

TreeCtrl.TreeCtrl.Contains ( )
TreeCtrl.TreeCtrl.CreateItem ( )

Creates a new node (not yet in the tree).

This function returns a key that can be used to access the node. Note, you may provide your own id if you like. If the id is not unique, the old item will be replaced by the new.

TreeCtrl.TreeCtrl.DeleteChildren ( )

Obliterates the children and their descendents.

Use RemoveChildren if this is not what you want

TreeCtrl.TreeCtrl.Delete ( )

Obliterates the node and its descendents.

Use Remove if this is not what you want

TreeCtrl.TreeCtrl.Expand ( )

If you want to give people the chance to veto this operation or update the list of children before the item is expanded, set notifyBeforeExpanding to True (the default).

If this is set to false, the EVT_TREE_ITEM_EXPANDING message will not be sent. In either case an EVT_TREE_ITEM_EXPANDED is sent if the operation succeeds.

If recursive is True, then each item in the subtree is also expanded.

TreeCtrl.TreeCtrl.GetAllItems ( )
TreeCtrl.TreeCtrl.GetChildrenById ( )
TreeCtrl.TreeCtrl.HasChildren ( )
TreeCtrl.TreeCtrl.GetData ( )
TreeCtrl.TreeCtrl.GetStyle ( )
TreeCtrl.TreeCtrl.GetItem ( )

This method returns a reference to the internal tree node.

It can be used in limited circumstances externally, for optimization.

TreeCtrl.TreeCtrl.GetParent ( )

Returns an id, or None if id corresponds to the root node.

TreeCtrl.TreeCtrl.GetParentIds ( )

Given a tree id, return the tree ids of the parents.

TreeCtrl.TreeCtrl.GetRoot ( )
TreeCtrl.TreeCtrl.GetPath ( )

Given the unique identifier of a node in the tree, return the path to that node as a tuple of the labels of the nodes in the tree from the root to the specified node.

An empty tuple is returned if the unique identifier does not correspond to a node in the tree.

TreeCtrl.TreeCtrl.IsAncestor ( )
TreeCtrl.TreeCtrl.GetSelection ( )

If minimal is True, then this function returns all of the selected nodes which do not have selected parents.

If you do want every node, set minimal to false.

TreeCtrl.TreeCtrl.GetRawSelection ( )
TreeCtrl.TreeCtrl.GetRawHits ( )
TreeCtrl.TreeCtrl.HasSelection ( )
TreeCtrl.TreeCtrl.GetLabel ( )
TreeCtrl.TreeCtrl.GetLabelStyle ( )
TreeCtrl.TreeCtrl.GetTooltip ( )
TreeCtrl.TreeCtrl.HasBeenExpanded ( )
TreeCtrl.TreeCtrl.IsExpanded ( )
TreeCtrl.TreeCtrl.IsLeaf ( )
TreeCtrl.TreeCtrl.GetExpandedIds ( )
TreeCtrl.TreeCtrl.IsSelected ( )
TreeCtrl.TreeCtrl.__iter__ ( )
TreeCtrl.TreeCtrl.iterVisibleNodes ( )

Iterate preorder through visible nodes in the tree, returning nodes.

An item is visible if it is not filtered and not a child of an unexpanded parent.

TreeCtrl.TreeCtrl.iterVisibleNodeIds ( )

Iterate preorder through visible nodes in the tree, returning node identifiers.

TreeCtrl.TreeCtrl.visibleNodesCount ( )

Return the number of visible nodes in the tree.

TreeCtrl.TreeCtrl.iterSubtree ( )

Iterates throught the subtree rooted at treeid.

If preorder is False, then it iterates in reverse.

TreeCtrl.TreeCtrl.iterchildren ( )
TreeCtrl.TreeCtrl.RemoveChildren ( )
TreeCtrl.TreeCtrl.Remove ( )
TreeCtrl.TreeCtrl.Select ( )

mode is one of kAdd, kRemove, kReplace.

Set notify to True if you want to get a selection changing event to veto. notify also controls whether or not you get a selection changed event afterwards.

TreeCtrl.TreeCtrl.SetEmptyFoldersExpandable ( )
TreeCtrl.TreeCtrl.AreEmptyFoldersExpandable ( )
TreeCtrl.TreeCtrl.SetData ( )
TreeCtrl.TreeCtrl.SetFilter ( )

The filter function allows you to determine which nodes will be shown in the tree and which won't.

The filter function takes the following parameters: ( treeid, tree ) and returns true or false to indicate that the item should be shown or not shown respectively.

TreeCtrl.TreeCtrl.SetImages ( )
TreeCtrl.TreeCtrl.SetIsLeaf ( )
TreeCtrl.TreeCtrl.SetIcon ( )
TreeCtrl.TreeCtrl.SetLabelStyle ( )

Style is one of TreeCtrl.kNormal, TreeCtrl.kBold, TreeCtrl.kItalic, TreeCtrl.kLightItalic, or TreeCtrl.kStrikethrough.

TreeCtrl.TreeCtrl.SetColour ( )
TreeCtrl.TreeCtrl.SetLabel ( )
TreeCtrl.TreeCtrl.SetRootHidden ( )
TreeCtrl.TreeCtrl.IsRootHidden ( )
TreeCtrl.TreeCtrl.SetTooltip ( )
TreeCtrl.TreeCtrl.SetNumLeaves ( )

Use this function to update the number of leaves and selected leaves of a node.

This function is only necessary if you are using lazy tree expansion. If you are using lazy tree expansion and you get a selection changed event involving an unexpanded folder, you MUST set the number leaves and the number of selected leaves for any unexpanded folder. Otherwise, these folders will always appear unselected.

TreeCtrl.TreeCtrl.Size ( )
TreeCtrl.TreeCtrl.SortChildren ( )

func is a comparator function.

This method sorts alphabetically by default.

TreeCtrl.TreeCtrl.__str__ ( )
TreeCtrl.TreeCtrl.EnableRebuild ( )

Enable or disable rebuilding the ui.

See __Update(). You can disable rebuilding while making a batch of changes in order to speed up updates to the control.

TreeCtrl.TreeCtrl.requiredWidth ( )
TreeCtrl.TreeCtrl.requiredHeight ( )
TreeCtrl.TreeCtrl.scrollStep ( )
TreeCtrl.TreeCtrl.setShowIcons ( )
TreeCtrl.TreeCtrl.showIcons ( )
TreeCtrl.TreeCtrl.rebuild ( )
TreeCtrl.TreeCtrl.drawItem ( )
TreeCtrl.TreeCtrl.drawItemBorder ( )
TreeCtrl.TreeCtrl.drawDragCursor ( )
TreeCtrl.TreeCtrl.ResetLastSelectedItem ( )
TreeCtrl.TreeCtrl.LeftPress ( )
TreeCtrl.TreeCtrl.LeftRelease ( )
TreeCtrl.TreeCtrl.RightPress ( )
TreeCtrl.TreeCtrl.RightRelease ( )
TreeCtrl.TreeCtrl.DragAndDrop ( )
TreeCtrl.TreeCtrl.DoubleClick ( )
TreeCtrl.TreeCtrl.onAcceptRename ( )
TreeCtrl.TreeCtrl.onCancelRename ( )

Member Data Documentation


TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl
TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl TreeCtrl.TreeCtrl