![]() |
ColorPickerInfo |
Header: ColorPicker.h |
struct ColorPickerInfo { PMColor theColor; CMProfileHandle dstProfile; UInt32 flags; DialogPlacementSpec placeWhere; Point dialogOrigin; OSType pickerType; UserEventUPP eventProc; ColorChangedUPP colorProc; UInt32 colorProcData; Str255 prompt; PickerMenuItemInfo mInfo; Boolean newColorChosen; SInt8 filler; };
A PMColor structure. The color that your application supplies in this field is passed to the color picker for editing. This becomes the original color for the color picker. After the user clicks either the OK or Cancel button to close the dialog box, this field contains the new color, that is, the color last chosen by the user. Although the new colors selected by the user may vary widely, the original color remains fixed for comparison.
A handle to a ColorSync 1.0 profile for the final output device. To use the default system profile, set this field to NULL.
Bits representing the color picker flags, which are described in detail in
A specification for where to position the dialog box. Your application uses one of the following constants (described in
The point, in global coordinates, at which to locate the upper-left corner of the dialog box. This origin point is used only if your application supplies the kAtSpecifiedOrigin specifier in the placeWhere field.
The component subtype of the initial color picker. If your application sets this field to 0, the default color picker is used (that is, the last color picker chosen by the user). When PickColor returns, this field contains the component subtype of the color picker that was chosen when the user closed the color picker dialog box.
A pointer to an application-defined event filter function for handling user events meant for your application. If your filter function returns true, the Color Picker Manager will not process the event any further. If your filter function returns false, the Color Picker Manager handles the event as if it were meant for the color picker. The event filter function you can supply here is described in UserEventProcPtr.
A pointer to an application-defined function to handle color changes. This function, described in ColorChangedProcPtr, should support the updating of colors in a document as the user selects them.
A long integer that the Color Picker Manager passes to the application-defined function supplied in the colorProc field. Your application-defined function can use this value for any purpose it needs.
A text string prompting the user to choose a color for a particular use (for example, Choose a highlight color:).
A PickerMenuItemInfo structure. This structure allows your application to specify your Edit menu for use when a color picker dialog box is displayed.
True if the user chose a color and clicked the OK button, and false if the user clicked Cancel.
When your application calls the PickColor function to display a standard color picker dialog box, your application uses a color picker parameter block to specify information to and obtain information from the Color Picker Manager. The color picker parameter block is defined by the ColorPickerInfo data type.
This version of the Color Picker Manager uses ColorSync 1.0 profiles only. The ColorSync 1.0 profile is a handle-based profile. The profile format is defined by Apple Computer. You cannot use version 2.0 profiles, which are identified by profile references, with this version of the Color Picker Manager. ColorSync 1.0 profiles typically reside in the ColorSyncTM Profiles folder (within the Preferences folder of the System Folder). They may also be embedded with the images to which they pertain in graphics files.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)