Appendix A: System Routines — Graphing
605
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
GraphActivate
(continued)
switch (e->command) {
case CM_START:
/* Do not open our window if already open. */
if (!(winPtr->Next)) {
ourID = EV_currentApp;
appWR = *(e->info.startInfo.startRect);
x = y = 50;
if (WinOpen( winPtr, &appWR, WF_TTY | WF_DUP_SCR))
WinClr( winPtr );
else
EV_quit();
}
break;
case CM_ACTIVATE:
EV_defaultHandler(e);
WinActivate( winPtr );
WinStr( winPtr, "Press 'G' to activate graph\n" );
graphActive = FALSE;
break;
case CM_KEY_PRESS:
if (tolower(e->info.keyInfo.keyCode) == 'g') {
WinStr( winPtr, "Graph activated\n" );
activateGraph();
} else
EV_defaultHandler(e);
break;
case CM_QUIT:
/* Ignore quit if just activating grapher. */
if (!graphActive) {
if (winPtr->Next) {
WinClose( winPtr );
winPtr->Next = NULL;
}
}
break;
case CM_WPAINT:
DrawWinBorder( winPtr, &(winPtr->Window) );
WinBackupToScr( winPtr );
break;
default:
EV_defaultHandler(e);
break;
}
}