home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Lists.c
-
- Contains: List Manager stuff and associated routines
-
- Written by: Chris White, Developer Technical Support
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- 12/18/95 CW First release
-
- */
-
-
- #pragma segment Core
-
-
- // System Includes
-
-
-
- // Application Includes
-
- #ifndef __BAREBONES__
- #include "BareBones.h"
- #endif
-
- #ifndef __PROTOTYPES__
- #include "Prototypes.h"
- #endif
-
-
-
-
-
-
- Boolean HandleListClick ( WindowRef theWindow, EventRecord* event )
- {
- Point localPt;
- ListRef theList;
-
-
- localPt = event->where;
- GlobalToLocal ( &localPt );
- theList = (ListRef) GetWRefCon ( theWindow );
-
- if ( (*theList)->lActive == true )
- {
- Rect listRect;
-
- GetListRect ( theList, &listRect );
- // Include the scroll bars
- listRect.right += 15;
-
- if ( PtInRect ( localPt, &listRect ) )
- LClick ( localPt, event->modifiers, theList );
-
- }
-
- return true;
- }
-
-
-
- void AddToList ( ListRef theList, Str255 theString )
- {
- Rect dataRect;
- Cell theCell;
- short nuRow;
-
- #if DEBUGGING
- if ( theList == nil ) DebugStr ( "\p theList == nil");
- #endif
-
- dataRect = (*theList)->dataBounds;
- nuRow = LAddRow ( 1, dataRect.bottom, theList );
- SetPt ( &theCell, 0, nuRow );
- LSetCell ( &theString[1], theString[0], theCell, theList );
-
- return;
- }
-
-
-
- void GetListRect ( ListRef theList, Rect* theRect )
- {
- *theRect = (*theList)->rView;
- }
-
-
-
-
-
-
-