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
Playing the field
By Alan Jay Weiner

Since this is my first column for 1999, let me start by saying Happy New Year to all of you. I'd also like to thank PalmPower readers and staff for letting my take January off and get some sorely needed "rest and recovery" (which looked an awful lot like catching up on some other work...).

[Shhh... Alan, don't let it get out that we let our writers off the hook. It'll be bad for my reputation as a tough, unrelenting, merciless, Editor-in-Chief. -- DG]

In any case, back to work...

Almost any application that uses text entry will use fields. Fields are the standard Palm OS user-interface element for text entry. The system knows how to handle attributes such as automatically capitalizing the first letter, word-wrapping, expanding to multiple lines and so forth. Certainly that's easier than writing our own text-entry routines -- especially if you need multiple lines with word-wrapping!

Shown in Figure A, this month's sample program, Infield, provides some basics of field usage, along with a couple of special functions: only allowing digits and forcing text to upper case. As usual, it's based on the original "Hello, world" program, so most of it will be familiar.

FIGURE A

Infield is a simple little program that shows off field operations.

Fields are complex little beasts
First, let's look at how the field itself works. You define fields along with forms in whichever tool you use to build the resources -- Constructor if you're using the Metrowerks compiler, or PilRC if you're using the GCC tools.

Fields have many attributes, including the typical positioning information (upper-left corner's X and Y coordinates, and the width and height), and usability (enabled or not). They also have names and ID numbers like any other Palm OS user interface (UI) element.

Beyond these attributes, the field can be underlined or not, limited to a single line, editable or not, numeric only. Other attributes include wild-and-wooly things like dynamic sizing and scroll bars. To really cover fields entirely will take many, many columns; they don't always work as you'd expect. For this column we'll just stay with some basics and a couple of tricks to keep things interesting.

The simple stuff
Most of the field activity is handled by the default form handler. When your EventLoop function calls FrmDispatchEvent, the event goes to the form handler you've set. If your form handler doesn't handle the event, it then goes on to the default handler. Usually your form handler doesn't do anything special with field events. The default handler does all the right stuff, given the attributes you've defined for the field. At least, it mostly does -- there are times where things don't work as you think they should. We'll look at some of those later on.


1  ·  2  ·  3  ·  4  ·  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: Apple's latest heartbreaker
David Gewirtz Online: CNN commentary and analysis
DominoPower: Lotusphere 2010: mobility and collaboration
OutlookPower: Running auto-respond rules when Outlook is closed
-- Advertisement --

NO HASSLE PHOTO PRINTING, SHARING, AND STORAGE -- AS LOW AS $2.54 PER MONTH
Discover an easier way to share, print and manage your photos online! Get your own online photo album site for sharing photos, as well as easy-to-use editing tools to make sure your photos look their very best. You can even order high quality prints directly from your album -- and have them delivered right to your door!

Best of all, you can also get login-free photo sharing at your personal domain name (if you have one), so your friends and family don't have to hassle with signing up or logging in just to view your pictures. It's the perfect solution for sharing, printing and storing all your favorite images!

And it's only from The Duck! Tap here to get started.

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