Appendix A: System Routines — Windows
1161
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
WinChar
Declaration:
void
WinChar
(WINDOW *
w
, char
c
)
Category(ies):
Windows
Description:
Write a character to a window at the current pen position (pixel based)
using the current attribute (set with
WinAttr
) and current font (
WinFont
). If
the window is in WF_TTY mode the current X, Y location is updated; and
newline (‘\r’ or ‘\n’) and form feed (‘\f’) characters are handled.
Inputs:
w
— WINDOW struct of a previously opened window.
c
— Character to draw to window.
Outputs:
None
Assumptions:
The default attribute (A_NORMAL) can be changed with
WinAttr
; the
default font (F_6x8) can be changed with
WinFont
; the current window
position is set with
WinMoveTo
or
WinMoveRel
.
The supported values for character attributes are: A_NORMAL,
A_REVERSE, A_XOR, A_SHADED, A_REPLACE. See
WinAttr
for a
detailed description of the character attributes.
Side Effects:
None
Availability:
All versions of the TI
-
89 / TI
-
92 Plus.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: WinAttr, WinFont, WinOpen, WinCharXY, WinMoveTo, WinMoveRel,
WinStr, WinStrXY
Example:
WINDOW wTTY;
if (WinOpen( &wTTY, MakeWinRect(10,10,90,90), WF_TTY)) {
WinActivate( &wTTY );
WinChar( &wTTY, '\f' ); /* same as WinClr( &wTTY ); */
WinFont( &wTTY, F_8x10 );
WinChar( &wTTY, LF_LE );
WinAttr( &wTTY, A_REVERSE );
WinChar( &wTTY, '\n' ); /* newline */
WinChar( &wTTY, '2' );
WinMoveTo( &wTTY, 20, 20 ); /* move to specific location */
WinAttr( &wTTY, A_REPLACE );
WinChar( &wTTY, 'X' );
ngetchx();
WinMoveRel( &wTTY, -8, 0 ); /* backup one char */
WinAttr( &wTTY, A_XOR ); /* XOR mode */
WinChar( &wTTY, 'X'); /* wipe out previous char */
ngetchx();
WinClose( &wTTY );
}