> > Then what is the point of the rectangle we pass? Aaron suggested
> > setting the clipping region before calling WinDrawChars... but shouldn't
> > that be part of what WinDrawChars does?
>
> WinDrawChars does not get a rectangle, it gets an X and Y coordinate that
> tells it where to start drawing:
>
> void WinDrawChars( const Char *chars, Int16 len, Coord x, Coord y )
exactly.. ok.. try this guys..
---
{
FormType *frm;
RectangleType rect;
Int16 count;
// get the active form
frm = FrmGetActiveForm();
// get the bounds of our 'object'
FrmGetObjectBounds(frm,
FrmGetObjectIndex(frm, formResourceID), &rect);
// lets adjust the rectangle a bit (dont want to override border)
rect.topLeft.x++;
rect.topLeft.y++;
rect.extent.x -= 2;
rect.extent.y -= 2; // NOTE: do whatever you need here :P
// lets set the clipping region
WinSetClip(&rect);
// how many characters do we draw
#ifdef WORD_WRAP
count = FntWordWrap(myString, rect.extent.x);
#else
{
Boolean truncated = false;
count = StrLen(myString);
FntCharsInWidth(myString, &rect.extent.x, &count, &truncated);
}
#endif
// draw the string
WinDrawChars(myString, count, rect.topLeft.x, rect.topLeft.y);
// lets reset the clipping region
WinResetClip();
}
---
ok.. thats my contribution to the list for the day :P the above is
code/psuedo code :P you should be able to figure out the concept
after reading it :))
if you use the Fnt* routines to determine the # of chars, you wont
need the clipping.. but it does not hurt to set the clipping, just
incase *poke* the Fnt* routines screw up :P
cheers.
az
--
Aaron Ardiri
Java Certified Programmer http://www.hig.se/~ardiri/
University-College i G�vle mailto:[EMAIL PROTECTED]
SE 801 76 G�vle SWEDEN
Tel: +46 26 64 87 38 Fax: +46 26 64 87 88
Mob: +46 70 656 1143 A/H: +46 8 668 78 72
if you enjoy it, then it aint work :) - rule #106 of life
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html