Please enable JavaScript to view this site.

A-Shell Consolidated Reference

Navigation: Subroutines > XTREE > XTREE Techniques

Mouse and Keyboard

Scroll Prev Top Next More

Modified September 2019; see History

XTREE follows most of the standard Windows keyboard and mouse conventions. The following describes some of the special cases that might not be otherwise obvious.

Printing:

 

Ctrl+P invokes the print/previewer (see XTROP_PRINT)

Font Scaling:

 

Ctrl+Plus increases the existing font sizes by about 10%
Ctrl+Minus decreases the existing font sizes by about 10%
Ctrl+Slash ( "/" ) resets the fonts to the original sizes

Locating and Selecting Items:

 

Use the Up/Down-arrow keys, or a single LeftClick to move the selection bar. Note that when the XTF_UP and/or XTF2_DOWN flags are specified (to enable exiting the tree with up and/or down arrow), there must be a delay of 1/3 or more seconds prior to the up or down key press in order for the exit operation to take place (so as to minimize the chance of accidentally exiting while rapidly scrolling up or down the items). Note also that the ClickExit clause can be used to cause a single click to exit.
To locate an item by its text, click once in the relevant column (to make that column be the "active" one), then type the character(s). As you type, it will select the first row whose cell text in the current column matches what you've typed. The match logic resets after a delay of approximately one to two seconds without any characters being entered. Note that clicking on the column header may sort the column (see Sorting). Also note that the default "active" column is established by the XTR.COLUMNACTIVE field in xtrctl.
Hit Enter or Double-Click to exit with the current item selected.

Multi-level trees:

 

The Plus and Minus keys (on the main keyboard or on the numeric pad section) are equivalent to clicking on expand/collapse button for the current level.
Ctrl+Shift+Plus and Ctrl+Shift+Minus, expand or collapse levels, are sensitive to the level of the current item. When expanding, XTREE only expands items at that level that are visible , along with all of their dependents. When contracting, it only contracts from the current level down. For example: to make the top two levels visible but none below that, start with Ctrl+Shift+Plus on a top level item to expand all, then Ctrl+Shift+Minus on a 2nd level item to contract the levels below that.
Ctrl+Up-arrow and Ctrl+Down-arrow moves the selection bar to the prev/next item which is at the same level as the current item, but which has a different parent. If necessary, this will cause the target item to be made visible by expanding its parent(s).
Provided there is no conflict—i.e. in the absence of XTF_EDITABLE, XTF_LEFT, or XTF_RIGHTLeft/Right-arrows act similarly to Plus/Minus (expand/contract) but also move the selection up or down to the next level, allowing rapid navigation of multi-level trees with just the arrow keys. You can force this behavior to override conflicting flags by using the compound cformat code @@ instead of just @. Feature added in 5.1.1220.

Multi-Selection Trees:

 

Ctrl+A selects all items, Ctrl+B deselects them.
LeftClick selects current item, clearing all other selections.
Ctrl+LeftClick toggles the current item, preserving other selections.
Shift+LeftClick selects all the rows from the previous selection to the current row.

Trees with Editable Cells:

 

Tab and Shift+Tab change the focus to the next/prev editable cell, provided the XTF_TAB flag is not set.
Arrow keys will navigate between cells that do not themselves trap the arrow keys for editing purposes. For example, editable text cells would trap the left and right arrows for editing within the cell. In such cases, you can use Ctrl+Arrow for inter-cell navigation. See Combo Boxes for more details.
LeftClick on a cell to select it for editing. Note that depending on the cell validation options in cformat, and possibly a ClickExit clause, clicking on another cell may cause XTREE to exit back to the application for validation purposes.
ctrl+' (Control Apostrophe) may be used within an editable text cell to copy/paste the contents of the cell above it, as in Excel.
CTRL+C (copy), CTRL+v (paste), and Ctrl+Z (undo) work as they do in Excel, Word and many Windows applications.

Combo boxes:

 

When the focus is on a combo box within a cell, the up/down arrows would normally cycle among the possible selections. But if the ScrollMode=Tree clause is specified, unless the drop-down list is visible, the up/down arrows advance to the prev/next row (as if Ctrl+Up or Ctrl+Down).
For selection-only combo boxes (where you are limited to selecting one of the predefined choices), if the list of choices includes a blank item, then the Delete key (or Spacebar) will select it. Alphanumeric keys will select the first item that starts with the specified character.

Dropdown Lists:

 

When the focus is on a cell containing a dropdown list (which differs from a combo box in that you can only select among the existing choices – see List) typing a character will jump to the first matching item in the list. If there are multiple items which start with the same character, hitting the character again will cycle among them. This can be seen in the XTRA5 example program, where hitting "B" repeatedly while in the Description column will cycle between "Boxer", "Bell Bottoms", and "Black Standard Tee".

Checkboxes:

 

Spacebar or LeftClick to toggle the checkbox.

Extended Checkboxes (T+):

 

Ctrl+A sets (ticks) all enabled checkboxes in the column, Control=B resets (clears) them.
LeftClick on an clear box sets it, and if followed by Shift+Click on another clear box in the column, will set all the boxes between them, inclusive.
Ctrl+Z undoes either of the above actions, if executed while a checkbox in the affected column has the focus and no intervening events have occurred.
RightClick may display checkbox-specific context menu options if defined (see Editable checkbox)

Popup Menus:

 

If a popup (or "context") menu is defined (see PopupMenu), use a single RightClick to display it.

Column Configuration:

 

To reorder columns (if enabled via the XTF_REORD flag), use the mouse to drag the columns by their headers. See XTR.USECOLORDER (in xtrctl) and Saving User Adjustments for details on how/whether such column reordering will be automatically remembered.
To resize columns (if not disabled by the coldef "L" code or limited by the Dspmin in Advanced Coldef Options), click on the right vertical border of the column (when the mouse cursor changes to a double arrow) and drag the column border left or right.
Ctrl+Plus (Ctrl with the plus key), Ctrl+Minus (Ctrl with the minus key) and Ctrl+Mousewheel will increase or decrease the size of all of the text in the tree by approximately seven percent.
Ctrl+Slash (the slash may need to be on the numeric keypad) will reset the text to the original size. (Equivalent to the $RESETSCALE special PopupMenu command)
Ctrl+Shift+Slash (the slash may need to be on the numeric keypad) will reset all of the user-controlled configuration options (text size, column sizes and order) to the original settings. (Equivalent to the $RESETCFG special PopupMenu command).
To sort the rows of the tree by the values of a column, click on the column header. Subsequent clicks on the header will cycle through the three possibilities (ascending, descending, and original). To sort by more than one column, start by sorting on the primary column, then for the secondary and tertiary sort columns, hold down the Control key while clicking the column header. Also see Sorting, the following topic, for more details.

See Also

History

2019 September, A-Shell 6.5.1668:  Change behavior of Ctrl+Shift+Plus and Ctrl+Shift+Minus, expand or collapse levels, so that they now sensitive to the current item Previous, those keystrokes expanded or collapsed all levels.

2011 July, A-Shell 5.1.1225:  Using the Left-arrow from a child row now jumps to the parent (provided XTF_LEFT is not set, or @@ is used to override it). Conversely, Right-arrow from a parent row whose children are already expanded jumps to the first child (provided XTF_RIGHT not set or @@ is used). With this, plus the expand/contract on left/right feature added in 1220.0, XTREE now matches the handling of the arrow keys in the Windows registry editor.

2011 June, A-Shell 5.1.1221: XTREE refinement: Shift+Right within an editable text cell now marks text rather than advancing to the next cell. (Ctrl+Right advances.)