Texas Instruments TI-89 Developer's Manual page 1233

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

Appendix A: System Routines — Windows
WinScrollH
(continued)
Example:
#define V_SCROLL 8
#define H_SCROLL 8
/* Display the 2D output from Parse2DExpr to a window (with defined offsets)
scrolling the output as the arrow keys are pressed. */
void View2DExpr( EStackIndex i, WINDOW *Win, SWORD x, SWORD y) {
WORD Width, Depth, Height, MaxX, MaxY, Key;
SWORD z;
WIN_RECT wr;
Parms2D( i, &Width, &Depth, &Height );
MaxX = WinWidth( Win ) - 1;
MaxY = WinHeight( Win ) - 1;
z = Width - MaxX;
wr.x0 = 0; wr.x1 = MaxX; wr.y0 = 0; wr.y1 = MaxY;
WinClr( Win );
do {
Print2DExpr( i, Win, x, y );
Key = GKeyIn( 0l, GKF_NORMAL );
switch( Key ) {
case KB_UP:
if (y < Height) {
y += V_SCROLL;
WinScrollV( Win, &wr, -V_SCROLL );
}
break;
case KB_DOWN:
if (y + Depth > MaxY) {
y -= V_SCROLL;
WinScrollV( Win, &wr, V_SCROLL );
}
break;
case KB_LEFT:
if (x < 0) {
x += H_SCROLL;
WinScrollH( Win, &wr, -H_SCROLL );
}
break;
case KB_RIGHT:
if (z > 0)
if (abs(x) < z) {
x -= H_SCROLL;
WinScrollH( Win, &wr, H_SCROLL );
}
break;
case KB_ESC:
case KB_ENTER: return;
}
} while TRUE;
}
TI-89 / TI-92 Plus Developer Guide
Not for Distribution
1191
Beta Version January 26, 2001

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92 plusTi-92 plus

Table of Contents