home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Apple Macintosh Developer Technical Support
- **
- ** File: TreeObj2.c
- ** Written by: Eric Soldan
- **
- ** Copyright © 1992-1993 Apple Computer, Inc.
- ** All rights reserved.
- */
-
- /* You may incorporate this sample code into your applications without
- ** restriction, though the sample code has been provided "AS IS" and the
- ** responsibility for its operation is 100% yours. However, what you are
- ** not permitted to do is to redistribute the source as "DSC Sample Code"
- ** after having made changes. If you're going to re-distribute the source,
- ** we require that you make it clear in the source that the code was
- ** descended from Apple Sample Code, but that you've made changes. */
-
- #include "App.h" /* Get the application includes/typedefs, etc. */
- #include "App.protos.h" /* Get the prototypes for the application. */
-
- #ifndef __TREEOBJ2__
- #include "TreeObj2.h"
- #endif
-
- extern TreeObjProcPtr gTreeObjMethods[];
-
-
-
- /**********************************************************************/
-
-
-
- #pragma segment File
- TreeObjHndl DoTreeHitTest(TreeObjHndl hndl, ClickInfo *click)
- {
- short cnum;
- TreeObjHndl hit;
-
- hit = (TreeObjHndl)DoTreeObjMethod(hndl, HITTESTMESSAGE, (long)click);
- if (hit) return(hit);
-
- for (cnum = 0; cnum < (*hndl)->numChildren; ++cnum) {
- hit = DoTreeHitTest(GetChildHndl(hndl, cnum), click);
- if (hit) return(hit);
- }
-
- return(nil);
- }
-
-
-
- /**********************************************************************/
-
-
-
- #pragma segment File
- void DoTreeDraw(TreeObjHndl hndl, short drawType)
- {
- DoBTreeMethod(hndl, DRAWMESSAGE, drawType);
- }
-
-
-
- /**********************************************************************/
-
-
-
- #pragma segment File
- void DoTreeSelect(TreeObjHndl hndl, short selectType)
- {
- FileRecHndl frHndl;
- WindowPtr window;
-
- frHndl = mDerefRoot(GetRootHndl(hndl))->frHndl;
- BeginContent(window = (*frHndl)->fileState.window);
- DoFTreeMethod(hndl, SETSELECTMESSAGE, selectType);
- EndContent(window);
- }
-
-
-
- /**********************************************************************/
-
-
-
- #pragma segment File
- long DoTreeObjMethodClipped(TreeObjHndl hndl, short message, long data)
- {
- FileRecHndl frHndl;
- WindowPtr window;
- long val;
-
- frHndl = mDerefRoot(GetRootHndl(hndl))->frHndl;
- BeginContent(window = (*frHndl)->fileState.window);
-
- val = DoTreeObjMethod(hndl, message, data);
-
- EndContent(window);
-
- return(val);
- }
-
-
-
-