Search PalmPower's 487 Palm-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
PROGRAMMING POWER
Programming controls in PalmOS
By Alan Jay Weiner

We looked at resources in June, and started looking at forms and controls. Last month, I provided several utility routines for working with controls. This month, let's take a look at several different types of controls--what we can do with them, and how they work.

What are controls?
Just to clarify what we're talking about, what are controls? They're the user-interface elements with which we interact--they're the buttons we push, the pull-down lists, check boxes, and so forth. Officially, the PalmOS documentation defines control objects as buttons, pop-up trigger, selector trigger, repeat controls, pushbuttons, and check boxes.

Some of the controls are actually the "triggers" for other user interface (UI) objects. For example, the popup trigger tells a list to display itself on the screen. Pop-up lists have two controls: the trigger and the list itself. More on that in a bit.

You've already used these controls; they're used on the forms in the built-in applications and third-party programs. So you're familiar with using them. Let's take a look at how to work with them in our programs.

How do the controls work?
When we build a form and place various controls on it, the program contains the parameters we specify; the position of each control, its height and width, and so forth. When the form is used, the operating system keeps track of each control using a special data structure. As things happen which change the control, those changes are reflected within that data structure and on the screen.

Most of the time, users cause these changes by tapping on the screen--pressing a button or selecting something. Other times, some other event causes a change (for example, the tap on the pop-up trigger changing the pop-up list status so it will appear on the screen). Initially, only the trigger is displayed; the actual list is "unusable" so it won't show up. Once the user taps the trigger, the list changes to usable and is displayed.

Since PalmOS knows about the standard controls, most of the events related to these controls are handled by the operating system. When the user presses a button, the application ignores the pen-down and pen-up events and just lets PalmOS do the proper "pressing on button" actions. Our event loop sees these events, so if we wanted to intercept them for some special reason we can. But normally, we just ignore them. They ripple their way through the event handlers and finally the default form handler (within the OS) does what it should to make the control work properly. The button handler inverts the button when it's pressed, and returns it to normal when it's released.


1  ·  2  ·  3  ·  Next »
Other articles you might like
Home > Phones and PDAs > Palm and Treo > Programming (24 articles)
   How PDA software is born
   Program with Simplicity
   Kinectivity 2.0 brings enterprise application developers new tools
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Other PalmPower Articles
Palm gets up to date with new Tungsten family of handhelds
Create handwritten email with riteMail
Presenter-to-Go puts PowerPoint presentations on your Palm OS handheld
Looking for the cutting edge
Gain remote access to databases and PLCs
PalmSource Open House showcases what's new in the Palm community
Analysis: handheld market share
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
DominoPower: Application development, William Shatner, and the origin of the universe
OutlookPower: More about disappearing text
-- Advertisement --

Sent Items Organizer
When you need to file your sent email into their proper folders based on keywords or who it's to. It's also perfect for shared mailboxes.

It also adds a "Send And File" toolbar button while you're composing (similar to the way Lotus Notes used to work) for quick and easy filing.

Find out more!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login