<%@ page import="java.io.BufferedReader, java.io.InputStreamReader, java.io.IOException, java.io.UnsupportedEncodingException, java.net.URL, java.net.URLEncoder" %> <%! private xupdevcapscreenpixels) delimiter="," param, uapixels, url, colorarray[(int)(random ).append(resarray[0]); string[] } } private colorarray="value.split(" colorarray.length)]); } private encodedvalue="URLEncoder.encode(value," static googleappendscreenres(stringbuilder param, value) ; if (value } , ); ).append(resarray[1]); } } % random) & % googleappendurl(stringbuilder void ).append(param).append(=").append( " (uapixels="null)" !="null)" resarray="screenRes.split(delimiter); " screenres="xUpDevcapScreenpixels; " (resarray.length="2)" pagead=" " final http://pagead2.googlesyndication.com/pagead/ads? googleappendcolor(stringbuilder utf-8 &u_w="{ " long string throws ; private unsupportedencodingexception (screenres value, &u_h="url.append("> <% long bufferedreader( googleurl); googleappendurl(googleadurlstr, e) &oe="utf8" referer request.getremoteaddr()); googleadurlstr.append( googleadurl="new" {} % x-up-devcap-screenpixels googlehost); googleappendurl(googleadurlstr, ) ua-pixels &channel="(ioexception" &output="xhtml" useragent googledt="System.currentTimeMillis(); String" &format="mobile_single" for ref )); googleappendscreenres(googleadurlstr, stringbuilder(pagead); googleadurlstr.append( (request.getquerystring() ? } } ip googleurl : out.println(line); &markup="xhtml" host request.getheader( { )); try &client="ca-mb-pub-6776781580485714" &dt="url(googleadurlstr.tostring()); " new googlehost="(request.isSecure()" , + ).append(googledt); googleadurlstr.append( ad_type="text_image" url (line="reader.readLine())" !="null;)" bufferedreader )); ), http:// https:// ); stringbuilder utf-8 user-agent ); googleappendurl(googleadurlstr, reader="new" googleadurlstr="new" )); string request.getquerystring().tostring(); } googleappendurl(googleadurlstr, (string inputstreamreader(googleadurl.openstream(), ); googleadurlstr.append( line; catch>

Monday, December 17, 2007

UIPickColor

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());

Google
 
PalmProgramming