Texas Instruments TI89 Developer Guide - Page 1205
WinCharXY, short WinStrXYWrap WINDOW *w, WIN_COORDS x, char *Str, WORD wwFlags
![]() |
UPC - 033317198566
View all Texas Instruments TI89 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 1205 highlights
Appendix A: System Routines - Windows 1163 WinCharXY (continued) Example: /* Draw a string to a window, wrapping on spaces or newlines. Return the height in pixels of the text just drawn. If wwFlags.WWF_DRAW is not set then just returns height and does not draw. Set wwFlags.WWWF_WRAP_ON_COMMAS to also wrap on commas. */ enum winWriteFlags { WWF_DRAW = 0x01, WWF_WRAP_ON_COMMAS=0x2 }; short WinStrXYWrap( WINDOW *w, WIN_COORDS x, WIN_COORDS y, char *Str, WORD wwFlags ) { char *bStr, c; short numChars, pixWid, startX, SysFontY; startX = x; SysFontY = ((w->CurFont == F_4x6) ? 6 : (w->CurFont == F_6x8 ? 8 : 10)); do { bStr = Str; numChars = 0; while (c = *bStr) { if (0xA == c) break; if (' ' == c) if (numChars) break; numChars++; if ((wwFlags & WWF_WRAP_ON_COMMAS) && ',' == c) break; bStr++; } if (numChars) { pixWid = DrawStrWidthP( Str, numChars, w->CurFont ); if (x + pixWid >= WinWidth(w)) { x = startX; y += SysFontY; if (' ' == *Str) { if (numChars) numChars--; Str++; } } while (numChars--) { c = *Str++; if (wwFlags & WWF_DRAW) WinCharXY( w, x, y, c, 1 ); x += FontCharWidth( c ); } } else { x = startX; y += SysFontY; Str++; } } while (*bStr); return y; } TI-89 / TI-92 Plus Developer Guide Not for Distribution Beta Version January 26, 2001
![](/manual_guide/products/texas-instruments-ti89-developer-guide-95b636f/1205.png)