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)

"Form ID" is the resource's identification number. Remember when I said resources have a type and an ID? This is the ID. The type is 'tFRM' by the way.

Constructor can create a header file with these IDs. See Listing 1 (see http://www.component-net.com/pp-extras/mainform.html); near the bottom where it says "header file name" and "auto generate header file" is checked; this tells Constructor to write all the IDs in a file called HelloRsc.H. In this case, the form name will be MainForm.

"Help ID" isn't used in this particular form. That's why it's greyed out. If we wanted a help message for this form, we would make the ID a number other than zero, and we would define a string resource with the text. The Create button is a convenience; we could also go to the project window, click on "strings" and then create a new string by selecting New String Resource from the Edit menu command.

When a form has help text, the form displayer automatically makes the menu bar the full width of the form, and puts the "i" button at the right.

"Menu bar" indicates the identification number of the menu resource. Like Create for the help ID, the Edit button is a convenience. If the menu resource hasn't been created, the edit button will be a Create button.

When the system closes a form automatically, as it would when it switches to another application, it will simulate pressing the "Default button ID" button. In this case, there is no default button.

Finally, the "form title" is just that: the title shown on the menu bar. The "hex" button displays the title text as hex values. This is convenient when using non-alphanumeric characters.

Looking at Listing 1 (see http://www.component-net.com/pp-extras/mainform.html), you can see how PilRC uses similar terminology to define the form. "FORM ID MainForm AT (0 0 160 160)" indicates the top and left origins and the height and width. "MENUID MainFormMenuBar" indicates the ID number of the menu resource, which is defined a few lines later.

Next month
Now that we've finished our coffee (and in a few cases, the whole pot!) we'll tie things off here. Next month we'll look at some of the user-interface controls; what they do and how to use them.

Common Resource Types
Each resource is identified by a type and an ID number, as shown in Table A. These are some of the common types; you'll occasionally see them mentioned in articles or newsgroup and maillist messages. For the most part, you won't deal with the type codes; you'll just deal with a resource of a particular variety. The type codes are case-sensitive.

Resource Description
code program code
data program data
MBAR menu bar (typically referenced by a form resource)
MENU menu options (referenced by a MBAR menu bar)
tAIB icon bitmap; the icon displayed by the launcher
tAIN application name; the name displayed on the launcher.
tAIS application information string, a series of strings, typically passed to CategoryIntitialize() as the initial category names
Talt "Alert" dialog
Tbmp bitmap resource
tBTN button control
tCBX checkbox control
tFBM form bitmap
tFLD field control
tFRM form
tGDT gadget control
tGSI graffiti shift indicator
tLBL label
tLST list box
tPBN pushbutton control
tPUL popup list
tPUT popup trigger
tREP repeating button control
tSLT selector trigger
tSTR String resource - simply a text string
tTBL table
tTTL title
tver application version information
Alan Weiner is an independent software developer and a Senior Engineer at Communica, Inc. His email address is alan@ajw.com.


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