Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Advanced Color Imaging Reference /
Chapter 2 - Color Picker Manager Reference /
Constants and Data Types


Item Hit Structure

A color picker responds to the kItemHit request code by handling the event described in an ItemHitData structure. Your color picker also uses this structure to return information about any event handling it performs.

typedef struct ItemHitData {
   short          itemHit;    /* item receiving event */
   ItemModifier   iMod;       /* type of event */
   PickerAction   action;     /* color picker's action */
   ColorChangedProccolorProc; /* color-changed function */
   long           colorProcData;/* data for color-changed 
                                    function */
   Point          where;      /* mouse location */
} ItemHitData;
Field Description
itemHit
The item receiving the event.
iMod
The action involving the item. These actions are represented by the following enumeration, which is described in greater detail in "Item Hit Modifiers" (page 2-7):
               enum ItemHitModifiers {
                kMouseDown,/* mouse-down event on item */
                kKeyDown,  /* key-down event in current edit
                              item */
                kFieldEntered,/* tab into an edit field  */
                kFieldLeft,/* tab out of an edit field */
                kCutOp,    /* cut in current edit field */
                kCopyOp,   /* copy in current edit field */
                kPasteOp,  /* paste in current edit field */
                kClearOp,  /* clear in current edit field */
                kUndoOp    /* undo in current edit field */
               };
               typedef short ItemModifier;
action
The nature of the event. In this field, your color picker returns a value, defined in the PickerAction enumeration (page 2-5), describing the event.
               enum PickerAction {
                kDidNothing,  /* no action worth reporting */
                kColorChanged,/* user chose different color */
                kOkHit,       /* user clicked OK */
                kCancelHit,   /* user clicked Cancel */
                kNewPickerChosen,
                              /* user chose new color picker */
                kApplItemHit  /* Dialog Manager returned an 
                                 item in an application-owned 
                                 dialog box */
               };
               typedef short PickerAction;
colorProc
A pointer to an application-defined function (page 2-58) to handle color changes. This function should support the updating of colors in a document as the user selects them. Your color picker should call this function.
colorProcData
A long integer that your color picker passes to the application-defined function supplied in the colorProc field.
where
Location, in coordinates local to the dialog box, of the mouse.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996