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.
Resources, forms and controls (continued)

The user interface is mostly resources
Most of an application's user interface will be built using resources. The "Hello World" application's user interface consisted of two forms. Each form contained some text and a control or two. The main form used a menu resource. Only the "hello again" message was explicitly drawn; the rest of it all was resources.

Since forms are the basis for almost all the user interface, let's finish this month with a detailed look at the main form resource.

The form resource in detail
A form has various attributes, such as its position (if smaller than full-screen), its height, width, and so on. As mentioned before, it can contain control resources within it, and may use certain other resources like a string resource as the help text, and a menu resource.

Looking again at Figure B (which we've redisplayed below), we see the main form as built in Constructor. This corresponds to the lines between "FORM ID MainForm" and "END" in Listing 1 (see http://www.component-net.com/pp-extras/mainform.html).

FIGURE B


The main form built in Constructor. Roll over picture for a larger image.

The attributes of the form are shown in the left pane. Each element may be edited by clicking on the value and typing in a new value. These are the elements in the form's data structure itself; the control resources will be tacked on following this data. We don't need to worry about the actual structure layout. That's all handled by Constructor.

The left and top origin define the screen coordinate where the top-left corner of the form is placed. The physical screen is 160 pixels across and 160 pixels tall. The origin coordinates range from zero to 159. (0,0) is the top left of the screen.

The width and height define the size of the form in pixels. A full-screen form is 160 by 160. The main form of Hello World uses the full screen.

Most controls have a "usable" attribute. If it is not usable, it will not be drawn when the rest of the form is displayed. Since forms aren't drawn until you explicitly switch to the form, they will always be marked "usable."

"Modal" indicates whether the form's event handler should deal with pen events outside the form. A modal form will ignore any pen-taps outside itself. Modal forms also have a border - it's drawn by the form displayer during the FrmDrawForm call. You might want to refer back to April's Programming Power column to review the form-open events.

"Save Behind" tells Palm OS to save the portion of the screen which will be obscured by this form when it draws the form. When the form is closed, Palm OS will automatically restore that part of the screen. I've had odd results with this at times; sometimes things underneath the form show through when the form is first drawn. When that happens, typically setting "save behind" will fix it, even though "save behind" should cause things the other way around. It should leave garbage when the form is closed rather than mess it up when it's first drawn.


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