Chapter 11: Creating the User Interface
123
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
11.6.1. Files in Example and Explanation of Details
app1.c The C source file.
app1.h The header file contains definitions used by app1.c and appr1.r.
appr1.r The resource file contains the menus, dialogs, and pop-ups.
Lines 2 . . . 4 Specifies the standard header tiams.h, our header file
app1.h, and the resource file appr1.h (generated by the
resource compiler).
Lines 6 . . . 12 All apps must have a frame that defines the interface
between it and the system. This app’s menu is handled by th
system because of line 11 (OO_APP_DEFAULT_MENU).
See chapter
7. Flash Application Layout
for more details.
Line 14 The first data item must be a pFrame to the apps FRAME.
Lines 15, 16 The apps static global data.
Line 18 Every interactive app must have an event handler. See
chapter
9. Application Control Flow
for a complete
description of system events.
Line 19 Required if a function accesses any data in the AMS (the
isprint macro accesses the global
CTypeTable
).
Lines 20 . . . 23 The event handler’s local data.
Lines 26 . . . 34 When this app is started it finds the size of its current
window from the start-up message; opens a window using
WinOpen
(note that the size and position of the window in
the start-up message assumes the app has a menu); and
then initializes any of its global data.
Line 35 The app is activated after it receives the start message and
whenever it is switched to in split screen mode.
Line 36 Since we are letting the system handle our menu this call to
EV_defaultHandler
turns our menu on.
Line 37 Now that our menu is on we can disable/enable or
check/uncheck any items, in this case the item with ID
ACM_NOTHING is disabled.
Line 38
WinBeginPaint
saves the current system draw status
(current font, attribute, clipping, . . . ) since another app may
have switched states.
Line 39 Activates our app’s window (the system puts our window at
the topmost position of all windows) and highlights our
window border (if present).