ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Innovative Data Concepts, Inc. Technical Information Note TesSeRact Development Tools ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Using The New Selection-Tagging Functions TN-9204-020 April 29, 1992 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Our use of CUA specifications for selecting multiple items in the new functions SelFileT() and SelStrT() has generated some confusion and questions. In this note, we will discuss our reasons for implementing things this way and try to make this selection behavior a little more intuitive (or as much as CUA will allow us!). We will also reiterate the more technical discussion of the CUA spec that appears in the file DOC\README.V6. Why CUA? IBM's Common User Access (CUA) standard was designed primarily (but not exclusively) as a set of specifications to govern the behavior of user interfaces. The goal of CUA is to provide a user interface standard that is reasonably easy to use and portable across platforms. The fact that CUA has been adopted as the standard interface for both OS/2's Presentation Manager and Windows, as well as other systems, clearly demonstrates that CUA has gained the acceptance of the industry. Since TCXL is first and foremost a user-interface product, and since portability is one of our primary concerns, it is logical that we should move in this direction. Using Selection Tagging When it comes right down to, selection tagging is pretty easy. Yes, certain aspects of it are not very intuitive (we can blame IBM for that), but for most actions, no problem. In a nutshell, here's how it works: The highlight bar always indicates the tagged item(s), and the square brackets always show the current cursor postion. As you cursor though the selection list, the item where you sit is the tagged item. To tag a bunch of items, hold down [Shift] as you move. If you want to tag items that are next to each other, press [Shift-F8] (this is called "add mode", and the square brackets will blink to show this). Hold down [Ctrl] as you move and press [Space] every time you want to tag something. Pressing [Shift-F8] again quits add mode. If you're using a mouse, it even easier. To tag an individual item, click on it. To add more tags, hold down [Ctrl] as you click. Of course, there are more variations and key combinations besides just these. But these guidelines cover the basics, and for most purposes, this is all you need to know. Technical Notes on the CUA Specification Our CUA-compliant multiple-selection implementation is based on guidelines published in the book "Systems Application, Architecture Common User Access: Advanced Interface Design Guide" (IBM, 1989). For a complete discussion of CUA, please refer to that manual. Notes on the TCXL implementation of CUA selection follow. In CUA terminology, the process of selecting more than one item is called extended selection. We call it tagging, but we'll use both terms interchangebly. CUA defines two ways to visually indicate an item: "cursored" emphasis and "selected" emphasis. In the context of a selectable list of items in a graphical environment, cursored emphasis is usually implemented as a dotted outline box surrounding the current item. Selected emphasis is shown by using an inverse color bar. TCXL uses the color bar for selected emphasis, but cannot use a dotted outline box in text mode. Instead, we simulate the box by surrounding the item with square brackets. In "add mode," which is the mode used to make multiple selections from the keyboard, CUA specifies that the dotted outline box be made to blink. TCXL uses the _BLINK attribute for the square brackets to get an equivalent effect. Thus, all selected items are displayed with the inverse attribute, the cursor position in the select list is indicated by the square brackets, and blinking brackets mean that you are in add-mode. An important concept in CUA selection is the idea of an "anchor point." This is the position in the list from which an extended selection is made. Once an anchor point has been established, the user can create, modify, or remove a range of tagged items. These are the mouse actions that you can use for tagging one or more items: I. MOUSE Action Result ====== ====== Click 1. Tags the item. 2. Un-tags all other tagged items. 3. Sets the anchor point. Shift+Click 1. Tags all items from the anchor point to the selected item. 2. Un-tags all other choices. 3. Preserves the anchor point. Ctrl+Click 1. Toggles the tag state of the selected item. 2. Preserves the tagged state of all other choices. 3. Sets the anchor point. Ctrl+Shift+Click 1. Toggles all choices from the anchor point to the selected item. 2. Preserves the tag state of all other choices. 3. Preserves the anchor point. II. KEYBOARD On the keyboard, [Space] is the selection key. In general, however, any item you move to using the movement keys ([Up], [Down], [Left], [Right], [Home], [End], [PgUp], [PgDn]) is automatically tagged. To toggle add-mode on and off, use [Shift-F8]. To move without tagging additional items, use [Shift] with the movement keys. To end the selection process, and return with a list of tagged items, press [Enter]. To terminate selection without tagging any items, press [Esc]. When in add-mode, the basic behavior is as follows: þ Use movement keys to move around without tagging, and to set the anchor point. þ Use [Shift] with the movement keys to toggle from the anchor point to the current position and keep the anchor point. þ Use [Ctrl] with the movement keys to move without tagging or changing the anchor point. þ Use [Space] to toggle the item at the cursor position and set the anchor point. þ Use [Shift-Space] to toggle everything from the anchor point to the current position and preserve the anchor point. !!! IMPORTANT NOTE !!! The way tagging works is very different from the way single-item selection works in the old-style SelFile() and SelStr(), due to our very close adherence to CUA guidelines. In the older functions, the inverse selection bar just indicates the cursor position, and [Enter] selects the current item and returns. While the way the new tagging routines work may seem strange at first, keep two things in mind: first, this is CUA-compliant behavior by the book; second, the old routines are still available, and work as they always did.