Listing 4-9 illustrates a useful procedure that uses LSetSelect and LGetSelect to select a single cell in a list while deselecting all other cells. This prevents an annoying flickering that would otherwise occur if you were to call MySelectOneCell to select a cell already selected. For example, this is how the Standard File Package responds if the user presses the Down Arrow key when the currently selected item is on the bottom of the list's visible rectangle. You can mimic this effect by calling the LScroll procedure, which requires that your application indicate how many columns and rows to scroll. Negative numbers indicate scrolling up or to the left.
Positive numbers indicate scrolling down or to the right.
Listing 4-10 illustrates the use of the LScroll procedure. The MyMakeCellVisible procedure defined in Listing 4-10 simply computes the number of cells between the last visible row and column and the selected cell. Inc. All rights reserved.