Please enable JavaScript to view this site.

A-Shell Development History

New column definition code "u", which is similar to "U" in that it defines a variation on an editable text cell. While "U" causes the editing logic to skip over the cell in input mode, making it only updatable by the application, lower case "u" allows the cell to be given the edit focus but in read-only mode. Read only mode looks the same as regular edit mode except that the background of the cell is gray instead of white.

The idea behind this feature is to give the user a sense of being able to edit the cell, but without allowing them to directly edit it. Instead, when the cell has the focus, most keys other than navigation keys will cause the XTREE to exit (with EXITCODE = -48, as for normal cell editing validation), so that the application can then present a more customized cell editing capability.

For example, in an appointment scheduler, you might want the user to be able to "edit" a cell in order to make or change an appointment, but you don't want them to just be able to type anything in the cell. Instead, they cause the cell to have the focus (using navigation keys or by clicking with the mouse) and then they can indicate the desire to update the cell by hitting ENTER, or any exit key, or for that matter, any normal character key. The application would then detect this event by the combination of the EXITCODE (-48 for ENTER or printable characters, or the normal exitcode for other exit keys) and determine the cell by the XTR'XROW and XTR'XCOL fields. Then it might pop up a dialog designed for editing an appointment. When that dialog is finished, the application can plug an updated value for the cell into the appropriate slot in the ANSARY parameter and re-enter the XTREE using XTR'OPCODE 4 (reselect).

Note that when re-entering, the initial focus will be determined by the XTR'XCOL and XTR'XROW fields (presumably still pointing the cell we were just in) and the XTR'XNAVCOD field, which contains the value of the key used to exit the field. Depending on that value, the initial focus may be advanced to another cell. For example, the standard action for the ENTER key is to advance to the next cell. If you don't want that, then zero out XTR'XNAVCOD before re-entering the XTREE.

Also note: XTR'XNAVCOD can be used to determine which key the user entered to cause XTREE to exit. 13=ENTER, while values from asc("1") to asc("z") indicate the corresponding character key.