AGW Logo

agw_title TreeCtrlHandler

Supports saving/restoring a wx.TreeCtrl expansion state, selections and checked items state (meaningful only for CustomTreeCtrl).

This class handles the following wxPython widgets:

hierarchy Inheritance Diagram

Inheritance diagram for: TreeCtrlHandler

Inheritance diagram of TreeCtrlHandler


method_summary Methods Summary

__init__
GetCheckedStateReturns a list of checked items.
GetCheckedStateOfChildrenReturns the checked/unchecked state of the children of a tree item.
GetCheckedStateOfItemReturns the checked/unchecked state of a tree item.
GetExpansionStateReturns list of expanded items.
GetExpansionStateOfChildrenReturns the expansion state of the children of a tree item.
GetExpansionStateOfItemReturns the expansion state of a tree item.
GetIndexOfItemReturn the index of item.
GetItemChildrenReturn the children of item as a list.
GetItemIdentityReturn a hashable object that represents the identity of the item.
GetKind
GetSelectionStateReturns a list of selected items.
GetSelectionStateOfChildrenReturns the selection state of the children of a tree item.
GetSelectionStateOfItemReturns the selection state of a tree item.
Restore
Save
SetCheckedStateChecks all tree items whose identity, as determined by TreeCtrlHandler.GetItemIdentity(), is present
SetCheckedStateOfChildrenSets the checked/unchecked state of the children of a tree item.
SetCheckedStateOfItemSets the checked/unchecked state of a tree item.
SetExpansionStateExpands all tree items whose identity, as determined by TreeCtrlHandler.GetItemIdentity(),
SetExpansionStateOfChildrenSets the expansion state of the children of a tree item (expanded or collapsed).
SetExpansionStateOfItemSets the expansion state of a tree item (expanded or collapsed).
SetSelectedStateOfChildrenSets the selection state of the children of a tree item.
SetSelectedStateOfItemSets the selection state of a tree item.
SetSelectionStateSelects all tree items whose identity, as determined by TreeCtrlHandler.GetItemIdentity(),

API Class API

class TreeCtrlHandler(AbstractHandler)[source]

Supports saving/restoring a wx.TreeCtrl expansion state, selections and checked items state (meaningful only for CustomTreeCtrl).

This class handles the following wxPython widgets:



__init__(pObject)[source]


GetCheckedState()[source]

Returns a list of checked items. Checked items are coded as determined by the result of TreeCtrlHandler.GetItemIdentity().

Note

This is meaningful only for CustomTreeCtrl and HyperTreeList.



GetCheckedStateOfChildren(item)[source]

Returns the checked/unchecked state of the children of a tree item.

Parameters:item – a CustomTreeCtrl item.


GetCheckedStateOfItem(item)[source]

Returns the checked/unchecked state of a tree item.

Parameters:item – a CustomTreeCtrl item.


GetExpansionState()[source]

Returns list of expanded items. Expanded items are coded as determined by the result of TreeCtrlHandler.GetItemIdentity().



GetExpansionStateOfChildren(item)[source]

Returns the expansion state of the children of a tree item.

Parameters:item – a wx.TreeCtrl item or a CustomTreeCtrl item.



GetExpansionStateOfItem(item)[source]

Returns the expansion state of a tree item.

Parameters:item – a wx.TreeCtrl item or a CustomTreeCtrl item.



GetIndexOfItem(item)[source]

Return the index of item.

Parameters:item – a wx.TreeCtrl item or a CustomTreeCtrl item;



GetItemChildren(item=None, recursively=False)[source]

Return the children of item as a list.

Parameters:


GetItemIdentity(item)[source]

Return a hashable object that represents the identity of the item. By default this returns the position of the item in the tree. You may want to override this to return the item label (if you know that labels are unique and don’t change), or return something that represents the underlying domain object, e.g. a database key.

Parameters:item – a wx.TreeCtrl item or a CustomTreeCtrl item;



GetSelectionState()[source]

Returns a list of selected items. Selected items are coded as determined by the result of TreeCtrlHandler.GetItemIdentity().



GetSelectionStateOfChildren(item)[source]

Returns the selection state of the children of a tree item.

Parameters:item – a wx.TreeCtrl item or a CustomTreeCtrl item.



GetSelectionStateOfItem(item)[source]

Returns the selection state of a tree item.

Parameters:item – a wx.TreeCtrl item or a CustomTreeCtrl item.



SetCheckedState(listOfCheckedItems)[source]

Checks all tree items whose identity, as determined by TreeCtrlHandler.GetItemIdentity(), is present in the list and unchecks all other tree items.

Parameters:listOfCheckedItems – a list of checked CustomTreeCtrl items.

Note

This is meaningful only for CustomTreeCtrl and HyperTreeList.



SetCheckedStateOfChildren(listOfCheckedItems, item)[source]

Sets the checked/unchecked state of the children of a tree item.

Parameters:


SetCheckedStateOfItem(listOfCheckedItems, item)[source]

Sets the checked/unchecked state of a tree item.

Parameters:


SetExpansionState(listOfExpandedItems)[source]

Expands all tree items whose identity, as determined by TreeCtrlHandler.GetItemIdentity(), is present in the list and collapses all other tree items.

Parameters:listOfExpandedItems – a list of expanded wx.TreeCtrl or CustomTreeCtrl items.



SetExpansionStateOfChildren(listOfExpandedItems, item)[source]

Sets the expansion state of the children of a tree item (expanded or collapsed).

Parameters:


SetExpansionStateOfItem(listOfExpandedItems, item)[source]

Sets the expansion state of a tree item (expanded or collapsed).

Parameters:


SetSelectedStateOfChildren(listOfSelectedItems, item)[source]

Sets the selection state of the children of a tree item.

Parameters:


SetSelectedStateOfItem(listOfSelectedItems, item)[source]

Sets the selection state of a tree item.

Parameters:


SetSelectionState(listOfSelectedItems)[source]

Selects all tree items whose identity, as determined by TreeCtrlHandler.GetItemIdentity(), is present in the list and unselects all other tree items.

Parameters:listOfSelectedItems – a list of selected wx.TreeCtrl or CustomTreeCtrl items.

Tree

Table Of Contents

Previous topic

ToolBarHandler

Next topic

TreeListCtrlHandler