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.
Playing the field (continued)

EventLoop changes
As just described, the call to EvtGetEvent sets the timeout to either forever or zero, based on the fUpdateScreen flag.

Form's frmOpenEvent changes
I made two minor changes to frmOpenEvent. First, it calls CtlSetValue to enable the "All Chars" push-button. Otherwise, the form initially draws with all three push-buttons displayed as "off" and it simply looks different from tapping the "All Chars" button.

The other change was to set the focus to the field. This allows the user to just go ahead and enter characters; if we didn't set the focus, any characters would be ignored until the user tapped the field itself to set the focus.

Field funnies
When you start manipulating fields, such as inserting text programmatically, things can get weird. In fact, lots of people have had strange problems when doing complex things with fields. The Palm Developer's mailing list includes several discussions of unexpected behaviors.

Some of the oddities include:

  • If you insert end-of-line characters, they should be "𖝬" (an octal 12 which is a decimal 10). If you use "\r" or "\n" it may work on the real machine, but not in the Macintosh Simulator; apparently the characters are mapped differently.

  • Gremlins doesn't go through keyDownEvents to insert keys into fields. Expect gremlins to throw all kinds of bizarre stuff into your fields.

  • In fact, Gremlins have been known to put more characters into a field than the maximum value indicated by the field settings. Be sure that you don't crash if that happens (especially if you go for Platinum certification!). This may only happen if the field is limited to two characters, but that's not certain.

  • Palm OS 1 works differently from Palm OS 2 which works differently from Palm OS 3. Test on all three devices. Why should programming ever be easy?

Conclusion
Even some of the best programmers have complained about fields -- especially when manipulating the field's memory buffer. They're quite useful, but not often intuitive. If you run into troubles, a great place to ask for help is the Palm Developer's mailing list. In fact, anyone doing Palm development should read that list religiously.

Fields are very powerful, and we've just had a taste of them here. We'll visit them again from time to time.

Product availability and resources
Source code to Infield is at Alan Jay Weiner's web site at http://www.ajw.com/PalmPower/ProgrammingPower/Feb99/Infield.zip.

The Palm Developer's mailing list is at http://www.palm.com/devzone/mailinglists.html.

Michael Compeau is a Contributing Editor for PalmPower Magazine as well as the VP of Business Development and Planning for Cutting Edge Software (at http://www.cesinc.com), a subsidiary of Mobility Electronics.


« Previous  ·  1  ·  2  ·  3  ·  4
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