Static Menus - Texas Instruments TI-89 Developer's Manual

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

Advertisement

86
1.
The user invokes menu processing by pressing one of the function keys
ƒ . . . Š.
The OS sends the function-key press ( ƒ . . . Š) to the application as a
2.
CM_KEY_PRESS event.
3.
The application forwards the event to the default event handler
(EV_defaultHandler).
4.
The default event handler looks up the application's current menu (attribute
OO_APP_DEFAULT_MENU_HANDLE in the application's frame).
5.
The default event handler calls MenuKey on the application's current menu
to start user interaction with the menu.
6.
MenuKey returns the command number of the user's chosen menu item.
7.
Default event handler sends the command number as an event to the
application.
Note: The application's event handler entry point is called recursively by the above process,
The OS automatically processes function-key presses ( ƒ . . . Š) only if the
application has placed a menu handle where the default event handler can find it.
The OS looks for a handle to the current menu in the
OO_APP_DEFAULT_MENU_HANDLE attribute of the application's frame. The
software developer can construct static menus with the resource compiler and
link them to the application when the application is created, or an application can
build a dynamic menu at run time.
9.6.1.

Static Menus

Static menus are easy to create and simple to use. If your application has very
modest menu requirements, static menus are the better choice. Since static
menus are handled transparently by the default event handler, the application
needs no extra code to deal with function keypresses. Menus are automatically
drawn when the application is activated, function keypresses are passed to the
menu system, and menu memory is released when the application is
deactivated. Incidentally, all the built-in applications employ static menus.
See section 11.5. Resource Compiler on how to compose a menu source file
and use the resource compiler to create an object file suitable for linking with
your application.
TI-89 / TI-92 Plus Developer Guide
first with the CM_KEY_PRESS message then a nested call with the menu item
command number. Applications must be re-entrant since default event handling often
entails translating one type of command into another type. The application receives the
translated message through its event handler entry point as a recursive call from the
default event handler.
Not for Distribution
Chapter 9: Application Control Flow
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