wxTreeCtrl

wxTreeCtrl
Creation Parameters

When working with tree items, the id values returned are actually pointers to wxTreeItem pointers. They are not unique ids. The value returned is a new wxTreeItemId, which is a simple wxWidgets object. It is just a pointer to either a windows handle or a custom data pointer. It is the duty of the application to free the wxTreeItemId.

Functions/Procedures
Supertopics
Subtopics

wxTreeCtrl

[func]
add_tree_item
( atom tree, atom parent, sequence text, atom image, atom selimage )

Category: wxTreeCtrl

You must declare tree_imagelist before you can assign any images to image and selimage. If you do not have one declared, use -1 for Image and SelImage

wxTreeCtrl

[func]
add_tree_root
( atom tree, sequence text, atom image, atom selimage )

Category: wxTreeCtrl

You must declare tree_imagelist before you can assign any images to image and selimage. If you do not have a tree_imagelist declared, use -1 for image and selimage.

If you declare tree_imagelist, -1 will become it's first image and all items will have an image beside them.


wxTreeCtrl

[proc]
collapse_all_tree_children
( atom tree, atom item )

Category: wxTreeCtrl

Collapses this item and all of its children, recursively.


wxTreeCtrl

[proc]
collapse_all_tree_items
( atom tree )

Category: wxTreeCtrl

Collapses the root item.


wxTreeCtrl

[proc]
collapse_and_reset_tree_item
( atom tree, atom item )

Category: wxTreeCtrl

Collapses the given item and removes all children.


wxTreeCtrl

[proc]
collapse_tree_item
( atom tree, atom item )

Category: wxTreeCtrl

Collapses the given item.


wxTreeCtrl

[proc]
delete_tree_children
( atom tree, atom treeitem )

Category: wxTreeCtrl

This goes to a TreeCtrl specified by tree and deletes all children under the specifed item.


wxTreeCtrl

[proc]
delete_tree_item
( atom tree, object item )

Category: wxTreeCtrl

Deletes one or all items from a wxTreeCtrl.
If item is an empty sequence, then all items are deleted, otherwise, item can be either an integer or a sequence of item ids to be deleted.


wxTreeCtrl

[proc]
edit_tree_item
( atom tree, atom item )

Category: wxTreeCtrl

Starts editing the label of the given item. This function generates a EVT_TREE_BEGIN_LABEL_EDIT event which can be vetoed so that no text control will appear for in-place editing.

If the user changed the label (i.e. s/he does not press ESC or leave the text control without changes, a EVT_TREE_END_LABEL_EDIT event will be sent which can be vetoed as well.


wxTreeCtrl

[proc]
ensure_tree_item_visual
( atom tree, atom item )

Category: wxTreeCtrl

Scrolls and/or expands items to ensure that the given item is visible.


wxTreeCtrl

[proc]
expand_all_tree_children
( atom tree, atom item )

Category: wxTreeCtrl

Expands the given item and all its children recursively.


wxTreeCtrl

[proc]
expand_tree
( atom tree )

Category: wxTreeCtrl

Expands all items in the tree.


wxTreeCtrl

[proc]
expand_tree_item
( atom tree, atom item )

Category: wxTreeCtrl


wxTreeCtrl

[func]
get_first_tree_child
( atom tree, atom item )

Category: wxTreeCtrl

Returns the first child; call get_next_tree_child for the next child.

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 get_first_tree_child and get_next_tree_child should be the same variable.

Returns an invalid tree item (i.e. IsOk() returns false) if there are no further children.


wxTreeCtrl

[func]
get_first_visible_tree_item
( atom tree )

Category: wxTreeCtrl

Returns the first visible item.


wxTreeCtrl

[func]
get_next_tree_child
( atom tree, atom item, atom cookie )

Category: wxTreeCtrl

Returns the next child; call get_first_tree_child for the first child.

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 get_first_tree_child and get_next_tree_child should be the same variable.

Returns an invalid tree item if there are no further children.


wxTreeCtrl

[func]
get_next_tree_sibling
( atom tree, atom item )

Category: wxTreeCtrl

Returns the next sibling of the specified item; call get_prev_tree_sibling for the previous sibling.

Returns an invalid tree item if there are no further siblings.


wxTreeCtrl

[func]
get_next_visible_tree_item
( atom tree, atom item )

Category: wxTreeCtrl

Returns the next visible item.


wxTreeCtrl

[func]
get_prev_tree_sibling
( atom tree, atom item )

Category: wxTreeCtrl

Returns the previous sibling of the specified item; call get_next_tree_sibling for the next sibling.

Returns an invalid tree item if there are no further children.


wxTreeCtrl

[func]
get_prev_visible_tree_item
( atom tree, atom item )

Category: wxTreeCtrl

Returns the previous visible item.


wxTreeCtrl

[func]
get_tree_edit_control
( atom tree )

Category: wxTreeCtrl

Returns the edit control being currently used to edit a label. Returns NULL if no label is being edited.

Note: this is currently only implemented for wxMSW.


wxTreeCtrl

[func]
get_tree_imagelist
( atom tree )

Category: wxTreeCtrl

Returns the normal image list.


wxTreeCtrl

[func]
get_tree_indent
( atom tree )

Category: wxTreeCtrl

Returns the current tree control indentation.


wxTreeCtrl

[func]
get_tree_item_background_color
( atom tree, atom item )

Category: wxTreeCtrl

Returns the background colour of the item.


wxTreeCtrl

[func]
get_tree_item_bounding_rect
( atom tree, atom item, atom text_only )

Category: wxTreeCtrl

Retrieves the rectangle bounding the item. If text_only is true, only the rectangle around the item's label will be returned, otherwise the item's image is also taken into account.

The return value a sequence of { ok, rect }. ok is true if the rectangle was successfully retrieved or false if it was not (in this case rect is not changed) for example, if the item is currently invisible (in which case rect will be all zeros).

Notice that the rectangle coordinates are logical, not physical ones. So, for example, the x coordinate may be negative if the tree has a horizontal scrollbar and its position is not 0.


wxTreeCtrl

[func]
get_tree_item_children_count
( atom tree, atom item, atom recursively )

Category: wxTreeCtrl

Returns the number of items in the branch. If recursively is true, returns the total number of descendants, otherwise only one level of children is counted.


wxTreeCtrl

[func]
get_tree_item_count
( atom tree )

Category: wxTreeCtrl

Returns the number of items in the control.


wxTreeCtrl

[func]
get_tree_item_font
( atom tree, atom item )

Category: wxTreeCtrl

Returns the font of the item label.


wxTreeCtrl

[func]
get_tree_item_image
( atom tree, atom item, atom which )

Category: wxTreeCtrl

Gets the specified item image. The value of which may be:


wxTreeCtrl

[func]
get_tree_item_text_color
( atom tree, atom item )

Category: wxTreeCtrl

Returns the colour of the item label.


wxTreeCtrl

[func]
get_tree_parent
( atom tree, atom item )

Category: wxTreeCtrl

This returns an integer which serves as a stand_in for the item's actual parent. You can set things to the pointer as if it were the actual wxTreeCtrl item.


wxTreeCtrl

[func]
get_tree_root
( atom tree )

Category: wxTreeCtrl

This returns an integer which serves as a stand_in for the actual tree root. You can set things to the pointer as if it were the actual wxTreeCtrl item.


wxTreeCtrl

[func]
get_tree_selected_text
( atom tree )

Category: wxTreeCtrl

This gets the text of whatever item is currently highlighted in the chosen wxTreeCtrl.


wxTreeCtrl

[func]
get_tree_selection
( atom tree )

Category: wxTreeCtrl

This returns an integer which serves as a stand_in for the actual item. You can set things to the pointer as if it were the actual wxTreeCtrl item.


wxTreeCtrl

[func]
get_tree_selections
( atom tree )

Category: wxTreeCtrl

Returns a sequence containing the currently selected items. This function can be called only if the control has the wxTR_MULTIPLE style.


wxTreeCtrl

[func]
get_tree_text
( atom tree, atom id )

Category: wxTreeCtrl

This goes to the specified tree and grabs the value of the item, specified by it's ID.


wxTreeCtrl

[func]
insert_tree_item_after
( atom tree, atom parent, atom previous, sequence text, atom image, atom sel_image )

Category: wxTreeCtrl

Inserts an item after a given one ( previous ).

The image and sel_image parameters are an index within the normal image list specifying the image to use for unselected and selected items, respectively. If image > -1 and selimage is -1, the same image is used for both selected and unselected items.


wxTreeCtrl

[func]
insert_tree_item_before
( atom tree, atom parent, atom before, sequence text, atom image, atom sel_image )

Category: wxTreeCtrl

Inserts an item after a given one ( before ).

The image and sel_image parameters are an index within the normal image list specifying the image to use for unselected and selected items, respectively. If image > -1 and selimage is -1, the same image is used for both selected and unselected items.


wxTreeCtrl

[func]
is_tree_empty
( atom tree )

Category: wxTreeCtrl

Returns true if the control is empty (i.e. has no items, even no root one).


wxTreeCtrl

[func]
is_tree_item_bold
( atom tree, atom item )

Category: wxTreeCtrl

Returns true if the given item is in bold state.


wxTreeCtrl

[func]
is_tree_item_expanded
( atom tree, atom item )

Category: wxTreeCtrl

Returns true if the item is expanded (only makes sense if it has children).


wxTreeCtrl

[func]
is_tree_item_selected
( atom tree, atom item )

Category: wxTreeCtrl

Returns true if the item is selected.


wxTreeCtrl

[func]
is_tree_item_visible
( atom tree, atom item )

Category: wxTreeCtrl

Returns true if the item is visible (it might be outside the view, or not expanded).


wxTreeCtrl

[func]
prepend_tree_item
( atom tree, atom parent, sequence text, atom image, atom sel_image )

Category: wxTreeCtrl

Appends an item as the first child of parent, return a new item id.

The image and sel_image parameters are an index within the normal image list specifying the image to use for unselected and selected items, respectively. If image > -1 and selimage is -1, the same image is used for both selected and unselected items.


wxTreeCtrl

[proc]
scroll_to_tree_item
( atom tree, atom item )

Category: wxTreeCtrl

Scrolls the specified item into view.


wxTreeCtrl

[proc]
select_tree_item
( atom tree, atom treeitem )

Category: wxTreeCtrl

Sets the highlight to the specified tree item by using it's actual id or an integer pointer that goes to it.


wxTreeCtrl

[proc]
set_tree_indent
( atom tree, atom indent )

Category: wxTreeCtrl

Sets the indentation for the tree control.


wxTreeCtrl

[proc]
set_tree_item_background
( atom tree, atom item, atom color )

Category: wxTreeCtrl

Sets the colour of the item's background.


wxTreeCtrl

[proc]
set_tree_item_bold
( atom tree, atom item, atom bold )

Category: wxTreeCtrl

Makes item appear in bold font if bold parameter is true or resets it to the normal state.


wxTreeCtrl

[proc]
set_tree_item_drop_highlight
( atom tree, atom item, atom highlight )

Category: wxTreeCtrl

Gives the item the visual feedback for Drag'n'Drop actions, which is useful if something is dragged from the outside onto the tree control (as opposed to a DnD operation within the tree control, which already is implemented internally).


wxTreeCtrl

[proc]
set_tree_item_font
( atom tree, atom item, atom font )

Category: wxTreeCtrl

Sets the item's font. All items in the tree should have the same height to avoid text clipping, so the fonts height should be the same for all of them, although font attributes may vary.


wxTreeCtrl

[proc]
set_tree_item_has_children
( atom tree, atom item, atom has_children )

Category: wxTreeCtrl

Force 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.


wxTreeCtrl

[proc]
set_tree_item_image
( atom tree, atom item, atom image, atom which )

Category: wxTreeCtrl

Sets the specified item image. See get_tree_item_image for the description of the which parameter.


wxTreeCtrl

[proc]
set_tree_item_text
( atom tree, atom item, sequence text )

Category: wxTreeCtrl

Goes to the specified item inside of the specified wxTreeCtrl and sets the text in it to text.


wxTreeCtrl

[proc]
set_tree_item_text_color
( atom tree, atom item, atom color )

Category: wxTreeCtrl

Sets the colour of the item's text.


wxTreeCtrl

[proc]
sort_tree_children
( atom tree, atom item )

Category: wxTreeCtrl

Sorts the children of the given item.


wxTreeCtrl

[proc]
toggle_tree_item
( atom tree, atom item )

Category: wxTreeCtrl

Toggles the given item between collapsed and expanded states.


wxTreeCtrl

[proc]
toggle_tree_item_selection
( atom tree, atom item )

Category: wxTreeCtrl

Toggles the given item between selected and unselected states. For multiselection controls only.


wxTreeCtrl

[func]
tree_hit_test
( atom tree, atom x, atom y, atom flags )

Category: wxTreeCtrl

Calculates which (if any) item is under the given point, returning the tree item id at this point plus extra information flags.

flags is a bitlist of the following:


wxTreeCtrl

[proc]
tree_imagelist
( atom tree, atom il )

Category: wxTreeCtrl

This sets the wxImageList to the wxTreeCtrl, allowing the wxTreeCtrl's children to use it's icons.


wxTreeCtrl

[func]
tree_item_has_children
( atom tree, atom item )

Category: wxTreeCtrl

Returns true if the item has children.


wxTreeCtrl

[proc]
unselect_tree_item
( atom tree, object items )

Category: wxTreeCtrl

Removes the selection from the currently selected item (if any).


wxTreeCtrl

[func]
valid_tree_item
( atom item )

Category: wxTreeCtrl

Returns true if this instance is referencing a valid tree item.