Important: The information in this document is obsolete and should not be used for new development.
Editing Data Structure
If the user chooses an Edit menu command for the color picker, your application needs to set the state of the Edit menu items according to the color picker specifications and send the appropriate message to the color picker. Use theGetPickerEditMenuState
function (page 2-48) to determine the state of the Edit menu items. Then use theDoPickerEdit
function (page 2-45) to request the color picker to perform an editing operation. When your application uses theDoPickerEdit
function, it passes information about the editing operation in anEditData
structure; the color picker then uses this structure to describe if and how it performed this operation.
typedef struct EditData { EditOperation theEdit; /* the editing operation */ PickerAction action; /* action performed by picker */ Boolean handled; /* whether action was handled */ } EditData;
Field Description
theEdit
- The editing operation to perform. Your application uses the
EditOperations
enumeration to specify the operation.enum EditOperations { kCut, /* perform the Cut command */ kCopy, /* perform the Copy command */ kPaste, /* perform the Paste command */ kClear, /* perform the Clear command */ kUndo /* perform the Undo command */ }; typedef short EditOperation;
action
- The nature of the event. In this field, the Color Picker Manager returns a value, defined in the
PickerAction
enumeration, describing the event. See the description of thePickerAction
enumeration (page 2-5) for a discussion about how your application should respond to these actions.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;
handled
- A Boolean value indicating whether the color picker or the Color Picker Manager handled the event. If the Color Picker Manager returns the value
true
in this field, then the event was handled; otherwise, your application should process the event.