16
Chapter 4: User Interface Overview
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
4.2. Menus
 Menus allow the user to select an item from a hierarchical list of items. There are
two formats: toolbars and pop-ups. Toolbars normally are placed at the top of the
display and accessed with the function keys (even though they may be placed
anywhere including within dialog boxes). Pop-ups “pop-up” over the display and
are not attached to any toolbar. The MATH and CHAR keys bring up pop-ups as
shown in Figures 4.1 and 4.2.
 
 
Figure 4.1: MATH Menu Figure 4.2: CHAR Menu
 Menus can be defined with the resource compiler (static), 
MenuNew
 (dynamic)
or both (the core menu is defined with the resource compiler which is then loaded
into memory with the 
MenuLoad
 function so that it can be modified). The
following example shows how a menu is defined by the resource compiler (see
the 
MenuLoad
 function for an example using this menu as a core menu and
then adding to it). This menu is shown in Figure 4.3.
TOOLBAR AddToMenu, RC_NO_IDS, 0, 240 {
   "TOP 1", 10 {
      "SUB 1", 11
      "SUB 2", 12
   }
   "TOP 2", 20 {
   }
}
 In the above example, the numbers 10, 11, 12, and 20 are menu IDs. A menu ID
is an integer in the range from 1 to 4095 (0xFFF) which can be explicitly
assigned by the creator of the menu or generated by the resource compiler. In
the following example, MID_1, MID_2 and MID_CORRECT will have the values
1, 2, and 3 respectively, as generated by the resource compiler. This menu is
shown in Figure 4.4.
POPUP mPopupTest, 0, 0 {
   "POPUP 1", MID_1
   "POPUP 2", MID_2
   "SELECT THIS", MID_CORRECT
}