home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff242.lzh / PaletteReq / PaletteReq.doc < prev    next >
Text File  |  1989-08-30  |  5KB  |  107 lines

  1. /****************************************************************************
  2.  *                                                                          *
  3.  *                           Palette Requester                              *
  4.  *                                                                          *
  5.  *                   (c) Copyright 1989 Jonathan Potter                     *
  6.  *                                                                          *
  7.  * This program is freely redistributable, although all rights to it remain *
  8.  * with the author. It may be used freely in any program as long as this    *
  9.  * notice remains intact, however, if you do this, please mention the       *
  10.  * author in the program. If you wish to use this in a commercial program   *
  11.  * of any kind, you must register with a $15 donation.                      *
  12.  * Please send donations, bug reports, comments and suggestions to :        *
  13.  *                                                                          *
  14.  *                              Jonathan Potter                             *
  15.  *                              3 William Street                            *
  16.  *                              Clarence Park 5034                          *
  17.  *                              South Australia                             *
  18.  *                              Australia                                   *
  19.  *                                                                          *
  20.  *                         Ph : (08) 2932788  home                          *
  21.  *                                                                          *
  22.  ****************************************************************************/
  23.  
  24. Palette Requester provides a very easy way to set the palette of any screen.
  25.  
  26.  
  27. HOW TO USE THE PALETTE REQUESTER
  28.  
  29.  
  30. The palette requester has several gadgets to enable you to set the colours of
  31. the screen. The coloured squares at the top of the window let you select
  32. which colour you wish to work with. Underneath these is a window-wide bar,
  33. which is filled with the current colour, and displays (in hex) the value of
  34. the colour.
  35. Under this are six slider gadgets. The first three, R, G and B enable you to
  36. set the red, green and blue content of the current colour. The next three,
  37. H, S and L enable you to set the hue, saturation and luminance of the
  38. current colour.
  39. Under these are six other gadgets.
  40.   -  COPY allows you to copy the current colour to the next selected colour.
  41.   -  SPREAD allows you to evenly spread the colours between the current
  42.      colour and the next selected colour.
  43.   -  RESET allows you to reset to the palette in use when the Palette
  44.      Requester was first invoked. Also, pressing the ESCape key has this
  45.      effect, so if you accidentally set all the colours to black (or
  46.      something), just press ESCape.
  47.      Next to RESET there *MAY* be another gadget.
  48.   -  OKAY accepts the current colour settings and exits the palette requester.
  49.   -  CANCEL rejects the colour settings and exits the palette requester.
  50.      Clicking the close gadget also has this effect.
  51.  
  52.  
  53. HOW TO CALL THE PALETTE REQUESTER
  54.  
  55.  
  56. To use the palette requester, you should link with the file PaletteReq.o, and
  57. include the file PaletteReq.h, to make use of return codes.
  58. PaletteReq.o compiles like this under Aztec:
  59.  
  60.          cc +L -S PaletteReq
  61.  
  62. and under Lattice like this:
  63.  
  64.          lc PaletteReq                    (boy this is hard)
  65.  
  66. You must have intuition.library and graphics.library open before you call
  67. (in IntuitionBase and GfxBase, of course).
  68. To call the palette requester, you call the routine palette_request().
  69. palette_request() takes several parameters; these are :
  70.  
  71.          struct Window *dest_win;
  72.          int x, y;
  73.          char *hail, *user;
  74.          int depth;
  75.  
  76. dest_win is any window on the screen you wish the palette requester to appear
  77. on, or NULL if you want it to open on the Workbench screen.
  78. x, y are the x and y coordinates for the palette requester to open at, or
  79.  -1,-1 if you want the default 40,23.
  80. hail is the hailing text, or NULL if you want the default "Palette".
  81. user is the text for the user defined gadget (see below), or NULL if you
  82.  don't want one.
  83. depth is the number of bitplanes you wish the palette requester to
  84.  accomodate (from 1 to 5). The palette requester will automatically adjust to
  85.  the selected depth (which will NOT be checked against the maximum depth of
  86.  the containing screen), so the correct number of colour gadgets will appear
  87.  (properly formatted, too).
  88.  
  89. The palette requester supports one user defined gadget, which can have a
  90. name of up to fourteen characters. If a name is submitted to palette_request()
  91. for this, it is created next to the RESET gadget, otherwise the RESET gadget
  92. takes up the width of the window. If this gadget is selected, the requester
  93. will exit as if OKAY had been chosen.
  94. palette_request() returns FALSE if CANCEL was chosen, or the close gadget
  95. was clicked, TRUE if OKAY was chosen, and 5 if the user defined gadget was
  96. chosen. To interpret other return codes (errors), you should include the file
  97. PaletteReq.h.
  98. A calling example,
  99.  
  100.    palette_request(NULL,-1,-1,"Neato!","Fantastic",2);
  101.  
  102.  
  103. IS THAT ALL THERE IS TO IT?
  104.  
  105.  
  106. Yup.
  107.