Texas Instruments TI89 Developer Guide - Page 162
Example, This will discuss the following example in detail. It has all of
![]() |
UPC - 033317198566
View all Texas Instruments TI89 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 162 highlights
120 Chapter 11: Creating the User Interface 11.6. Example This section will discuss the following example in detail. It has all of the components described in this chapter: windows, menus (toolbars and pop-ups), and dialog boxes. It uses the resource compiler for a static menu and dialog box, and creates a dynamic pop-up. 1 // APP1.C 2 #include "tiams.h" 3 #include "app1.h" 4 #include "appr1.h" 5 6 static void AP_app(pFrame self, PEvent e); 7 FRAME(appObj, OO_SYSTEM_FRAME, 0, OO_APP_FLAGS, 4) 8 ATTR(OO_APP_FLAGS, APP_INTERACTIVE) 9 ATTR(OO_APP_NAME, "app1") 10 ATTR(OO_APP_PROCESS_EVENT, &AP_app) 11 ATTR(OO_APP_DEFAULT_MENU, &AppMenu ) 12 ENDFRAME 13 14 pFrame pAppObj = (pFrame)&appObj; /* Must be 1st! */ 15 WINDOW appW; 16 char buf[22]; 17 18 static void AP_app(pFrame self, PEvent e) { 19 Access_AMS_Global_Variables; 20 WIN_RECT appWR; 21 HANDLE hPopup; 22 short key, vSelect; WORD opts[3]; 23 char outStr[256]; 24 25 switch (e->command) { 26 case CM_START: 27 appWR = *(e->info.startInfo.startRect); 28 if (WinOpen( &appW, &appWR, WF_TTY | WF_DUP_SCR)) 29 WinClr( &appW ); 30 else 31 EV_quit(); 32 strcpy( buf, "FIRST" ); 33 strcpy( buf+11, "SECOND" ); 34 break; 35 case CM_ACTIVATE: 36 EV_defaultHandler(e); 37 EV_disableCmd(ACM_NOTHING); 38 WinBeginPaint( &appW ); 39 WinActivate( &appW ); 40 WinStr( &appW, "Just activated\n" ); 41 break; 42 case CM_DEACTIVATE: 43 WinEndPaint( &appW ); 44 break; 45 case CM_QUIT: 46 if (appW.Next) { 47 WinClose( &appW ); 48 appW.Next = NULL; TI-89 / TI-92 Plus Developer Guide Not for Distribution Beta Version January 26, 2001
![](/manual_guide/products/texas-instruments-ti89-developer-guide-95b636f/162.png)