From: "Layne Lund" <[EMAIL PROTECTED]>
> values are all static in the resource file. Is there a way to set the
> column widths at run time instead? Of course, this gets into a whole
> other mess in trying to calculate the width of a string in a given
> font, but I can figure out that part later. I need to first know if
> it's even possible to set the width at run time. (Maybe I should just
>
That's actually the easy part. There are a number of good functions
for determining pixel widths and wrap breaks of text. Example:
// set drawing font
FntSetFont(g_prefs.Font);
LstGlueSetFont(GetObjectPtrFromId(frmP, MsgListMessageList), g_prefs.Font);
// Calculate widest column contents (assumes fixed width digits)
LineOneX = FntCharsWidth("00/00", 5);
I then draw the whole list myself using.
// Notify Palm OS that we will draw each list item ourselves.
pList = GetObjectPtrFromId(frmP, MsgListMessageList);
LstSetDrawFunction(pList, &ListDrawFunc);
and combinations of WinDrawChars() and
WinDrawLine(LineOneX + 1, etc to do the work. It's a bit fiddly to
set up, but gives you complete freedom to change the style of the list
and my experience is that once you're concerned with column widths
you're likely to start wanting to make all sorts of detailed changes.
Biting the bullet to go to custom drawing pays off when you're
fine-tuning the list style.
Chris Tutty
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/