Texas Instruments TI89 Developer Guide - Page 645
Example, GraphActivate, Sets a global flag before activating the Graph app so that this app will
![]() |
UPC - 033317198566
View all Texas Instruments TI89 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 645 highlights
Appendix A: System Routines - Graphing 603 GraphActivate (continued) Example: The cmd_circle function, if it were part of an app, would be as shown below along with two of its helper routines (GetAttr and isShortFloat). It (like most of the TI-BASIC graphing commands and functions) uses GraphActivate to activate the Graph app and then it draws an ellipse to the graph window using the parameters passed to it. The second example, appfocus.c, is a complete app that: • Sets a global flag before activating the Graph app so that this app will ignore the quit message when the grapher is active. The app will still lose the focus and cannot write to any of its windows but it will not completely shut down. • Activates the Graph app, drawing a circle just to do something. • Reactivates itself so now it is back to being the currently active app. /* Get a valid attribute value (0, 1, -1) and return its corresponding screen attribute (A_REVERSE, A_NORMAL, A_XOR). */ short GetAttr( EStackIndex i ) { SWORD RetInt; RetInt = GetValue( i, -1, 1 ); if (RetInt == -1) return A_XOR; else if (RetInt == 0) return ((RetInt == 0) ? A_REVERSE : A_NORMAL); } /* If the given Float value is in the range of a short integer return that value; otherwise, throw a domain error. */ short isShortFloat( BCD16 Float ) { short RetInt; if (Float < FPN32768 || Float > FP32767) ER_THROW( ER_DOMAIN ) RetInt = Float; return( RetInt ); } void cmd_circle (EStackIndex i, EStackIndex j, EStackIndex k, EStackIndex m) { Access_AMS_Global_Variables; BCD16 rFlt; short a0, b0; BYTE OrigAttr; (continued) TI-89 / TI-92 Plus Developer Guide Not for Distribution Beta Version January 26, 2001
![](/manual_guide/products/texas-instruments-ti89-developer-guide-95b636f/645.png)