home *** CD-ROM | disk | FTP | other *** search
- /*
- * File: CItem.h
- * Created: 7/25/93
- * Desc: An item that can be displayed in an ItemTable Pane.
- * The item keeps a reference to its parent (the root
- * objects parent is NULL), and a reference to each
- * of its children (subItems).
- *
- * Superclass: CObject.
- * Uses: <NONE>.
- * Original Author: Atul Barve
- * Modifications: W. Wesley Monroe
- *
- * Copyright © 1993 Animas Software Production. All rights reserved.
- */
-
- #pragma once
-
- class CItem : public CObject {
-
- short fCanExpand;
- short fCloseIconID;
- short fInterimIconID;
- short fOpenIconID;
- short fIconID;
-
- short fExpanded;
- CList *fSubItems;
- CItem *fParent;
- short fLevel;
-
- protected:
- char *fText;
-
- public:
-
- void IItem(void);
- virtual void INewRootItem(short canExpand, short iconID, short expanded,
- StringPtr text);
- virtual void Dispose(void);
-
- virtual void RemoveSubItem(CItem *child);
- virtual void AppendSubItem(CItem *item);
- virtual void GraftSubItem(CItem *item);
- virtual void SetNthSubItem(CItem *item, short n);
- virtual CItem *GetNthSubItem(short n);
-
- Boolean CanAccept(CList *selectedItems);
-
- // Methods for getting and setting instance variables.
- void GetDisplayText(char *text);
- CItem *GetParent(void);
- short GetLevel(void);
- short GetCanExpand(void);
- short GetIconID(void);
- short GetExpanded(void);
- void SetDisplayText(char *text);
- void SetParent(CItem *parent);
- void SetLevel(short level);
- void SetCanExpand(short flag);
- void SetIconID(short id);
- void SetExpanded(short flag);
- short GetNumSubItems(void);
-
- virtual void ReAllocSubItems(void);
- virtual CItem *CopyItem(Boolean copySubItems);
-
- virtual void GetExtraItemData(Ptr *data);
-
- // methods relating to the expando icon's
- void SetCloseIconID(short id);
- void SetOpenIconID(short id);
- void SetInterimIconID(short id);
-
- short GetCloseIconID(void);
- short GetOpenIconID(void);
- short GetInterimIconID(void);
-
- // Build the items tree into data....
- virtual void BuildExtraItemData(Handle data);
- virtual void BuildRes(Handle data);
-
- };
-
- typedef struct tItem {
- short canExpand; // may not be necessary?
- short expanded;
- short iconID;
- short unused1;
- short unused2;
- char text[];
- } tItem;
-