home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 18 / amigaformatcd18.iso / mui / mui_developer / autodocs / mui_palette.doc < prev    next >
Text File  |  1997-03-10  |  5KB  |  155 lines

  1. TABLE OF CONTENTS
  2.  
  3. Palette.mui/Palette.mui
  4. Palette.mui/MUIA_Palette_Entries
  5. Palette.mui/MUIA_Palette_Groupable
  6. Palette.mui/MUIA_Palette_Names
  7. Palette.mui/Palette.mui
  8.  
  9.     Palette class generates a (big) group of objects, alltogether
  10.     making up a powerful palette requester. Due to the new color
  11.     selection schemes of Kickstart 3.x, you won't get a "traditional"
  12.     palette requester with 2^n fields to fill in. These things
  13.     really stop making sense on nice 256 or true color screens.
  14.  
  15.     Instead, MUI's palette class allows defining a list of colors
  16.     that the user should be able to adjust. Within a public screen
  17.     manager, this would e.g. be the DrawInfo pens for a specific
  18.     screen, within a terminal program maybe the eight ANSI colors.
  19.  
  20.     Palette class uses a listview to let the user choose the
  21.     desired color, a coloradjust object to adjust this color
  22.     and a colorfield object that always shows the current color.
  23.  
  24.     The user will also be able to concatenate several colors
  25.     in the list, defining a single color for several entries.
  26. Palette.mui/MUIA_Palette_Entries
  27.  
  28.     NAME
  29.     MUIA_Palette_Entries -- (V6 ) [I.G], struct MUI_Palette_Entry *
  30.  
  31.     FUNCTION
  32.     Specify the colors that the user should be able to adjust
  33.     with this palette object.
  34.  
  35.     You supply an array of MUI_Palette_Structures here, each
  36.     entry defining one color:
  37.  
  38.     struct MUI_Palette_Entry
  39.     {
  40.        LONG  mpe_ID;
  41.        ULONG mpe_Red;
  42.        ULONG mpe_Green;
  43.        ULONG mpe_Blue;
  44.        LONG  mpe_Group;
  45.     };
  46.  
  47.     mpe_ID   :  This entry is not used by palette class, you can
  48.                 put in whatever you want, except the value
  49.                 MUIV_Palette_Entry_End (==-1),
  50.                 which terminates the array.
  51.  
  52.     mpe_Red  :  32-bit red component of the current color. This
  53.                 field will be changed by palette class whenever
  54.                 the user edits the color.
  55.  
  56.     mpe_Green:  32-bit green component of the current color. This
  57.                 field will be changed by palette class whenever
  58.                 the user edits the color.
  59.  
  60.     mpe_Blue :  32-bit blue component of the current color. This
  61.                 field will be changed by palette class whenever
  62.                 the user edits the color.
  63.  
  64.         mpe_Group:  Entries with the same mpe_Group value are
  65.                 concatenated. Whenever a new color in the
  66.                 listview is selected, all other colors with
  67.                 the same mpe_Group get selected as well and
  68.                 get adjusted all at once.
  69.                 Entry concatenation can be changed by the user,
  70.                 as long as you don't disable this feature with 
  71.                 the MUIA_Palette_Groupable attribute.
  72.  
  73.     EXAMPLE
  74.  
  75.     static struct MUI_Palette_Entry SystemDefaultPalette[] =
  76.     {
  77.        { TEXTPEN         ,0x00000000,0x00000000,0x00000000,0 },
  78.        { SHINEPEN        ,0xffffffff,0xffffffff,0xffffffff,1 },
  79.        { SHADOWPEN       ,0x00000000,0x00000000,0x00000000,0 },
  80.        { FILLPEN         ,0x66666666,0x88888888,0xbbbbbbbb,2 },
  81.        { FILLTEXTPEN     ,0xffffffff,0xffffffff,0xffffffff,1 },
  82.        { BACKGROUNDPEN   ,0xaaaaaaaa,0xaaaaaaaa,0xaaaaaaaa,3 },
  83.        { HIGHLIGHTTEXTPEN,0xffffffff,0xffffffff,0xffffffff,1 },
  84.        { BARDETAILPEN    ,0x00000000,0x00000000,0x00000000,0 },
  85.        { BARBLOCKPEN     ,0xffffffff,0xffffffff,0xffffffff,1 },
  86.        { BARTRIMPEN      ,0x00000000,0x00000000,0x00000000,0 },
  87.        { MUIV_Palette_Entry_End,0,0,0,0 },
  88.     };
  89.  
  90.    SEE ALSO
  91.     MUIA_Palette_Names
  92. Palette.mui/MUIA_Palette_Groupable
  93.  
  94.     NAME
  95.     MUIA_Palette_Groupable -- (V6 ) [ISG], BOOL
  96.  
  97.     FUNCTION
  98.     Enables/disables palette color grouping.
  99.     Defaults to TRUE.
  100.  
  101.     SEE ALSO
  102.     MUIA_Palette_Entries
  103. Palette.mui/MUIA_Palette_Names
  104.  
  105.     NAME
  106.     MUIA_Palette_Names -- (V6 ) [ISG], char **
  107.  
  108.     FUNCTION
  109.     Specify the names of a palette objects color entries.
  110.     Without names, the color listview just displays
  111.     "Color <n>" for each entry. If you supply an array
  112.     of names here, they are displayed instead. The
  113.     names array must have as many entries as the
  114.     array of MUI_Palette_Entry structures (without
  115.     its terminator).
  116.  
  117.     EXAMPLE
  118.  
  119.     static struct MUI_Palette_Entry ColorEntries[] =
  120.     {
  121.        { TEXTPEN         ,0x00000000,0x00000000,0x00000000,2 },
  122.        { SHINEPEN        ,0xffffffff,0xffffffff,0xffffffff,4 },
  123.        { SHADOWPEN       ,0x00000000,0x00000000,0x00000000,5 },
  124.        { FILLPEN         ,0x66666666,0x88888888,0xbbbbbbbb,3 },
  125.        { FILLTEXTPEN     ,0xffffffff,0xffffffff,0xffffffff,6 },
  126.        { BACKGROUNDPEN   ,0x00000000,0x00000000,0x00000000,7 },
  127.        { HIGHLIGHTTEXTPEN,0xffffffff,0xffffffff,0xffffffff,8 },
  128.        { BARDETAILPEN    ,0x00000000,0x00000000,0x00000000,9 },
  129.        { BARBLOCKPEN     ,0xffffffff,0xffffffff,0xffffffff,1 },
  130.        { BARTRIMPEN      ,0x00000000,0x00000000,0x00000000,0 },
  131.        { MUIV_Palette_Entry_End,0,0,0,0 },
  132.     };
  133.  
  134.     static const char *ColorNames[] =
  135.     {
  136.        "Text"                ,
  137.        "Bright Edges"        ,
  138.        "Dark Edges"          ,
  139.        "Active Window Bars"  ,
  140.        "Active Window Titles",
  141.        "Background"          ,
  142.        "Important Text"      ,
  143.        "Menu Text"           ,
  144.        "Menu Background"     ,
  145.        "Menu Line"
  146.     };
  147.  
  148.     po = PaletteObject,
  149.        MUIA_Palette_Entries, ColorEntries,
  150.        MUIA_Palette_Names  , ColorNames,
  151.        End;
  152.  
  153.     SEE ALSO
  154.     MUIA_Palette_Entries
  155.