Slide 8.6: Line-by-line anatomy of Forms.c (cont.)
  Slide 9.2: Menu demonstrations
  Home


Menus


A menu bar is displayed whenever the user taps a menu icon. The menu bar is also displayed when the user taps in a form's titlebar. The menu bar, a horizontal list of menu titles, appears at the top of the screen in its own window, above all application windows.
Pressing a menu title highlights the title and “pulls down” the menu below the title. User actions have the following effect on a menu:

 When ...   Then ... 
User drags the pen through the menu. Command under the pen is highlighted
Pen is released over a menu item. That item is selected and the menu bar and menu disappear.
Pen is released outside both the menu bar and the menu. Both menu and menu bar disappear and no selection is made.
Pen is released in a menu title. Menu bar and menu remain displayed until a selection is made from the menu.
Pen is tapped outside menu and menu bar. Both menu and menu bar are dismissed.

Two of the menu features are: Menu events are handled by MenuHandleEvent. The following table describes how user actions get translated into events and what MenuHandleEvent does in response.

 User Action   Event Generated   MenuHandleEvent Response 
Pen enters menu bar. winEnterEvent identifying menu's window Tracks the pen.
User selects a menu item. penUpEvent with the x and y coordinates Adds a menuEvent with the item's ID to the event queue.