IUP/Callbacks/IupTree
From Vendetta Lua
Jump to navigationJump to search
- SELECTION_CB: Action generated when an element is selected or deselected. This action occurs when the user clicks with the mouse or uses the keyboard with the appropriate combination of keys.
- elem:selection_cb(id, status: number) -> (ret: number)
- self: Identifier of the IupTree interacting with the user.
- id: Node identifier.
- status: 1 - node was selected, 0 - node was unselected.
- This function must return IUP_IGNORE for the selected node not to be changed, or IUP_DEFAULT to change it.
- MULTISELECTION_CB: Action generated when multiple nodes are selected with the mouse and the shift key pressed.
- elem:multiselection_cb(ids: table, n: number) -> (ret: number)
- self: Identifier of the IupTree interacting with the user.
- ids: Array of node identifiers.
- n: Number of nodes in the array.
- This function must return IUP_IGNORE for the selected nodes not to be changed, or IUP_DEFAULT to change it.
- BRANCHOPEN_CB: Action generated when a branch is expanded. This action occurs when the user clicks the "+" sign on the left of the branch, or when double clicks the branch image, or hits Enter on a collapsed branch.
- elem:branchopen_cb(id: number) -> (ret: number)
- self: Identifier of the IupTree interacting with the user.
- id: Node identifier.
- This function must return IUP_IGNORE for the branch not to be opened, or IUP_DEFAULT for the branch to be opened.
- BRANCHCLOSE_CB: Action generated when a branch is collapsed. This action occurs when the user clicks the "-" sign on the left of the branch, or when double clicks the branch image, or hits Enter on an expanded branch.
- elem:branchclose_cb(id: number) -> (ret: number)
- self: Identifier of the IupTree interacting with the user.
- id: Identifier of the clicked node.
- This function must return IUP_IGNORE for the branch not to be closed, or IUP_DEFAULT for the branch to be closed.
- EXECUTELEAF_CB: Action generated when a leaf is to be executed. This action occurs when the user double clicks the leaf image, or hits Enter on a leaf.
- elem:executeleaf_cb(id: number) -> (ret: number)
- self: Identifier of the IupTree interacting with the user.
- id: Identifier of the clicked node.
- RENAMENODE_CB: Action generated when a node is to be renamed. It occurs only when the user double clicks the text associated to a node (leaf or branch) or press F2, and SHOWRENAME=NO.
- elem:renamenode_cb(id: number, name: string) -> (ret: number)
- self: Identifier of the IupTree interacting with the user.
- id: Identifier of the clicked node.
- name: Current name of the clicked node.
- SHOWRENAME_CB: Action generated when a node is to be renamed in place and SHOWRENAME=YES. It occurs only when the user double clicks the text associated to a node (leaf or branch) or press F2, and SHOWRENAME=YES.
- elem:showrename_cb(id: number: string) -> (ret: number)
- self: Identifier of the IupTree interacting with the user.
- id: Identifier of the clicked node.
- RENAME_CB: Action generated after a node was renamed in place. It occurs when the user press Enter after editing the name, or when the text box looses it focus.
- elem:rename_cb(id: number, name: string) -> (ret: number)
- self: Identifier of the IupTree interacting with the user.
- id: Identifier of the clicked node.
- name: New name of the clicked node.
- The new name is accepted only if the callback returns IUP_DEFAULT. If the callback does not exists the new name is always accepted. If the user pressed Enter and the callback returns IUP_IGNORE the editing continues. If the text box looses its focus the editing stops always.
- DRAGDROP_CB: Action generated when a drag & drop is executed. Only active if SHOWDRAGDROP=YES.
- elem:dragdrop_cb(drag_id, drop_id, isshift, iscontrol: number) -> (ret: number)
- self: Identifier of the IupTree interacting with the user.
- drag_id: Identifier of the clicked node where the drag start.
- drop_id: Identifier of the clicked node where the drop were executed.
- isshift: Boolean flag indicatinf the shift key state.
- iscontrol: Boolean flag indicatinf the control key state.
- RIGHTCLICK_CB: Action generated when the right mouse button is pressed over the IupTree.
- elem:rightclick_cb(id: number) -> (ret: number)
- self: Identifier of the IupTree interacting with the user.
- id: Identifier of the clicked node.
- The canvas callback K_ANY if set will be called before the internal callback. The IupGetAttribute always returns the internal callback.
- The canvas callbacks ACTION, SCROLL_CB, MAP_CB, RESIZE_CB and BUTTON_CB can not be changed. The other callbacks can be freely changed.
- See IupCanvas.