106
Chapter 11: Creating the User Interface
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
compiler and the data structures defining them reside in Flash. Static menus can
be loaded into RAM with the
MenuLoad
function so that they can be modified
just like dynamic menus. After dynamic menus are created, they must be locked
and remain locked while they are in use so they do not move (since
MenuBegin
is passed a direct pointer to a MENU structure).
11.3.1. Menu-Draw Structure
Menus require a separate RAM based structure to be built which is created by
MenuBegin,
the menu-draw structure. This RAM based structure contains,
among other things, flags for checkmarks and enabled items as well as other
structures for maintaining the menu. Pop-ups only need a menu-draw structure if
they need menu-like features: checkmarks or enable/disable features. In that
case, use the
PopupBegin
/
PopupBeginDo
functions. Dynamic menus are
created at run-time and reside entirely in RAM.
11.3.2. Menu IDs
Each menu item is assigned an identifier. By default these identifiers range from
1 up to the number of menu items in the menu. Menus created with the resource
compiler can have symbolic names assigned to each menu item. These names
are stored in a header file with the same base-name as the resource file only with
a .h extension added. The default identifier numbers can be overridden if needed
in the resource file. Dynamic menu items are also numbered sequentially starting
at 1 by default, but the number may also be overridden. The example at the end
of this chapter (see
11.6. Example
) uses overridden menu IDs. See the example
in the
MenuTopStat
function entry point for an example that uses symbolic
names.
Each item in a menu or pop-up contains either a text string, an ICON or a
BITMAP. Use
DynMenuAdd
or
DynMenuChange
to add or change menu items
in a dynamic menu. There are some older routines,
MenuAddIcon
,
MenuAddText
, and
PopupAddText
, for specifically adding icons or text but
these routines do not need to be used. See section
11.5. Resource Compiler
for
more information about using BITMAPs in a menu.
11.3.3. Menu Routines
DynMenuAdd
— Add a new entry (text, icon, or bitmap) to a dynamic
menu or pop-up.
DynMenuChange
— Change an entry in a dynamic menu or pop-up.
FKeyI_H
— For the given function key, return its index relative to
KB_F1.
MenuAddIcon
— Add an icon entry to a dynamic menu.