The function is pretty straightforward, but my slide might not make sense
just on its own.  And it isn't in the docs yet, so here I'll pretend to be
a doc writer:

The first two parameters are similar to each other: they are pointers to
the index and the RGB values.  You can set either (but not both) pointers
to NULL if you want.  They're the default, starting values for the picker.

The third parameter is which mode to start in: RGB sliders or "chits": 256
small squares that you can tap upon.  Pass UIPickColorStartPalette or
...RGB.

Fourth param is the title (leave null for the default), and fifth is the
help tip ID (which is currently unused).

When the function returns, the color index and/or rgb variables you passed
a pointer to will have the user's selected data in them.  The RGB value may
be "more correct" than the index, since this function won't change the
palette and thus the user could pick an RGB value that isn't in the current
palette.  If you care, you'd want to change the palette yourself now that
you know the user wants that particular shade.

Here's a small excerpt taken from some sample code I wrote for PalmSource,
many moons ago.  (The only reason to pass &myColorindex is to allow usage
of the Palette view even though we really only care about the RGB return
value.  So they both need to be provided, with appropriate initial values.)

   UIPickColor(&myColorindex,
               &myRgb,
               UIPickColorStartPalette,
               "Pick it!",
               0);

   // change the color of field text to the chosen setting (while our app
is running)
   UIColorSetTableEntry(UIFieldText, &myRgb);

   // get everything to redraw with the new setting
   FrmDrawForm(FrmGetActiveForm());

-David Fedor
Palm Developer Support



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to