This chapter introduces you to and provides a high-level overview of Palm OS Resource Editor.
Palm OS Resource Editor Fundamentals Overview
Palm OS Resource Editor is a visual resource editor that you can use to create and edit XML resource description (XRD) files for Palm OS applications.
The following topics are included in this chapter.
- "What Is a Palm OS Resource?"
- "Palm OS Resource Tools"
- "Resource Files"
- "Opening a Resource Description File in Resource Editor"
- "Resource Editor Interface"
- "Resource Types"
What Is a Palm OS Resource?
A Palm OS software resource is a data structure that describes the characteristics of an application element. For example, user interface elements, such as forms, dialogs, or text strings are all resources; in addition, code segments are also stored in resources.
A Palm OS software application uses resources to present something to the user. For example, a database application for Palm OS software might have one form for entering and editing records, and another form for displaying a list of records. Each form is stored in the application as a form resource, which contains a description of the buttons, text fields, and other elements that make up the form. In addition, the same application may use other resources to store help text, a default list of category names for the database, bitmap pictures, and an application icon.
All resources are assigned an integer resource ID. For applications, resource IDs should be less than 9999. Resource IDs of 10000 or above are reserved for use by Palm OS.
For information on using Resource Editor to create a new resource, see "Creating a New Resource".
Palm OS Resource Tools
Palm OS Resource Editor is designed to work with the family of Palm OS resource tools. All of the resource tools operate on XRD files. An XRD file is an XML resource description file, which contains XML tags that represent the resources for an application.
Figure 1.1 provides a graphical representation of how the Palm OS resource tools are used to create resources for a Palm OS application.
- GenerateXRD converts existing Palm OS PRC files and Macintosh RSRC files into XRD files.
- Palm OS Resource Editor creates and edits XRD files.
- PalmRC compiles XRD files into TRC files.
- PRCMerge takes the compiled output from PalmRC and merges it with the code resources (BIN) to produce a Palm OS application (PRC).
Figure 1.1 Palm OS resource tools

Resource Files
Palm OS Resource Editor uses a collection of files as a convenient way to manage resource definitions.
Resource Workspaces
Resource Editor uses the concept of a workspace for organizing resource files. A workspace is simply a collection of resource files that are loaded, saved, and closed as a group. Physically, a workspace file is a document containing a list of resource files that are collected together.
Workspace files have the extension XRW.
When you first create a workspace, it appears as an empty workspace in the Files pane. When you create or add resource files to the workspace, the workspace and all files it references are shown in a tree view in the Files pane.
You can open only one workspace at a time. If you try to create a new workspace or open an existing workspace while another workspace is open, you are prompted first to save the current workspace if you have made changes to it. The current workspace is closed before the new workspace is opened or created.
Opening a Workspace
- In the Start menu on your Microsoft Windows Desktop, select Programs > PalmSource > Tools > Palm OS Resource Editor. The Palm OS Resource Editor window opens.
- In Palm OS Resource Editor menu, select File > Open. The Open dialog box appears.
- Browse to the workspace (XRW) file and double-click it to open it. The workspace name appears in the Files pane.
Within Palm OS Developer Suite, you can also open a workspace by double-clicking an existing XRD file.
Creating a New Workspace
- In the Start menu on your Microsoft Windows Desktop, select Programs > PalmSource > Tools > Palm OS Resource Editor. The Palm OS Resource Editor window opens.
- In Palm OS Resource Editor menu, select File > New. The New dialog box appears.
- In the New dialog box, select XML Resource Workspace and click OK. A new workspace appears in the Files pane.
- To rename the workspace, right-click the workspace name in the Files pane and select Save as from the pop-up menu.
- To add resources to the workspace, see "Creating a New Resource Description:."
Resource Description Files
Palm OS resource description files use XML structure and text encoding to specify application resources. These XML resource description files are commonly called XRD files.
XRD files follow a format described in the book Exploring Palm OS: Resource File Formats. There is a one-to-one correspondence between Palm OS resources and XML resource descriptions in the XRD file. That is, for every resource in the Palm OS application, you need to specify an XML resource element name and associated attributes.
Resource Editor streamlines the creation of XRD files. Rather than directly editing an XML-based text file, you use the visual layout windows provided by Resource Editor to create your XRD files.
Creating a New Resource Description:
To create a new resource description (XRD) file:
- In the Start menu on your Microsoft Windows Desktop, select Programs > PalmSource > Tools > Palm OS Resource Editor. The Palm OS Resource Editor window opens.
- If you want to add the resource description to an existing workspace, open the workspace as described in "Opening a Workspace". If you want the resource description to be part of a new workspace, do not select a workspace; a new workspace will be created automatically when you create the resource description.
- In Palm OS Resource Editor menu, select File > New. The New dialog box appears.
- In the New dialog box, select XML Resource Description and click OK. A new resource description appears in the Files pane, listed under the name of the workspace to which the resource description belongs
- To rename the resource description, right-click the workspace name in the Files pane and select Save as from the pop-up menu.
- To add resources to the resource description, see "Creating a New Resource."
Within Palm OS Developer Suite, you can create a new resource description by selecting File > New > XRD File.
Creating a New Resource
In addition to using Resource Editor to create new resource description files, you can also use Resource Editor to create individual resources (such as forms, alerts, and menus) within a resource description file. To create an individual resource:
- In the Files pane, select the resource description (XRD) file to which you want to add a resource.
- In the main menu bar, select Edit > New Resource. The New Resource dialog box appears.
- In the New Resource dialog box, select the resource type that you want to create.
- If you wish, you can select the following checkboxes:
- Show only common resource types – Select this checkbox to display only the most common resource types. Deselect this checkbox to display all the resource types that can be edited in the Resource Editor.
- Generate Unique ID – This checkbox controls the ID assigned to the newly created resource. If this checkbox is selected, Resource Editor chooses an ID for the resource that is unique among all the other resources of the same type in the document receiving the new resource. If this checkbox is not selected, you can type a resource ID of your choice in the Resource ID text box.
- Click the New button to create the resource.
The name and number of the new resource appear in the Files pane, the resource's properties appear in the Properties pane, and the resource itself appears in an appropriate editor window (for example, if the resource is a form, it is displayed in the Form Editor).
Custom Resource Description Files
The XRD file format allows for a special type of resource called a custom resource. Using the custom resource type element, you can create your own XML-based format for resources that are not already defined.
Resource Editor allows you to use the Raw Editor to import any arbitrary chunk of data as a custom resource type. Custom resource type description files must have an XRT file extension.
Resource Header Files
Resource Editor does not currently support creating a C header file for the resources defined in your XRD files. If your application needs a C header file with preprocessor definitions for your resources, you need to create the header file independently.
Opening a Resource Description File in Resource Editor
To open a resource description (XRD) file in Resource Editor:
- In the Start menu on your Microsoft Windows Desktop, select Programs > PalmSource > Tools > Palm OS Resource Editor. The Palm OS Resource Editor window opens.
- In Palm OS Resource Editor menu, select File > Open, and browse to the resource file you want to open. Double-click the file name to open the file in Resource Editor.
- The resource file appears in the Files pane, with a list of resources contained in the file. The selected resource's properties are displayed in the Properties pane. You can use the Resource Editor Interface to edit the resource file.
Resource Editor Interface
Palm OS Resource Editor consists of a collection of panes that provide access to a list of resource files, a palette of user interface controls, a graphical layout area, and a set of editors for each resource type. It also includes a Keyboard toolbar button that lists locales and lets you select fonts appropriate to each locale.
Main Window
The Resource Editor's main window, shown in Figure 1.2, provides a menu bar and toolbar, and consists of the following panes:
Figure 1.2 Resource Editor main window

Windows Pane
The Windows pane, shown in Figure 1.3, is where Palm OS Resource Editor displays the resource editors. You can use the Windows menu items to change how the editor windows are displayed, to close the editor windows, or to select which editor window is in the foreground.
Figure 1.3 Windows pane, with cascading windows

- Custom resource editors for the most common resource types, including:
- An XML Editor that shows the XML resource description for the resource. This editor is to be used for resources for which no custom resource editor is provided. For information on how to select this editor, see "Edit Resource".
- A Hex Viewer that shows the binary form of the resource. For information on how to select this viewer, see "Edit Resource".
Files Pane
The Files pane, shown in Figure 1.4, contains a tree view of all the open files and their contents. The tree view has four levels:
- Workspace name: You can only open one workspace. The label shows the workspace name, and shows the number of open documents in the workspace.
- XRD filename: The label shows the filename (or it says Untitled if the file has not yet been saved).
- Resource type: All resources in an XRD file are sorted by resource type. The label shows either the name of the resource type or the resource type's four-character ID.
- Resource identifier: The label shows the resource ID for the specific resource, and any associated text string for the resource.

Tasks Pane
The Tasks pane, shown in Figure 1.5, displays messages about actions that you can take. Resource Editor generates these messages either automatically or in response to some operation you have performed. For example, if you use the Validate Resources function, Resource Editor displays information about your resources in the Tasks pane.

Properties Pane
Most resources have two kinds of properties. The basic properties are general properties that all resource types have—for instance, the Resource ID property. The specific properties vary from one resource type to another. For instance, menu bars have a Hidden property, whereas other resource types do not. The Properties pane displays the basic or specific set of properties, depending how many times you click the resource in the Files pane.
Basic Properties
To see the values of basic properties for a given resource, single-click the resource in the Files pane. The basic properties of are listed in "Basic Properties of Resources".
Table 1.1
Specific Properties
To see the specific properties for a resource, double-click the resource in the Files pane. If you are in the Form Editor, click the visual representation of the form object whose properties you wish to see. The Properties pane shown in Figure 1.6 displays properties specific to a given resource type.
The first column in the properties pane contains the property name; the second column contains the property value. If a property value is editable, you can click on the Properties pane and change the displayed information.
Figure 1.6 Specific Properties

The properties are displayed in the font appropriate for the locale you have selected using the Keyboard button; see "Keyboard Toolbar Button" for information.
You can change the width of the columns shown by selecting and dragging the vertical bar separating the attributes from their values.
Properties of Form Objects
Form objects—such as buttons and check boxes—are treated differently from other resources. Form objects have only one set of properties. To view them, open the Form Editor for a particular form and click a form object. The properties appear in the Properties pane.
Keyboard Toolbar Button
The toolbar contains a Keyboard button, shown in Figure 1.7, that lists locales and lets you select fonts appropriate to each locale. When clicked, the button displays a menu that lists all the recognized locale modules that are installed in the Resource Editor. Click a locale on the menu to change the font used to display text in the Properties pane, the String editor, and the String List editor.
Figure 1.7 Keyboard toolbar button

If you do not have the appropriate font installed for the selected locale, the Resource Editor uses the Arial font by default. Table 1.2lists the fonts and encodings that are associated with the various locales.
Table 1.2 Fonts and Encodings Associated with Locales
Resource Types
This section describes the Palm OS resource types, grouped according to how they are used in a Palm OS application.
- "Forms and Form Objects"
- "Menus"
- "Character Strings, String Lists, and Category Names"
- "Alerts"
- "Icons and Bitmaps"
- "Fonts"
- "Sounds"
- "Data Types"
Forms and Form Objects
- Form
- Form Title
- Buttons
- Form Label
- Form Checkbox
- Form Field
- Form Graffiti State
- Form List
- Form Table
- Form Popup
- Form Popup Trigger
- Form Selector Trigger
- Form Slider
- Form Feedback Slider
- Form Scrollbar
- Window Constraints
Menus
Character Strings, String Lists, and Category Names
- Application Default Category
- Application Extended Preferences
- Application Icon Name
- Application Info Strings
- Application Launch Preferences
- Application Preferences
- Application Version
- String
- String List
Alerts
Icons and Bitmaps
Fonts
Sounds
Data Types
Palm OS Protein Resource Types and 68K Resource Types
Palm OS Protein (ARM-native) resource types are not the same as native 68K resource types.
- The four-character resource type code that gets generated by the resource compiler, PalmRC, may be different.
- The binary resources generated by PalmRC may have endianness differences.
However, you can use the Palm OS® Cobalt resource tools to create resources for both 68K-native applications and Palm OS Protein applications. To do this:
- Create the XML resource definition (XRD) file using Palm OS Resource Editor.
- Specify the PalmRC command line option
-p
to specify which OS version you want to use:-
68K
- To build resources in the format used by Palm OS 4.1 and prior (68K resources).
- Use this option when you are creating 68K applications.
- PalmRC also provides the option "-p PalmOS4" as a synonym for the "-p 68K" option.
-
ARM
- To build resources in the native format used by Cobalt Palm OS Cobalt and later (Palm OS Protein resources).
- Use this option when you are creating Palm OS Protein applications.
- PalmRC also provides the option "-p PalmOS6" as a synonym for the "-p ARM" option.
-