LabWindows/CVI

Content Type
Programming Language
Current manual
Table of Contents

Operating Tree Controls

Operating Tree Controls

When you set a tree control to any mode other than indicator mode, you can use the keyboard or the mouse to navigate through it, select items, and drag and drop items.

Selecting Items

You can select items in the tree control with the keyboard in the following ways:

  • Use the up arrow key to highlight the previous tree item.
  • Use the down arrow key to highlight the next tree item.
  • If the tree is in multiple selection mode, press <Shift> and the arrow keys to select multiple items.
  • If the tree is in multiple selection mode, press <Ctrl> and the arrow keys to deselect items you have selected.

You can select items in the tree control with the mouse in the following ways:

  • Click a tree item to highlight it.
  • Press <Shift> and click to select multiple tree items, if the tree is in multiple selection mode.
  • Press <Ctrl> and click to select or deselect tree items, if the tree is in multiple selection mode.

Navigating through the Tree Control

Navigate through the tree using the keyboard in the following ways:

  • Press the right arrow key to expand a parent node with child items.
  • Press the left arrow key to collapse a parent node with child items.
  • If you enable the auto expand attribute, the new active item is automatically expanded as you change active items with the keyboard.
  • Use the Quick Type feature to locate a tree item. For example, type M to locate the first item that begins with M. When you type a complete name, Quick Type moves to that item. When you delay one second or more and then press a key, the Quick Type buffer is flushed.
  • Press <Home> to move to the top of the tree.
  • Press <End> to move to the bottom of the tree.
  • Press <Page Up> to move up one page.
  • Press <Page Down> to move down one page.

Navigate through the tree using the mouse in the following ways:

  • Click the plus/minus box to collapse or expand tree items with child items.
  • Use the scroll bars to view another area of the tree control.
  • If you enable the auto expand attribute, the new active item is automatically expanded as you change active items with the mouse.

Marking Tree Items

You can mark items in the tree in the following ways:

  • If you set the mark type to VAL_MARK_CHECK or VAL_MARK_RADIO and enable ATTR_SHOW_MARKS, you can press <Spacebar> to toggle the mark of the active item.
  • If you enable ATTR_SHOW_MARKS and set the mark type to VAL_MARK_CHECK, you can click the checkbox to mark/unmark an item.
  • If you enable ATTR_SHOW_MARKS and set the mark type to VAL_MARK_RADIO, you can click a radio button to mark the button. You can mark only one sibling item with a radio button at a time.
  • If you enable the mark reflect attribute, the following behavior occurs:
    • If all child items are marked/unmarked, the parent item is also marked/unmarked.
    • If at least one child item, but not all child items, is marked, the parent item is partially marked.
    • If the parent item is marked/unmarked, all the child items are marked/unmarked.

Using the Pop-up Menu

If you right-click the tree control, you activate a menu that contains predefined items, as well as items you can include.

The following tools correspond to the predefined pop-up menu items:

  • Sort—Sort the tree items in ascending or descending order. When you select Sort, a dialog box appears in which you can specify sorting options.
  • Find—Search items in the entire tree, or in a selection range, for a text string. After the initial search, you can press <F3> to find the next occurrence of the same text string, or you can press <Shift-F3> to search backwards for the previous occurrence of the text string. When you select Find, a dialog box appears in which you can specify search options.
  • Expand Subtree—Opens the child items of the parent node.
  • Collapse Subtree—Collapses the child items of the parent node.
  • Expand All—Opens all items in the tree.
  • Collapse All—Collapses all items in the tree.

Sizing Columns

If you enable column sizing, you can change the width of a column by dragging the column separator.

Double-click the column separator to auto-size the column to the length of the longest column label or cell contents.

Dragging and Dropping

You can move or copy items within the tree control by dragging and dropping. To move a tree item, drag the active item to a new place in the tree control. If you drag a parent item, all of its child items are also moved. If you enable ATTR_ENABLE_DRAG_DROP_COPY, you can copy a tree item by pressing <Ctrl> as you drag and drop the active item to a different location in the tree control.

Generating Commit Events

You can generate a commit event when the tree control mode is hot or validate in the following ways:

  • Double-click a tree item.
  • Commit a change to a tree item label.
  • Press <Return>.
  • Mark/unmark a checkbox or radio button.

Invoking Other Tree Behavior

  • If you set the no edit label attribute to 0, you can edit the label of the active item by pressing <F2>. When you finish making edits, press <Enter> or click away from the item. If you want to undo the change, press <Esc> before pressing <Enter> or clicking away from the item.
  • If tree item labels extend past the columns, the entire label appears in a tooltip window when you hover the mouse over the label.
Was this information helpful?