Adding Menus to the Sample Application

Now it is time to add the menus to our Sales application. The menu bars are added first. Next, we set up our definitions for our menu items and menu bars. Once these are in place, we can create our code to handle common menu items and the functions we need to handle our forms. Our last step is to make sure the main event loop in our application calls our menu-handling function correctly.

The Menu Bars

The application has five menu bars, the first of which contains the Record, Edit, and Options menus (Figure 11-11). This menu bar is for the Order form. The Send Customer menu item is added dynamically on a 4.0 device.

The Order menus on a 4.0 or later device
Figure 11-11. The Order menus on a 4.0 or later device

The second menu bar, DialogWithInputField, is used for dialog boxes that have textual input fields (see Figure 11-12). It contains just one menu, the Edit menu.

The menu bar for dialog boxes with input fields
Figure 11-12. The menu bar for dialog boxes with input fields

The third and fourth menu bars are used separately, depending on whether the application is running on a 4.0 or earlier device. As you can see in Figure 11-13, the difference is whether sending shows up as a menu item. We have different menus for different devices so that a pre-4.0 user doesn’t get confused about either the application’s or device’s capability. ...

Get Palm OS Programming, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.