Form Objects

The elements that populate a form are called form objects. Before we get into the details of specific form objects, however, there are some very important things to know about how forms deal with all form objects.

Many of the form objects post specific kinds of events when they are tapped on, or used. To use a particular type of form object, you need to consult the Palm OS documentation to see what kinds of events that form object produces.

Dealing with Form Objects in Your Form Event

Form objects communicate their actions by posting events. Most of the form objects have a similar structure:

  1. When the stylus is pressed on the object, it sends an enter event.

  2. In response to the enter event, the object responds appropriately while the stylus is pressed down. For example: a button highlights while the pen is within the button and unhighlights while it is outside the button; a scrollbar sends sclRepeatEvents while the user has a scroll arrow tapped; a list highlights the row the stylus is on and scrolls, if necessary, when the pen reaches the top or bottom of the list.

  3. When the stylus is released:

    1. If it is on the object, it sends a select event.

    2. If it is outside the object, it sends an exit event.

In all these events, the ID of the tapped form object and a pointer to the form object itself are provided as part of the event. The ID allows you to distinguish between different instances that generate the same types of events. For example, two buttons would both generate a ctlSelectEvent ...

Get Palm Programming: The Developer's Guide 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.