O'Reilly logo

Palm Programming: The Developer's Guide by Julie McKeehan, Neil Rhodes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Resources, Forms, and Form Objects in the Sales Application

Now that we have given you general information about resources, forms, and form objects, we will add them to the Sales application. We’ll show you the resource definitions of all the forms, alerts, and help text. We won’t show you all the code, however, as it would get exceedingly repetitious and not teach you anything new. In particular, we won’t show the code to bring up every alert. We also postpone adding the table to the order form until Section 8.2.

We cover the forms and the code for them in order of increasing complexity. This yields the following sequence:

  • Alerts

  • The Delete Customer dialog

  • The Edit Customer form

  • The Item Details form

  • The Customers form

  • Switching forms

All the resources are shown in text as PilRC format. (This format is easier to explain than a bunch of screen dumps from Constructor.)

Alerts

Here are the defines for the alert IDs and for the buttons in the Delete Item alert (this is the alert that has more than one button):

#define RomIncompatibleAlert                      1001
#define DeleteItemAlert                           1201
#define DeleteItemOK                              0
#define DeleteItemCancel                          1
#define NoItemSelectedAlert                       1000
#define AboutBoxAlert                             1100

Here are the alerts themselves:

ALERT ID NoItemSelectedAlert
INFORMATION
BEGIN
    TITLE "Select Item"
    MESSAGE "You must have an item selected to perform this command. " \
            "To select an item, tap on the product name of the item."
    BUTTONS "OK"
END
ALERT ID RomIncompatibleAlert ERROR BEGIN TITLE "System Incompatible" MESSAGE ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required