>On the IIIc emulator, the form background is always white.
>What's the best/correct way to set the form background to
>black and text to color.
Here is what I do. After some various experiments, it seems to be the best.
if (OS >= version35) {
WinHandle win;
WinScreenMode (winScreenModeGet, NULL, NULL, NULL, &hasColor);
if (hasColor) {
win = FrmGetWindowHandle (FrmGetActiveForm());
WinSetDrawWindow(win);
UIColorGetTableEntryRGB(UIFormFill, &oldRGB);
UIColorSetTableEntry (UIFormFill, &newRGB);
}
}
FrmDrawForm (FrmGetActiveForm());
if (OS >= version35 && hasColor) {
UIColorSetTableEntry (UIFormFill, &oldRGB);
}
newRGB should be initialized to the background color you want to set. You can do the
same thing with the foreground color and/or the text color. In OS 3.5, the entire form
is drawn with the background color before anything else happens.
If you want to do this on a black and white device also, remove the "if (hasColor)"
line. However, this will only work on OS 3.5. I imagine on a pre-OS 3.5 device, you
will have to swap the fore and back colors, then do an erase rectangle before drawing.
Shannon
>If color text on black background can be done, what the
>best/correct way to keep compatibility with other (black
>and white) devices?
>
>Thanks
>horace
>
>
>--
>For information on using the Palm Developer Forums, or to unsubscribe, please see
>http://www.palm.com/devzone/mailinglists.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hands High Software
Award winning software for the Palm(tm) Computing platform
<http://www.handshigh.com/>
[EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html