home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Programming / MR_Classes / Dev / Docs / tcpalette_gc.doc < prev   
Encoding:
Text File  |  2000-08-04  |  6.2 KB  |  188 lines

  1. TABLE OF CONTENTS
  2.  
  3. /
  4. tcpalette.gc/--datasheet--
  5. /                                                                           /
  6.  
  7.    To Do
  8.        * Add TCPALETTE_PenNameArray (UBYTE **) Make paletter gadget look
  9.          like gadget in Palette Prefs
  10.            May need scroller ?
  11.  
  12. tcpalette.gc/--datasheet--                         tcpalette.gc/--datasheet--
  13.  
  14.    NAME
  15.        tcpalette.gadget -- True color palette BOOPSI gadget
  16.  
  17.    SUPERCLASS
  18.        gadgetclass
  19.  
  20.    REQUIRES
  21.        mlr_ordered.pattern
  22.        bevel.image
  23.  
  24.    DESCRIPTION
  25.        This class provides a gadget similar to the palette.gadget
  26.        and the GadTools palette gadget.  Key difference is that
  27.        this gadget provides more than just a "pick a color" user interface.
  28.        Instead of suppling a pen index, this gadget requires color values
  29.        This gadget also provides tags that make it easy to change the 
  30.        colors of the palette and integrate this object with other 
  31.        gadgets using a model.
  32.  
  33.    METHODS
  34.  
  35.        OM_NEW -- Create the palette gadget, calls OM_SET.  Passed to
  36.            superclass.
  37.  
  38.        OM_SET -- Set object attributes.  Passed to superclass first.
  39.  
  40.        OM_GET -- Get object attributes.
  41.  
  42.        OM_NOTIFY -- Notify connections of attribute changes.
  43.  
  44.        OM_DISPOSE -- Frees resources and calls superclass.
  45.  
  46.        OM_UPDATE -- Calls OM_SET.
  47.  
  48.        GM_DOMAIN -- Return the maximum and minimum size of the gadget.
  49.  
  50.        GM_RENDER -- Renders the gadget imagry.  Overrides the superclass.
  51.  
  52.        GM_GOACTIVE -- Activate the gadget on mouse click only.  Overrides
  53.            the superclass.
  54.  
  55.        GM_HANDLEINPUT -- Handles input events once active.  Overrides the
  56.            superclass.
  57.  
  58.        GM_GOINACTIVE -- Deactivates the gadget.  Passed to the superclass.
  59.  
  60.        GM_LAYOUT -- On initial layout, this object sends out OM_NOTIFY
  61.  
  62.        All other methods are passed to the superclass.
  63.  
  64.  
  65.    ATTRIBUTES
  66.        TCPALETTE_ShowSelected (BOOL)
  67.            Keeps the selected pen highlighted when user input ends.
  68.  
  69.            Defaults to TRUE
  70.  
  71.            Applicability is (OM_NEW, OM_SET, OM_GET)
  72.  
  73.        TCPALETTE_SelectedColor (UBYTE) [0..255]
  74.            Selected color
  75.  
  76.            Defaults to 0
  77.  
  78.            Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
  79.  
  80.        TCPALETTE_SelectedRGB (struct TCPaletteRGB *)
  81.            32bit per component, Red, Green & Blue value of the selected color
  82. .
  83.  
  84.            Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
  85.  
  86.        TCPALETTE_SelectedLRGB (struct TCPaletteLRGB *)
  87.            8bit  per component Red, Green & Blue value of the selected color.
  88.            This color format is packed into a ULONG in this format 0x00rrggbb
  89.  
  90.            Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
  91.  
  92.        TCPALETTE_Precision (ULONG) [1..32]
  93.            Bit depth of component colors, only effects the values of the 
  94.            following three tags.  This was implemented because some gadgets
  95.            cannot handle full 32bit numbers, specifically the slider.gadget.
  96.  
  97.            Defaults to 8
  98.  
  99.            Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
  100.    
  101.        TCPALETTE_SelectedRed (ULONG)
  102.        TCPALETTE_SelectedGreen (ULONG)
  103.        TCPALETTE_SelectedBlue (ULONG)
  104.            Component level of the selected color.  The value of these 
  105.            attributes is dependant on the TCPALETTE_Precision attribute.
  106.            Setting TCPALETTE_Precision to 8, will yield a range from 0-255;
  107.            4 = 0-15
  108.  
  109.            Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
  110.  
  111.        TCPALETTE_NumColors (ULONG) [1..256]
  112.            Number of colors in the palette.
  113.  
  114.            Defaults to 1
  115.  
  116.            Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
  117.  
  118.        TCPALETTE_RGBPalette (struct TCPaletteRGB *)
  119.            Palette data, you provide an array, with at leaset
  120.            TCPALETTE_NumColors entries.  If your array is to
  121.            small, bad things will happen (especially with OM_GET).
  122.  
  123.            Defaults to all entries 0,0,0
  124.  
  125.            Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
  126.  
  127.        TCPALETTE_LRGBPalette (struct TCPaletteLRGB * or ULONG *)
  128.            Palette data, you provide an array, with at leaset
  129.            TCPALETTE_NumColors entries.  If your array is to
  130.            small, bad things will happen (especially with OM_GET).
  131.  
  132.            Defaults to all entries 0
  133.  
  134.            Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET)
  135.  
  136.        TCPALETTE_Orientation
  137.            Restrict layout to horizontal or vertical.
  138.            Not yet implemented.
  139.  
  140.        TCPALETTE_EditMode (ULONG)
  141.            TCPEM_NORMAL - 
  142.            TCPEM_COPY - The color of the current selected pen will
  143.              be copied to the pen the user selects next.
  144.            TCPEM_SWAP - The color of the current selected pen will
  145.              be swaped with the pen the user selects next.
  146.            TCPEN_SPREAD - The color of the current selected pen will
  147.              be spread to the pen the user selects next.
  148.  
  149.            Applicability is (OM_NEW, OM_SET, OM_UPDATE, OM_GET, OM_NOTIFY)
  150.  
  151.        TCPALETTE_Undo 
  152.            Undo changes to palette, this should be a method.
  153.            
  154.            Applicability is (OM_SET, OM_UPDATE)
  155.  
  156.        TCPALETTE_NoUndo 
  157.            If zero the undo buffer has data in it.
  158.            (so it's mappable to GA_Disabled, ie. disable UNDO gadget)
  159.  
  160.            Applicability is (OM_GET, OM_NOTIFY)
  161.  
  162.    NOTIFICATION
  163.        These tags are supplied during notification.
  164.        TCPALETTE_SelectedColor (UBYTE) [0..255]
  165.        TCPALETTE_SelectedRGB (struct TCPaletteRGB *)
  166.        TCPALETTE_SelectedLRGB (struct TCPaletteRGB *)
  167.        TCPALETTE_SelectedRed (ULONG)
  168.        TCPALETTE_SelectedGreen (ULONG)
  169.        TCPALETTE_SelectedBlue (ULONG)
  170.        TCPALETTE_NumColors (ULONG) [1..256]
  171.        TCPALETTE_EditMode
  172.        TCPALETTE_NoUndo (ULONG)
  173.  
  174.    NOTES
  175.        On true color CyberGfx displays, this gadgets renders true colors.
  176.        On 8bit or less displays, this gadget uses FindColor() to display
  177.        colors, which means that the gadget may become visually corrupt
  178.        when other programs change the screen colors.  So you may what to
  179.        rerender the object periodically.
  180.  
  181.  
  182.    BUGS
  183.        Gadget may become visually corrupt when screen colors change on
  184.        8 bit or less screens.
  185.  
  186.    SEE ALSO
  187.  
  188.