wxTreeCtrl
Creation Parameters
- atom parent
- integer id [= -1]
- integer x [= -1]
- integer y [= -1]
- integer cx [= -1]
- integer cy [= -1]
- integer style [= wxTR_HAS_BUTTONS + wxTR_LINES_AT_ROOT ]
- wxTR_NO_BUTTONS
for convenience
- wxTR_HAS_BUTTONS
generates a +/- button
- wxTR_TWIST_BUTTONS
generates a twister button
- wxTR_NO_LINES
don't generate level connectors
- wxTR_LINES_AT_ROOT
connect top-level nodes
- wxTR_MAC_BUTTONS
backward compatibility
- wxTR_AQUA_BUTTONS
used internally
- wxTR_SINGLE
for convenience
- wxTR_MULTIPLE
can select multiple items
- wxTR_EXTENDED
TODO: allow extended selection
- wxTR_FULL_ROW_HIGHLIGHT
highlight full horizontal space
- wxTR_EDIT_LABELS
can edit item labels
- wxTR_ROW_LINES
put border around items
- wxTR_HIDE_ROOT
don't display root node
- wxTR_HAS_VARIABLE_ROW_HEIGHT
what it says
| | | | | | | | | | | | | | |
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
- func add_tree_item( atom tree, atom parent, sequence text, atom image, atom selimage )
- func add_tree_root( atom tree, sequence text, atom image, atom selimage )
- proc collapse_all_tree_children( atom tree, atom item )
- proc collapse_all_tree_items( atom tree )
- proc collapse_and_reset_tree_item( atom tree, atom item )
- proc collapse_tree_item( atom tree, atom item )
- proc delete_tree_children( atom tree, atom treeitem )
- proc delete_tree_item( atom tree, object item )
- proc edit_tree_item( atom tree, atom item )
- proc ensure_tree_item_visual( atom tree, atom item )
- proc expand_all_tree_children( atom tree, atom item )
- proc expand_tree( atom tree )
- proc expand_tree_item( atom tree, atom item )
- func get_first_tree_child( atom tree, atom item )
- func get_first_visible_tree_item( atom tree )
- func get_next_tree_child( atom tree, atom item, atom cookie )
- func get_next_tree_sibling( atom tree, atom item )
- func get_next_visible_tree_item( atom tree, atom item )
- func get_prev_tree_sibling( atom tree, atom item )
- func get_prev_visible_tree_item( atom tree, atom item )
- func get_tree_edit_control( atom tree )
- func get_tree_imagelist( atom tree )
- func get_tree_indent( atom tree )
- func get_tree_item_background_color( atom tree, atom item )
- func get_tree_item_bounding_rect( atom tree, atom item, atom text_only )
- func get_tree_item_children_count( atom tree, atom item, atom recursively )
- func get_tree_item_count( atom tree )
- func get_tree_item_font( atom tree, atom item )
- func get_tree_item_image( atom tree, atom item, atom which )
- func get_tree_item_text_color( atom tree, atom item )
- func get_tree_parent( atom tree, atom item )
- func get_tree_root( atom tree )
- func get_tree_selected_text( atom tree )
- func get_tree_selection( atom tree )
- func get_tree_selections( atom tree )
- func get_tree_text( atom tree, atom id )
- func insert_tree_item_after( atom tree, atom parent, atom previous, sequence text, atom image, atom sel_image )
- func insert_tree_item_before( atom tree, atom parent, atom before, sequence text, atom image, atom sel_image )
- func is_tree_empty( atom tree )
- func is_tree_item_bold( atom tree, atom item )
- func is_tree_item_expanded( atom tree, atom item )
- func is_tree_item_selected( atom tree, atom item )
- func is_tree_item_visible( atom tree, atom item )
- func prepend_tree_item( atom tree, atom parent, sequence text, atom image, atom sel_image )
- proc scroll_to_tree_item( atom tree, atom item )
- proc select_tree_item( atom tree, atom treeitem )
- proc set_tree_indent( atom tree, atom indent )
- proc set_tree_item_background( atom tree, atom item, atom color )
- proc set_tree_item_bold( atom tree, atom item, atom bold )
- proc set_tree_item_drop_highlight( atom tree, atom item, atom highlight )
- proc set_tree_item_font( atom tree, atom item, atom font )
- proc set_tree_item_has_children( atom tree, atom item, atom has_children )
- proc set_tree_item_image( atom tree, atom item, atom image, atom which )
- proc set_tree_item_text( atom tree, atom item, sequence text )
- proc set_tree_item_text_color( atom tree, atom item, atom color )
- proc sort_tree_children( atom tree, atom item )
- proc toggle_tree_item( atom tree, atom item )
- proc toggle_tree_item_selection( atom tree, atom item )
- func tree_hit_test( atom tree, atom x, atom y, atom flags )
- proc tree_imagelist( atom tree, atom il )
- func tree_item_has_children( atom tree, atom item )
- proc unselect_tree_item( atom tree, object items )
- func valid_tree_item( atom item )
Supertopics
Subtopics
wxTreeCtrl
[func]
add_tree_item ( atom tree, atom parent, sequence text, atom image, atom selimage )
Category:
wxTreeCtrl
- tree : The wxTreeCtrl in which the item will be added.
- parent : What the item will appear under. This can be an existing item, or the root.
- text : The text that will appear on the item.
- image : The image that will show when one of it's children is currently chosen.
- selImage : The image that will show when one of it's children is NOT currently chosen.
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
- Tree : The wxTreeCtrl in which the item will be added.
- Text : The text to appear on the item.
- Image : The image that will show when one of it's children is clicked.
- SelImage : The image that will show when one of it's children is NOT currently chosen.
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
Category:
wxTreeCtrl
Collapses this item and all of its children, recursively.
wxTreeCtrl
Category:
wxTreeCtrl
Collapses the root item.
wxTreeCtrl
Category:
wxTreeCtrl
Collapses the given item and removes all children.
wxTreeCtrl
Category:
wxTreeCtrl
Collapses the given item.
wxTreeCtrl
Category:
wxTreeCtrl
This goes to a TreeCtrl specified by tree and deletes all children
under the specifed item.
wxTreeCtrl
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
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
Category:
wxTreeCtrl
Scrolls and/or expands items to ensure that the given item is visible.
wxTreeCtrl
Category:
wxTreeCtrl
Expands the given item and all its children recursively.
wxTreeCtrl
Category:
wxTreeCtrl
Expands all items in the tree.
wxTreeCtrl
Category:
wxTreeCtrl
wxTreeCtrl
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
Category:
wxTreeCtrl
Returns the first visible item.
wxTreeCtrl
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
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
Category:
wxTreeCtrl
Returns the next visible item.
wxTreeCtrl
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
Category:
wxTreeCtrl
Returns the previous visible item.
wxTreeCtrl
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
Category:
wxTreeCtrl
Returns the normal image list.
wxTreeCtrl
Category:
wxTreeCtrl
Returns the current tree control indentation.
wxTreeCtrl
Category:
wxTreeCtrl
Returns the background colour of the item.
wxTreeCtrl
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
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
Category:
wxTreeCtrl
Returns the number of items in the control.
wxTreeCtrl
Category:
wxTreeCtrl
Returns the font of the item label.
wxTreeCtrl
Category:
wxTreeCtrl
Gets the specified item image. The value of which may be:
- wxTreeItemIcon_Normal to get the normal item image
- wxTreeItemIcon_Selected to get the selected item image (i.e. the image which is shown when the item is currently selected)
- wxTreeItemIcon_Expanded to get the expanded image (this only makes sense for items which have children - then this image is shown when the item is expanded and the normal image is shown when it is collapsed)
- wxTreeItemIcon_SelectedExpanded to get the selected expanded image (which is shown when an expanded item is currently selected)
wxTreeCtrl
Category:
wxTreeCtrl
Returns the colour of the item label.
wxTreeCtrl
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
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
Category:
wxTreeCtrl
This gets the text of whatever item is currently highlighted in the chosen wxTreeCtrl.
wxTreeCtrl
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
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
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
Category:
wxTreeCtrl
Returns true if the control is empty (i.e. has no items, even no root one).
wxTreeCtrl
Category:
wxTreeCtrl
Returns true if the given item is in bold state.
wxTreeCtrl
Category:
wxTreeCtrl
Returns true if the item is expanded (only makes sense if it has children).
wxTreeCtrl
Category:
wxTreeCtrl
Returns true if the item is selected.
wxTreeCtrl
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
Category:
wxTreeCtrl
Scrolls the specified item into view.
wxTreeCtrl
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
Category:
wxTreeCtrl
Sets the indentation for the tree control.
wxTreeCtrl
Category:
wxTreeCtrl
Sets the colour of the item's background.
wxTreeCtrl
Category:
wxTreeCtrl
Makes item appear in bold font if bold parameter is true or resets it to the normal state.
wxTreeCtrl
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
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
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
Category:
wxTreeCtrl
Sets the specified item image. See get_tree_item_image for the description of the which parameter.
wxTreeCtrl
Category:
wxTreeCtrl
Goes to the specified item inside of the specified wxTreeCtrl and sets the text in it to text.
wxTreeCtrl
Category:
wxTreeCtrl
Sets the colour of the item's text.
wxTreeCtrl
Category:
wxTreeCtrl
Sorts the children of the given item.
wxTreeCtrl
Category:
wxTreeCtrl
Toggles the given item between collapsed and expanded states.
wxTreeCtrl
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:
- wxTREE_HITTEST_ABOVE Above the client area.
- wxTREE_HITTEST_BELOW Below the client area.
- wxTREE_HITTEST_NOWHERE In the client area but below the last item.
- wxTREE_HITTEST_ONITEMBUTTON On the button associated with an item.
- wxTREE_HITTEST_ONITEMICON On the bitmap associated with an item.
- wxTREE_HITTEST_ONITEMINDENT In the indentation associated with an item.
- wxTREE_HITTEST_ONITEMLABEL On the label (string) associated with an item.
- wxTREE_HITTEST_ONITEMRIGHT In the area to the right of an item.
- wxTREE_HITTEST_ONITEMSTATEICON On the state icon for a tree view item that is in a user-defined state.
- wxTREE_HITTEST_TOLEFT To the right of the client area.
- wxTREE_HITTEST_TORIGHT To the left of the client area.
- wxTREE_HITTEST_ONITEM or_bits( wxTREE_HITTEST_ONITEMICON, wxTREE_HITTEST_ONITEMLABEL )
wxTreeCtrl
Category:
wxTreeCtrl
This sets the wxImageList to the wxTreeCtrl, allowing the wxTreeCtrl's children to use it's icons.
wxTreeCtrl
Category:
wxTreeCtrl
Returns true if the item has children.
wxTreeCtrl
Category:
wxTreeCtrl
Removes the selection from the currently selected item (if any).
wxTreeCtrl
Category:
wxTreeCtrl
Returns true if this instance is referencing a valid tree item.