TABLE OF CONTENTS getcolor.gadget/--datasheet-- getcolor.gadget/GCOLOR_REQUEST getcolor.gadget/GETCOLOR_GetClass getcolor.gadget/--datasheet-- getcolor.gadget/--datasheet-- NAME getcolor.gadget -- Create getcolor BOOPSI objects SUPERCLASS gadgetclass REQUIRES window.class, button.gadget, layout.gadget, slider.gadget, colorwheel.gadget, gradientslider.gadget, space.gadget, radiobutton.gadget, bevel.image, label.image DESCRIPTION The getcolor gadget class is used to define and select colors from a standard color requester in an easy and consistent way. It consists of a button gadget that is used to open the color requester and show the result (the currently selected color). PROGRAMMING STYLE This class provides several attributes allowing to override the user's global choices for the color requester contents and layout. However, it is not recommended to do so without a good reason. Good reasons may include the necessity of keeping the requester size as small as possible, or other special requirements of your application which make it necessary to filter out some of the possible options. If you really need to do this, try to offer the user the ability to switch off such limitations. For normal applications, no attributes should ever be set other than GETCOLOR_TitleText, GETCOLOR_Screen and those affecting the current color value such as GETCOLOR_Color or the various 32-bit variants thereof. METHODS OM_NEW -- Passed to superclass, defaults set, then OM_SET. OM_SET -- Passed to superclass, custom tags set. OM_GET -- Custom tag returned or passed to superclass. OM_UPDATE -- Passed to superclass, options set then rendered. OM_DISPOSE -- Disposes private data then passed to superclass. GM_RENDER -- Passed to superclass, then rendered. GM_HITTEST -- Overrides superclass, returns GMR_GADGETHIT if within the button. GM_HELPTEST -- Overrides superclass, returns GMR_HELPHIT if within the domain of the gadget. GM_GOACTIVE -- Passed to superclass, passed to button. GM_HANDLEINPUT -- Overrides superclass, all input processed. GM_GOINACTIVE -- Passed to superclass, button deactivated. GM_DOMAIN -- Returns GDOMAIN_MINIMUM, GDOMAIN_NOMINAL and GDOMAIN_MAXIMUM dimensions. GM_LAYOUT -- Calculate relative gadget coordinates. GM_EXTENT -- Reports gadget rendering extent. GM_CLIPRECT -- Installs ClipRect for virtual group support. GM_KEYGOACTIVE -- Handle keyboard activation. (V53.2) GM_KEYGOINACTIVE -- Handle keyboard deactivation. (V53.2) GCOLOR_REQUEST -- Invokes the color requester. ATTRIBUTES GA_ID (uint16) Unique ID number for the gadget. Defaults to 0. Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY) GA_Disabled (BOOL) Set to TRUE to disable gadget, FALSE otherwise. Defaults to FALSE. Applicability is (OM_NEW, OM_SET, OM_GET) GA_TextAttr (struct TextAttr *) Font to use for the gadget text. Defaults to the screen's font. Applicability is (OM_NEW, OM_SET, OM_GET) GA_BackFill (struct Hook *) A layer backfill hook to provide a more complex background pattern. See InstallLayerHook() for more details about the backfill hook. Defaults to NULL. Applicability is (OM_NEW, OM_SET) GA_HintInfo (CONST_STRPTR) Specify the text to use as the hint info for this gadget. You can change this attribute at any time, and it will over- ride any text specified in the windows HintInfo array. See window.class autodoc for more information. Defaults to NULL. Applicability is (OM_NEW, OM_SET). GETCOLOR_TitleText (CONST_STRPTR) Title of the color requester. Defaults to "Color" (localized). Applicability is (OM_NEW, OM_SET) GETCOLOR_Screen (struct Screen *) Screen for allocation of needed pens for the display. This MUST be provided and MUST remain open until after the gadget has been disposed. Applicability is (OM_NEW, OM_SET, OM_GET) GETCOLOR_Color (uint32) Current color value, expressed as a 0x00RRGGBB longword. Defaults to 0 (black). Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY) GETCOLOR_Red (uint32) Red component of the current color, expressed as a 32-bit left-justified fraction. Defaults to 0 (no red). Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY) GETCOLOR_Green (uint32) Green component of the current color, expressed as a 32-bit left-justified fraction. Defaults to 0 (no green). Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY) GETCOLOR_Blue (uint32) Blue component of the current color, expressed as a 32-bit left-justified fraction. Defaults to 0 (no blue). Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY) GETCOLOR_Hue (uint32) Hue value of the current color, expressed as a 32-bit left-justified fraction. Defaults to 0 (full red). Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY) GETCOLOR_Saturation (uint32) Saturation value of the current color, expressed as a 32-bit left-justified fraction. Defaults to 0 (no saturation). Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY) GETCOLOR_Brightness (uint32) Brightness value of the current color, expressed as a 32-bit left-justified fraction. Defaults to 0L (full darkness). Applicability is (OM_NEW, OM_SET, OM_GET, OM_NOTIFY) GETCOLOR_RGB (struct ColorWheelRGB *) RGB components of the current color, expressed as 32-bit left-justified fractions, set or get with a single operation. Defaults to 0/0/0 (black). Applicability is (OM_NEW, OM_SET, OM_GET) GETCOLOR_HSB (struct ColorWheelHSB *) HSB values of the current color, expressed as 32-bit left-justified fractions, set or get with a single operation. Defaults to 0/0/0 (black). Applicability is (OM_NEW, OM_SET, OM_GET) GETCOLOR_ColorWheel (BOOL) If TRUE, the color requester will include a color wheel and a gradient slider. Defaults to TRUE. Applicability is (OM_NEW, OM_SET) GETCOLOR_RGBSliders (BOOL) If TRUE, the color requester will include sliders to select the red/green/blue color components. Defaults to TRUE. Applicability is (OM_NEW, OM_SET) GETCOLOR_HSBSliders (BOOL) If TRUE, the color requester will include sliders to select the hue/saturation/brightness color values. Defaults to FALSE. Applicability is (OM_NEW, OM_SET) GETCOLOR_SwitchMode (BOOL) If TRUE, the user will be able to switch between RGB and HSB sliders in the color requester, rather than having both sets displayed at the same time (to save space). Setting this automatically implies TRUE for the two previous attributes. Defaults to TRUE. Applicability is (OM_NEW, OM_SET) GETCOLOR_Initial (uint16) Which set of sliders will be displayed initially, if GETCOLOR_SwitchMode is TRUE (0 == RGB, 1 == HSB). Defaults to 0 (RGB). Applicability is (OM_NEW, OM_SET) GETCOLOR_ShowRGB (BOOL) If TRUE, the color requester will include display boxes showing the current red/green/blue amounts. Defaults to FALSE. Applicability is (OM_NEW, OM_SET) GETCOLOR_ShowHSB (BOOL) If TRUE, the color requester will include display boxes showing the current hue/saturation/brightness amounts. Defaults to FALSE. Applicability is (OM_NEW, OM_SET) GETCOLOR_SmallTextAttr (struct TextAttr *) Font to use for the RGB/HSB display boxes; it should be as small as possible (while still being readable) to avoid making the color requester too large. Defaults to the current user-selected "small font" for GUI prefs or to the normal gadget font if no "small font" is defined for the screen. Applicability is (OM_NEW, OM_SET) getcolor.gadget/GCOLOR_REQUEST getcolor.gadget/GCOLOR_REQUEST NAME GCOLOR_REQUEST -- Invokes the color requester. SYNOPSIS uint32 result = IDoMethodA(APTR obj, struct gcRequest* msg); FUNCTION Opens the color requester and blocks the given window. When the user has finished making adjustments the selection details are sent via the OM_NOTIFY mechanism. All the attributes marked with OM_NOTIFY are sent to the receiver. INPUTS obj - getcolor object pointer msg - pointer to fully initialized struct gcRequest (see ) RESULT Returns non-zero if successful or 0 on error. getcolor.gadget/GETCOLOR_GetClass getcolor.gadget/GETCOLOR_GetClass NAME GETCOLOR_GetClass -- Gets pointer to the getcolor class. SYNOPSIS Class * class = GETCOLOR_GetClass(); FUNCTION This function is deprecated as of V52. Use the "getcolor.gadget" public class ID instead. RESULT class - Pointer to the getcolor class.