User Interactions
Selections made with the mouse or keyboard can be contiguous or disjoint. The end user can make single selections by clicking a row without keyboard modifiers or by using keyboard navigation keys (up arrow/down arrow, PgUp/PgDown, or Home/End) without modifiers to navigate to the desired row.
Contiguous Multiple Selections
Contiguous multiple selections can be made by clicking and dragging without modifiers. The Shift key modifier expands the ability to make multiple selections by making use of the concept of an anchor row. Clicking a row without the Shift key modifier moves the anchor to the selected row (even if you subsequently drag to a different row).
Keyboard navigation without the Shift key modifier moves the anchor to the selected row. However, whenever the Shift key is used as a modifier the anchor row remains unchanged. Using the Shift key causes all rows between the anchor row and the row navigated to, to become selected, causing all other rows to become deselected. Therefore, the end user can make contiguous selections by first setting the anchor without the Shift key and then navigating using the Shift key.
Disjointed Multiple Selections
The Ctrl key modifier to the mouse enables disjointed multiple selections. This is because using the Ctrl key modifier does not modify any selections outside of the range of its command. Doing a Ctrl+Click toggles the selection state only of the single row clicked on. Doing a Ctrl+Click+Drag does a contiguous selection (or deselection) of the rows dragged across, but does not affect any other rows.
Disjointed selections using the keyboard require use of Shift+F8 to first change the mode of selection. This causes both the anchor and all current selections to remain fixed while using navigation keys (except the Shift key modifier, which selects or deselects all rows between the anchor and the new row, but leaves all other current selections fixed). In the Shift+F8 selection mode, the Space key toggles the selection state of whichever row has the focus without modifying selections. It also changes the anchor to that row. This mode is toggled back to the usual keyboard mode if the field loses focus or if there are any mouse clicks.
The following table summarizes the result of all end user mouse actions:
Scrolling actions using the associated scroll bar do not change existing selections when Selection Type is Multiple. It does, however, change the focus row, so that the focus row remains visible. The default action of scrolling with Selection Type of Single is to change the selection. This can, however, be overridden by setting the ScrollingChangesSelection flag to FALSE.
You can force the table field to be scrolled in a 4GL script in exactly the manner as is currently done by setting the ActiveRow attribute. If the ActiveRow attribute is set to a row that is not currently visible, it is scrolled into view at the top of the table field.