![]() |
ListRec |
Header: Lists.h |
struct ListRec { Rect rView; GrafPtr port; Point indent; Point cellSize; ListBounds visible; ControlRef vScroll; ControlRef hScroll; SInt8 selFlags; Boolean lActive; SInt8 lReserved; SInt8 listFlags; SInt32 clikTime; Point clikLoc; Point mouseLoc; ListClickLoopUPP lClickLoop; Cell lastClick; SInt32 refCon; Handle listDefProc; Handle userHandle; ListBounds dataBounds; DataHandle cells; SInt16 maxIndex; SInt16 cellArray[1]; }; typedef ListRec ListPtr;
The rectangle in which the lists visible rectangle is located, in local coordinates of the graphics port specified by the port field. Note that the lists visible rectangle does not include the area needed for the lists scroll bars. The width of a vertical scroll bar (which equals the height of a horizontal scroll bar) is 15 pixels.
The graphics port of the window containing the list.
The location, relative to the upper-left corner of a cell, at which drawing should begin. List definition functions should set this field to a value appropriate to the type of data that a cell in a list is to contain.
The size in pixels of each cell in the list. When your application creates a list, it can either specify the cell size or let the List Manager calculate the cell size. You should not change the cellSize field directly; if you need to change the cell size after creating a list, use the LCellSize function.
The cells in a list that are visible within the area specified by the rView field. The List Manager sets the left and top fields of visible to the coordinates of the first visible cell; however, the List Manager sets the right and bottom fields so that each is 1 greater than the horizontal and vertical coordinates of the last visible cell. For example, if a list contains 4 columns and 10 rows but only the first 2 columns and the first 5 rows are visible (that is, the last visible cell has coordinates (1,4)), the List Manager sets the visible field to (0,0,2,5).
A control handle for a lists vertical scroll bar, or NULL if a list does not have a vertical scroll bar.
A control handle for a lists horizontal scroll bar, or NULL if a list does not have a horizontal scroll bar.
Indicates the selection flags for a list. When your application creates a list, the List Manager clears the selFlags field to 0. This defines the List Managers default selection algorithm. To change the default behavior for a particular list, set the desired bits in the lists selFlags field. See
Indicates whether the list is active (TRUE if active, FALSE if inactive).
Reserved.
Indicates whether the List Manager should automatically scroll the list if the user clicks the list and then drags the cursor outside the list display rectangle. See
By default, the List Manager enables horizontal autoscrolling for a list if the list includes a horizontal scroll bar, and enables vertical autoscrolling for a list if the list includes a vertical scroll bar.
The time in ticks of the last click in the list. If your application depends on the value contained in this field, then your application should update the field if the application selects a list item in response to keyboard input.
The location in local coordinates of the last click in the list.
Indicates the current location of the cursor in local coordinates. This value is continuously updated by the LClick function after the user clicks a list.
A universal procedure pointer to your click loop callback function, which is repeatedly called by the LClick function, or NULL if the default click-loop function is to be used.
The coordinates of the last cell in the list that was clicked. This may not be the same as the last cell selected if the user selects a range of cells by Shift-dragging or Command-dragging. If your application depends on the value contained in this field, then your application should update the field whenever your application selects a list item in response to keyboard input.
4 bytes for use by your application.
A handle to the code for the list definition function that defines how the list is drawn.
4 bytes that your application can use as needed. For example, your application might use this field to store a handle to additional storage associated with the list. However, the LDispose function does not automatically release this storage when disposing of the list.
The range of cells in a list. When your application creates a list, it specifies the initial bounds of the list. As your application adds rows and columns, the List Manager updates this field. The List Manager sets the left and top fields of dataBounds to the coordinates of the first cell in the list; the List Manager sets the right and bottom fields so that each is 1 greater than the horizontal and vertical coordinates of the last cell. For example, if a list contains 4 columns and 10 rows (that is, the last cell in the list has coordinates (3,9)), the List Manager sets the dataBounds field to (0,0,4,10).
A handle to a relocatable block used to store cell data. Your application should not change the contents of this relocatable block directly.
Used internally.
Offsets to data that indicate the location of different cells data within the data handle specified by the cells parameter. Your application should not access this field directly.
Functions in the List Manager interface use the ListHandle datatype to identify a list. The ListHandle type uses a ListRec structure to maintain information about a list. The ListRec data type defines a list record.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)