LGetSelect
LGetSelect Query if a cell is selected; get next selected cell Boolean advanceIt ; 0=examine one cell; 1=keep looking Cell *theCell ; Cell to start checking; receives cell ListHandle theList ; handle leading to a ListRec returns Is theCell selected? OR Was a selection found?
LGetSelect performs two different operations. It can query to see if a specific cell is currently selected OR it can check cells until it finds one that
is selected.
advanceIt is a Boolean specifying which operation to perform. It is one of: FALSE See if theCell is currently selected and return TRUE if it is. If it is not selected, return FALSE. TRUE See if theCell is selected and return TRUE if it is; otherwise, advance to the next cell on the row and check it. Keep advancing
across the row and on to subsequent rows until a selected cell is
found or the end of the list is reached. If a selected cell is
found, return TRUE and store its coordinates in theCell. theCell is the address of a 32-bit Cell (a.k.a. Point). On entry it specifies the first (or only) cell to check. Upon return, it receives the
coordinates of the selected cell (if the return value is TRUE). theList is a handle leading to a variable-length ListRec structure. It is a value previously obtained via LNew. advance=FALSE) OR whether the search for a selected cell succeeded. It is one of:
FALSE theCell is NOT currently selected OR none of the cells to the right of (or in rows below) theCell is currently selected.
TRUE theCell IS currently selected OR another selected cell was found by scanning the list (its coordinates have been stored in
theCell ).
Notes: LGetSelect is designed for locating selected (highlighted) cells in a list. You might use it after LLastClick to verify that a certain cell is currently selected, but it is most often used to search for selected cells.
If advanceIt is TRUE, the search starts at theCell and proceeds from left to right and if no selection is found in a row, the search continues on to
Note that in searching for all selections in a list, you will need to advance
theCell after a selection is found. For example:
SetPt( &theCell.h, 0,0 ); /* start at top of list */ printf( Cell (%d,%d) is currently selected\n", theCell.h, theCell.v ); }
If ListRec.selFlags bit 7 is set, the user can select only one cell at a time, so there is should be no need to loop back to check for another selection.
In searching for multiple cells, you might also want to deselect each cell as
the next selection into the viewing area.