Steve,
At 12:00am -0700 00-05-06, Palm Developer Forum digest wrote:
>Subject: color fields...NOT
>From: "Stephen Bentley" <[EMAIL PROTECTED]>
>Date: Fri, 5 May 2000 17:20:00 -0400
>X-Message-Number: 56
>
>Howdy. I have a program chock full of FldDrawField calls. I'd like to draw
>the fields in color (if avail). WinSetTextColor and WinSetForeColor have no
>effect and I
>can find no new Fld-related call to do this. Do I have to convert all of my
>FldDrawFields to WinDrawChars? If so I'll lose all of my word wrapping,
>etc.
1. There's no API for setting the field colors directly. They use the
UIFieldxxx colors enumerated in UIColor.h. I guess you could change
the UI colors on the fly, but that sounds risky.
2. If you just need to draw static multi-line text in color, the
routine to wrap/draw it is pretty simple. Something like (danger -
uncompiled code)
void TextBox(const Char* iText, const RectangleType* iBounds)
{
Coord curY = iBounds->topLeft.y;
while (*iText) {
UInt16 bytesThatFit = FntWordWrap(iText, iBounds->extent.x);
WinDrawChars(iText, bytesThatFit, iBounds->topLeft.x, curY);
curY += FntLineHeight();
iText += bytesThatFit;
}
}
-- Ken
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/