Appendix A: System Routines — Windows
1175
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
WinHome
Declaration:
void
WinHome
(WINDOW *
w
)
Category(ies):
Windows
Description:
Move the pen location for a window to the home position. Note that in
WF_TTY mode this is (1, 1) otherwise it is (0, 0).
Inputs:
w
— WINDOW struct of a previously opened window.
Outputs:
None
Assumptions:
None
Side Effects:
None
Availability:
All versions of the TI
-
89 / TI
-
92 Plus.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also: WinMoveTo
Example:
This example handles simple TTY type input. It assumes
appW
has
already been opened in TTY mode.
WORD Key, x, y;
SCR_RECT scrRect, tempRect;
WinAttr( &appW, A_REPLACE );
WinFont( &appW, F_6x8 );
do {
x = appW.CurX; y = appW.CurY;
ClientToScr( &appW.Client, MakeScrRect(x,y,x+5,y+7,&tempRect), &scrRect );
Key = GKeyIn( &scrRect, 0 );
if (Key <= 0xFF)
WinChar( &appW, Key );
else switch (Key) {
case KB_BEGIN: /* 2nd LEFT */
WinHome( &appW ); break;
case KB_LEFT:
WinMoveRel( &appW, -6, 0 ); break;
case KB_RIGHT:
WinMoveRel( &appW, 6, 0 ); break;
case KB_UP:
WinMoveRel( &appW, 0, -8 ); break;
case KB_DOWN:
WinMoveRel( &appW, 0, 8 ); break;
}
} while (Key != KB_ESC);
WinClr( &appW );