604
Appendix A: System Routines — Graphing
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
GraphActivate
(continued)
if (GraphActivate(TRUE)) {
rFlt = ForceFloat( k );
a0 = isShortFloat( rFlt / gr_active->rngp[GR_DELTAX] );
b0 = isShortFloat( rFlt / gr_active->rngp[GR_DELTAY] );
if (a0 < 0 || b0 < 0)
ER_THROW( ER_DOMAIN );
OrigAttr = WinAttr(gr_active->grwinp, GetAttr(m) );
WinEllipse( gr_active->grwinp, XCvtFtoP(ForceFloat(i),gr_active),
YCvtFtoP(ForceFloat(j),gr_active), a0, b0 );
WinAttr( gr_active->grwinp, OrigAttr );
}
}
/* Example app to activate grapher and reactivate itself.
AppFocus.c
*/
#define _92
#include "..\tiams.h"
static void AP_app(pFrame self, PEvent e);
FRAME(appObj, OO_SYSTEM_FRAME, 0, OO_APP_FLAGS, 3)
ATTR(OO_APP_FLAGS, APP_INTERACTIVE)
ATTR(OO_APP_NAME, "appfocus")
ATTR(OO_APP_PROCESS_EVENT, &AP_app)
ENDFRAME
pFrame pAppObj = (pFrame)&appObj;
WINDOW appW;
BOOL graphActive;
AppID ourID;
short x, y;
void activateGraph( void )
{ Access_AMS_Global_Variables;
graphActive = TRUE; /* signal we are activating the grapher */
if (GraphActivate( FALSE )) {
WinEllipse(gr_active->grwinp, x++, y++, 25, 25 );
EV_startApp( ourID, AP_START_CURRENT );
} else
graphActive = FALSE; /* failed to activate grapher */
}
static void AP_app(pFrame self, PEvent e)
{ Access_AMS_Global_Variables;
WIN_RECT appWR;
WINDOW *winPtr = &appW;
(continued)