home *** CD-ROM | disk | FTP | other *** search
- TABLE OF CONTENTS
-
- /
- tcpalette.gc/--datasheet--
- / /
-
- To Do
- * Add TCPALETTE_PenNameArray (UBYTE **) Make paletter gadget look
- like gadget in Palette Prefs
- May need scroller ?
-
- tcpalette.gc/--datasheet-- tcpalette.gc/--datasheet--
-
- NAME
- tcpalette.gadget -- True color palette BOOPSI gadget
-
- SUPERCLASS
- gadgetclass
-
- REQUIRES
- mlr_ordered.pattern
- bevel.image
-
- DESCRIPTION
- This class provides a gadget similar to the palette.gadget
- and the GadTools palette gadget. Key difference is that
- this gadget provides more than just a "pick a color" user interface.
- Instead of suppling a pen index, this gadget requires color values
- This gadget also provides tags that make it easy to change the
- colors of the palette and integrate this object with other
- gadgets using a model.
-
- METHODS
-
- OM_NEW -- Create the palette gadget, calls OM_SET. Passed to
- superclass.
-
- OM_SET -- Set object attributes. Passed to superclass first.
-
- OM_GET -- Get object attributes.
-
- OM_NOTIFY -- Notify connections of attribute changes.
-
- OM_DISPOSE -- Frees resources and calls superclass.
-
- OM_UPDATE -- Calls OM_SET.
-
- GM_DOMAIN -- Return the maximum and minimum size of the gadget.
-
- GM_RENDER -- Renders the gadget imagry. Overrides the superclass.
-
- GM_GOACTIVE -- Activate the gadget on mouse click only. Overrides
- the superclass.
-
- GM_HANDLEINPUT -- Handles input events once active. Overrides the
- superclass.
-
- GM_GOINACTIVE -- Deactivates the gadget. Passed to the superclass.
-
- GM_LAYOUT -- On initial layout, this object sends out OM_NOTIFY
-
- All other methods are passed to the superclass.
-
-
- ATTRIBUTES
- TCPALETTE_ShowSelected (BOOL)
- Keeps the selected pen highlighted when user input ends.
-
- Defaults to TRUE
-
- Applicability is (OM_NEW, OM_SET, OM_GET)
-
- TCPALETTE_SelectedColor (UBYTE) [0..255]
- Selected color
-
- Defaults to 0
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
-
- TCPALETTE_SelectedRGB (struct TCPaletteRGB *)
- 32bit per component, Red, Green & Blue value of the selected color
- .
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
-
- TCPALETTE_SelectedLRGB (struct TCPaletteLRGB *)
- 8bit per component Red, Green & Blue value of the selected color.
- This color format is packed into a ULONG in this format 0x00rrggbb
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
-
- TCPALETTE_Precision (ULONG) [1..32]
- Bit depth of component colors, only effects the values of the
- following three tags. This was implemented because some gadgets
- cannot handle full 32bit numbers, specifically the slider.gadget.
-
- Defaults to 8
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
-
- TCPALETTE_SelectedRed (ULONG)
- TCPALETTE_SelectedGreen (ULONG)
- TCPALETTE_SelectedBlue (ULONG)
- Component level of the selected color. The value of these
- attributes is dependant on the TCPALETTE_Precision attribute.
- Setting TCPALETTE_Precision to 8, will yield a range from 0-255;
- 4 = 0-15
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
-
- TCPALETTE_NumColors (ULONG) [1..256]
- Number of colors in the palette.
-
- Defaults to 1
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
-
- TCPALETTE_RGBPalette (struct TCPaletteRGB *)
- Palette data, you provide an array, with at leaset
- TCPALETTE_NumColors entries. If your array is to
- small, bad things will happen (especially with OM_GET).
-
- Defaults to all entries 0,0,0
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
-
- TCPALETTE_LRGBPalette (struct TCPaletteLRGB * or ULONG *)
- Palette data, you provide an array, with at leaset
- TCPALETTE_NumColors entries. If your array is to
- small, bad things will happen (especially with OM_GET).
-
- Defaults to all entries 0
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
-
- TCPALETTE_Orientation
- Restrict layout to horizontal or vertical.
- Not yet implemented.
-
- TCPALETTE_EditMode (ULONG)
- TCPEM_NORMAL -
- TCPEM_COPY - The color of the current selected pen will
- be copied to the pen the user selects next.
- TCPEM_SWAP - The color of the current selected pen will
- be swaped with the pen the user selects next.
- TCPEN_SPREAD - The color of the current selected pen will
- be spread to the pen the user selects next.
-
- Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
-
- TCPALETTE_Undo
- Undo changes to palette, this should be a method.
-
- Applicability is (OM_SET, OM_UPDATE)
-
- TCPALETTE_NoUndo
- If zero the undo buffer has data in it.
- (so it's mappable to GA_Disabled, ie. disable UNDO gadget)
-
- Applicability is (OM_GET, OM_NOTIFY)
-
- NOTIFICATION
- These tags are supplied during notification.
- TCPALETTE_SelectedColor (UBYTE) [0..255]
- TCPALETTE_SelectedRGB (struct TCPaletteRGB *)
- TCPALETTE_SelectedLRGB (struct TCPaletteRGB *)
- TCPALETTE_SelectedRed (ULONG)
- TCPALETTE_SelectedGreen (ULONG)
- TCPALETTE_SelectedBlue (ULONG)
- TCPALETTE_NumColors (ULONG) [1..256]
- TCPALETTE_EditMode
- TCPALETTE_NoUndo (ULONG)
-
- NOTES
- On true color CyberGfx displays, this gadgets renders true colors.
- On 8bit or less displays, this gadget uses FindColor() to display
- colors, which means that the gadget may become visually corrupt
- when other programs change the screen colors. So you may what to
- rerender the object periodically.
-
-
- BUGS
- Gadget may become visually corrupt when screen colors change on
- 8 bit or less screens.
-
- SEE ALSO
-
-