Important: The information in this document is obsolete and should not be used for new development.
Picker Actions
When your application uses theDoPickerEventfunction (page 2-44) to pass an event to a color picker for handling, your application passes the event in anEventDatastructure (page 2-26). The color picker handling the event in turn uses theactionfield of theEventDatastructure to report the nature of the event. When your application uses theDoPickerEditfunction (page 2-45), it passes information about the editing operation in anEditDatastructure (page 2-29). The color picker handling the event uses theactionfield of theEditDatastructure to report on the nature of the event.The actions reported in this field are defined by the
PickerActionenumeration.
enum PickerAction { kDidNothing, /* no action worth reporting */ kColorChanged, /* user chose a different color */ kOkHit, /* user clicked OK */ kCancelHit, /* user clicked Cancel */ kNewPickerChosen, /* user chose a new color picker */ kApplItemHit /* Dialog Manager returned an item in an application-owned dialog box */ }; typedef short PickerAction;Enumerator descriptions
kDidNothing- The user performed no action worth reporting.
kColorChanged- The user chose a different color. Your application may need to call the
GetPickerColorfunction to obtain the chosen color; how your application handles this action for its own application-owned dialog boxes depends on your application. For dialog boxes owned by the system or the color picker, your application should probably wait until the user clicks the OK button before treating the color as final.kOkHit- The user clicked the OK button in a dialog box owned by the system or the color picker. Your application should save the newly chosen color.
kCancelHit- The user clicked the Cancel button in a dialog box owned by the system or the color picker. Your application should restore the previously selected color and use the
DisposeColorPickerfunction (page 2-43) to dispose of the color picker.kNewPickerChosen- The user chose a new color picker from the More Choices list in a system-owned dialog box. Because this constant is returned only for system-owned dialog boxes, your application generally does not to respond to this action.
kApplItemHit- The Dialog Manager returned an item number for an item in an application-owned dialog box. Your application must handle the event.