This chapter introduces character string resources, which can be used for help text and default values for text fields.
Working with Strings Overview
To work with strings, start Palm OS Resource Editor and open the resource file you want to edit, as described in "Opening a Resource Description File in Resource Editor".
You can either create a new string or list of strings, or edit an existing string or list of strings.
- To create a new string or list of strings, see "Creating New Strings".
- To edit an existing string, see "Modifying an Existing String".
- To edit an existing list of strings, see "Modifying an Existing List of Strings".
Creating New Strings
- In the Files pane, select the resource description (XRD) file to which you want to add the menu bar.
- In the main menu bar, select Edit > New Resource. The New Resource dialog box appears.
- In the New Resource dialog box, select String or String List and then click the New button.
- The name and number of the new string or string list appear in the Files pane, and the string or string list is displayed in the String Editor or String List Editor. For information on how to edit the strings, see "Editing Strings and String Lists".
Modifying an Existing String
- In the Files pane, select the string resource you want to modify. When you select a string resource, the string's properties are displayed in the Properties pane.
- In the Files pane, double-click the string resource to display it in the String Editor. The String Editor appears. For information on how to use the String Editor, see "Editing Strings and String Lists".
Modifying an Existing List of Strings
To modify an existing string list:
- In the Files pane, select the string list resource you want to modify. When you select a string list resource, the string list's properties are displayed in the Properties pane.
- In the Files pane, double-click the string list resource to display it in the String List Editor. The String List Editor appears. For information on how to use the String List Editor, see "Editing Strings and String Lists".
Editing Strings and String Lists
You edit strings in the String Editor, and you edit String Lists in the String List Editor.
When you select a string or string list, the properties of the object appear in the Properties pane. Double-click the string or string list to display it in an editor window.
Using the String Editor
The String Editor is a window where you can string of text characters. In the String Editor window, you can type a Unicode character string using the operating system's UI character set.
You can type any Unicode character that the character set being used allows. For example, if the character set of the OS is English, then the characters are input in English. If the character set is Chinese, then the Windows OS uses a Chinese Input Method Editor to create the characters and add them to the String Editor window as Chinese characters. Note that the String Editor does not validate the individual characters of the string to verify if the character is valid in the target text encoding of the Palm OS application. Validation of the string contents is performed at resource compilation time.
A string may contain characters that cannot be represented in the current character set of the operating system UI, since the characters sets on the Palm OS do not necessarily match the character set of the OS on which the Resource Editor is running. In such cases, the character is represented within the string editor using the character's hex values in the form of '\x####'.
Locale Information
The String Editor supports the Keyboard toolbar button by setting the font according to the locale selected. For details on the Keyboard toolbar item, see "Keyboard Toolbar Button."
Note that there is no strict relation between the locale property for a string resource and the actual character set used to construct the string value. The locale property and the actual character set are independent and could be different. For example, the locale value could be enUS
but the string could be represented by Simplified Chinese Unicode characters.
Character Map
The String Editor can be used in conjunction with the Character Map. The Character Map is a Resource Editor tool that displays the characters in the various standard fonts and their variations according to the Palm OS version. You can cut and paste characters from the Character Map into the String Editor window.
To display the Character Map, go to the Resource Editor main toolbar and select Window > Character Map.
Using the String List Editor
The String List Editor is a window where you can edit a list of strings; that is, you can edit a string list resource. A string list resource consists of an optional prefix string and a list of zero or more individual character strings.
The String List Editor works much like the String Editor. See "Using the String Editor" for details.
In the String List Editor, you can select and edit each string in the list. To add a new string to the list, click the Insert key on your keyboard. To delete a string, select the string and click the Delete key on your keyboard. To move a string, select it with the mouse and drag and drop the string in the desired location.
The String List editor follows the same rules regarding Unicode character and Palm OS character set handling as described in "Using the String Editor".