Notes and tips for ActiveX Toolkit lists

The following is a list of issues you should keep in mind when using the ActiveX implementation of a Toolkit list. For additional notes, see Using lists in Toolkit applications. For information on setting options that cause lists to be ActiveX lists, see Specifying and determining the list type.

There are times, however, when the internal list control snaps the currently focused item into view when L_INPUT or L_INPFLD is being used (as opposed to L_SELECT). This usually occurs when the user expects it (when focus moves to a new cell that is also not currently in view, for example), but it can occur at unexpected times. For example, this can happen when the initial and/or last item parameters passed to L_CREATE (or the default estimates if these parameters are not passed) prove incorrect by the responses from the load method. At that point, the internal list must be reorganized for the new list dimensions, which often causes the focused cell to snap back into the viewable area.

For instance, if you have a list that’s longer than twice the viewable area, and you don’t pass the last argument to L_CREATE, and the user uses the scroll bar to scroll all the way down, the list may suddenly snap back to the focused item when the item loaded exceeds the initially estimated last item. Note that this only occurs in L_INPUT and L_INPFLD, and does not occur if a correct estimate of the dimensions of the list is given to L_CREATE.

1. For each column, find the largest of the following: the header, the footer, the display format, or the input format.
2. Add the numbers from step 1. (There should be a number for each column.) Then add an additional one or two characters for each column.
3. Test the window by compiling the window and looking at the list. If the column header, footer, or data is truncated, increase the display area until everything displays properly.

For example, if your list has two columns (one whose largest element is the header, which has 13 characters, and a second whose largest element is the footer, which has 15 characters), add these two numbers. The sum is 28. Then add four to the total, which makes 32. (In this case, we’re adding two characters for each column in the list.) The display_area line of the list definition is

display_area 1, 1, 1, 32

Set the window width larger than the sum calculated in step 2 above. For example, if you calculate that the display area needs to be 32 characters, set the window size to at least 33:

.input table_list, 1, 33