Example - Texas Instruments TI-89 Developer's Manual

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

Advertisement

120
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
9
10
11
12
ENDFRAME
13
14
pFrame pAppObj = (pFrame)&appObj;
15
WINDOW appW;
16
char buf[22];
17
18
static void AP_app(pFrame self, PEvent e) {
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
TI-89 / TI-92 Plus Developer Guide
ATTR(OO_APP_FLAGS, APP_INTERACTIVE)
ATTR(OO_APP_NAME, "app1")
ATTR(OO_APP_PROCESS_EVENT, &AP_app)
ATTR(OO_APP_DEFAULT_MENU, &AppMenu )
Access_AMS_Global_Variables;
WIN_RECT appWR;
HANDLE hPopup;
short key, vSelect; WORD opts[3];
char outStr[256];
switch (e->command) {
case CM_START:
appWR = *(e->info.startInfo.startRect);
if (WinOpen( &appW, &appWR, WF_TTY
WinClr( &appW );
else
EV_quit();
strcpy( buf, "FIRST" );
strcpy( buf+11, "SECOND" );
break;
case CM_ACTIVATE:
EV_defaultHandler(e);
EV_disableCmd(ACM_NOTHING);
WinBeginPaint( &appW );
WinActivate( &appW );
WinStr( &appW, "Just activated\n" );
break;
case CM_DEACTIVATE:
WinEndPaint( &appW );
break;
case CM_QUIT:
if (appW.Next) {
WinClose( &appW );
appW.Next = NULL;
Not for Distribution
Chapter 11: Creating the User Interface
/* Must be 1st! */
| WF_DUP_SCR))
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