| Runtime Resource Editor Library Version 1.15, updated Mar-25-2004 for PDAT/Advanced 5.x and PDA Toolbox 6.0 Professional |
Copyright (C) 2002-2004 Richard R. Sands dba Sands USA |
Table of Contents |
|
| 1. Library Overview | 5. Library Actions Reference |
| 2. Plugging In the Library | 6. Purchasing Information |
| 3. How To: Skinning Applications | 7. Support |
| 4. Distribution | 8. Warranty and User License Agreement |
Library Actions Reference by $Action Name |
|
| $Rsrc.Copy | $Rsrc.SelectOS (ver. 1.10) |
| $Rsrc.CopyAll | $Rsrc.Set (ver. 1.12) |
| $Rsrc.CopyTo | $Rsrc.StartForm |
| $Rsrc.CopyFile | $Rsrc.TableRowColor |
| $Rsrc.Delete | $Rsrc.Table.Cols (ver. 1.08) |
| $Rsrc.PopD (ver. 1.08) | $Rsrc.Table.Filter (ver. 1.08) |
| $Rsrc.Popup | $Rsrc.Table.Scroll (ver. 1.08) |
| $Rsrc.Select | $Rsrc.tSTR |
| Library Overview |
The Runtime Resource Editor Library is a share library for PDA Toolbox applications. It provides application resource manipulation actions.
This library provides the ability for the PDA Toolbox application to modify it's own resources by copying resources from an external file. There are several possibilities that this provides: Your applications can be made "skinnable", that is, to change the user-interface of the app often by changing the graphics in the application. It can provide user selectable "language" interfaces by providing alternate UIs contained in additional files. More advanced operations could be done by changing the fundamental actions a program performs by "skinning" the action and other PDA Toolbox resources.
Additionally, there are some PDA Toolbox Application specific actions that are used strictly to modify the behavior of a PDA Toolbox-PDAT/Advanced app. These are $Rsrc.StartForm, $Rsrc.Popup, and $Rsrc.TableRowColor.
The Runtime Resource Editor Library works by opening source resource databases and merging the entire file or selected resources into the application. Each resource database can either be specified by file name and automatically set as the source database, or it can be selected by the user from a list of files. The list of files are all files of a particular Creator ID and Type.
|
NOTES: |
[1]
If you beam an application that has been modified with the Runtime
Resource Editor Library, the modified app is beamed - not the original.
[2] If you run an application that modifies itself with the Runtime Resource Editor Library from an External Expansion Card, the modifications may not "stick" across runs. [3] Deleting resources is at your own risk. |
It is also used as a "Plug-In" to PDAT/Advanced to provide additional Actions to your PDA Toolbox programs.
This manual assumes the reader has familiarity with the PDAT/Advanced application.
The Runtime Resource Editor Library is a Shareware Library for the Palm OS™ 3.1 and up unless specifically mentioned. This library requires approx. 16k of internal hand-held memory. For purchasing information click here.
| Plugging In The Library |
PDA Toolbox 6.0 Professional Instructions
PDAT/Advanced Instructions
Before you can use the actions contained in this library, you must first "plug" it into PDAT/Advanced. Once plugged in and registered, you will be able to use and distribute this library freely.
After successful registration, when you are editing actions, you'll have a second button named "Lib" which pops up a list of all the commands available to you.
| How To: Skinning Applications |
The general idea behind skinning applications, or changing the appearance of the application, is to create resource databases that contain all of the bitmaps of an app, each with the same resource ID as the graphic in the app. By using this library, your app then selects the resource database to merge into your app. Since your app's bitmaps are being overwritten by the resource database, the appearance of your app is changed.
General steps to create a resource database on the emulator (POSE) with RsrcEdit:
You want all your skin files to have the same Creator ID and Type. This is so that your application can display a list of skins to the user.
The coding is small:
$Rsrc.Select "ABCD", "skin" $Rsrc.CopyFile
There are many variations on this theme: You can allow skinning a complete app, or just merging specific resources. The $Rsrc.CopyFile is the simplist approach.
| Distribution |
The file "PDATRsrc.prc" must be distributed with any application that uses this library. Since you are distributing multiple PRC files that must be installed on the hand-held device, you may want to check out Ecamm's NutShell for the Palm OS at http://www.ecamm.com/palm/nutshell. Nutshell is a unique installer solution, which allows users distribute multiple Palm files and data as a single self-expanding PRC file. With this tool, the user installs a single file onto their hand-held and the first time your app is run, all the libraries, databases, and sub-programs are automatically unpacked and your app runs. A very good solution to a sticky problem.
| Library Actions Reference |
Each Action in the library will be described here.
| $Rsrc.Copy typeID, typeID, ... | ||
| Description: | Copies each specified resource into the application. | |
| Parameters: | typeID: | One or more resource and IDs to be copied. |
| Example: |
$Rsrc.Select "crid", "type" |
|
Before you can call this action, you must first select a resource database either by user-selection, or by filename. Each resource specified as parameters will be copied into the calling application. When you return to the app, the resources merged will be automatically loaded.
The practical number of resources you can specify is about 50.
| $Rsrc.CopyTo typeIDs, typeIDd, ... | ||
| Description: | Copies and optionally renames and retypes the resource. | |
| Parameters: | typeIDs: | This is the source type and ID of the resource to copy. |
| typeIDd: | The destination type and ID that the "typeIDs" will be copied as. | |
| Example: |
$Rsrc.Select "mySkins" |
|
Unlike the other CopyXXXX actions, you do not need to first select a resource database. The application itself defaults as the source and destionation file. However, you may select a resource database either by user-selection, or by filename. You may specify a list of resource pairs (sourceID, destID) to copy many specific resources.
The practical number of resources you can specify is about 30.
| $Rsrc.CopyAll type, type, ... | ||
| Description: | Copies all resources of a specified type into the application. | |
| Parameters: | type: | One or more resource types to be copied. |
| Example: |
$Rsrc.Select "mySkins" |
|
Before you can call this action, you must first select a resource database either by user-selection, or by filename. All resources that match the types specified will copied into the calling application. When you return to the app, the resources merged will be automatically loaded.
The practical number of resources you can specify is about 60.
| $Rsrc.CopyFile | |
| Description: | Copies all resources from the source file into the application. |
| Example: |
$Rsrc.Select "mySkins" |
Before you can call this action, you must first select a resource database either by user-selection, or by filename. All resources will copied into the calling application. When you return to the app, the resources merged will be automatically loaded.
| $Rsrc.Delete typeID, typeID, ... | ||
| Description: | Deletes each specified resource from the resource file or application. | |
| Parameters: | typeID: | One or more resource and IDs to be copied. |
| Example: |
$Rsrc.Select "crid", "type" |
|
NOTE: Use this at your own risk.
Before you can call this action, you may first select a resource database either by user-selection, or by filename. If you do not, the calling application will be the source the resources are deleted from. Each resource specified as parameters will be deleted from the database.
The practical number of resources you can specify is about 50.
| $Rsrc.Popup CtrlID, CID, TID, FLD | ||
| $Rsrc.PopD CtrlID, CID, TID, FLD, Link | ||
| Description: | Changes the source database/field of a dynamic popup. | |
| Parameters: | CtrlID: | This is the ID of the Popup Control (as when tapped upon in PDAT/Advanced) |
| CID: | The Creator ID of the database that should be used for the popup | |
| TID: | The Type ID of the database that should be used for the popup | |
| FLD: | The field to fill the popup from the above specified database. | |
| Link: | The word "Link" or "NoLink" | |
| Example: |
$Rsrc.Popup 1002, CRID, DATA, FLDX |
|
This will allow you to change the data that appears in a dynamic popup. For instance, if you have a database that has Last Name and SSN, you could you this action to fill the popup with the last name or the SSN. You can specify any database and any TEXT or NUMBER field.
The PopD is actually a 'PopD' resource editor. It behaves identically to .Popup with the exception that you can specify that it should link related fields. Use "Link" to link or anything else to make no link (e.g. "NoLink" or "None").
| $Rsrc.Select
filename $Rsrc.Select crid, type |
||
| Description: | Specifies the resource file that is to act as the source file. | |
| Parameters: | filename: | Specifies the exact file you want to act as the source database. If this parameter is provided, then no file selection dialog is displayed to the user. This option is not used with the crid and type parameters. |
| crid: | The creator ID of the files that the user selects from. This may be the same as the application's. This parameter is not to be used with the filename parameter. | |
| type: | The type ID of the files that the user selects from. This is usually some application-specific type. This parameter is not to be used with the filename parameter. | |
| Example: |
$Rsrc.Select "mySkins" (no
dialog shown, just selects the file "mySkins" for the source database) |
|
This action must be called before any other actions in this library are called. If a Creator ID and Type are provided, then the user will be presented with a list of files matching those parameters. The user may then select a file and tap OK and the actions following this will be executed. If the user taps cancel, then the actions following this command are ignored.
| $Rsrc.Set CID, TID, Attribs, State | ||
| Description: | Allows you to set one or more attributes on an application or database. | |
| Parameters: | crid: | The Creator ID of the file that you want to set attributes for. |
| type: | The Type ID of the file that you want to set attributes for. | |
| Attribs: | A sum of all attributes you want to set (see table below) | |
| State: | Either ON or OFF (case does not matter). | |
| Example: |
$rsrc.Set CRID, appl, 256, ON (hides
the application with creator ID "CRID") |
|
You can use this method to set or reset the attributes of an application or database. You can either turn ON or turn OFF the attributes - so if you have to turn some on, and some off, then it will take two calls of this action. Existing attributes are retained, so, for instance, if you turn on BACKUP, it will not effect READONLY.
| Attribute Name | Numeric Value | Description |
| dmHdrAttrResDB | 1 | Resource database (this should probably never be used) |
| dmHdrAttrReadOnly | 2 | Makes app or database Read- Only |
| dmHdrAttrBackup | 8 | Set if app or database should be backed up to PC on next HotSync. |
| dmHdrAttrCopyPrevention | 64 | This app or database should not be copied to another device. |
| dmHdrAttrHidden | 256 | This app or database will be hidden from the launcher. Can't depend on 3rd party launchers, though. |
| dmHdrAttrRecyclable | 1024 | This database is recyclable. Humm... Don't know... |
The numeric values in the above table can be added together to combine attributes into a single group.
| $Rsrc.SelectOS filename31, filename35[, filename50] | ||
| Description: | Specifies the resource file based on the current Palm OS® version. | |
| Parameters: | filename31: | Used as source database if OS <3.5. |
| filename35: | Used as source database if 3.5 <= OS <5.0. | |
| Filename50: | Optional. If provided, then it's used as source database if OS >= 5.0 | |
| Example: |
$Rsrc.SelectOS "MySkinsBW, "MySkinsColor",
"MySkinsHigh" |
|
Basically, this is similar to the $rsrc.Source action except based on OS version rather than the user selecting the file manually. This action will select one of the provided filenames based on the user's OS version. If less than 3.5, then the first file is selected for use. If the version is 3.5 and less than 5.0, then the second file is chosen. If a third file was provided, it is used when it's OS 5.0 and up.
| $Rsrc.StartForm formID | ||
| Description: | Set the app's startup form ID. | |
| Parameters: | formID: | The ID of the form you want to be the startup. |
| Example: |
$Rsrc.StartForm 1100 |
|
This is used to set the startup form to a different form than is currently using. This action applies only to the calling application. It will not modify resources in another app.
| $Rsrc.Table.Cols tableID, showCols, freezeCols, fieldID1, width1, fieldID2, width2, ... | ||
| Description: | Initializes the set of columns to be used in a scrolling table. | |
| Parameters: | tableID: | The ID of the table you want to define the columns for. |
| showCols: | The number of columns in your table (1 to 5) | |
| freezeCols: | The number of columns that are fixed and do not scroll (0 to 4) | |
| fieldID: | A Field ID (4 characters) | |
| width: | Width of the field in pixels | |
| Example: |
Startup Script |
|
This action provides support for scrolling tables horizontally (by columns). $Rsrc.Table.Cols defines all the columns that are to be in your table. This action should be in your startup script. You can only have one $Rsrc.Table.Cols per table as it generates a "Actf" resource with the table ID as it's ID.
Defining Table Columns
The $Rsrc.Table.Cols action requires the table ID as the first parameter. Then you give it the total number of columns you want to show. This total value must be in the range of 1 to 5 (max). Every table may have 0 or more columns frozen, that is, not scrollable and always in the table. This value must be 0 to showCols-1. A value of 0 would mean that no columns are frozen. The last set of parameters are pairs of Field ID and Column Width for that field. Currently, all scrollable fields should have the same width. Technically, you can vary the width as long as the total of any set of scrollable columns widths is always the same: 20, 40, 20, 40, 20 (any two consecutive columns total 60).
Your table definition as defined in PDAT must match the first n columns of this action.
Scrolling
You scroll by placing two buttons on the form. The one used to scroll the table left should have the $Rsrc.Table.Scroll action specifying the table ID and the word "Left". The one used to scroll the table right should have the $Rsrc.Table.Scroll action specifying the table ID and the word "Right".
When the user taps either button, the 'Tabl' resource is loaded and modified according to the columns defined above.
| $Rsrc.Table.Scroll tableID, direction | ||
| Description: | Scrolls a table left or right | |
| Parameters: | tableID: | The ID of the table you want to define the columns for. |
| direction: | A keyword: left, reset, or right. | |
| Example: |
Startup Script |
|
This action provides support for scrolling tables horizontally (by columns). Once the table has been defined with $rsrc.Table.Cols, you have two buttons/graphics that use the $Rsrc.Table.Scroll actions to scroll the table 1 column to the left or right. The reset keyword is used to reset the columns back to the first column. This action may not be used in the Startup Script.
Defining Table Columns
The $Rsrc.Table.Cols action requires the table ID as the first parameter. Then you give it the total number of columns you want to show. This total value must be in the range of 1 to 5 (max). Every table may have 0 or more columns frozen, that is, not scrollable and always in the table. This value must be 0 to showCols-1. A value of 0 would mean that no columns are frozen. The last set of parameters are pairs of Field ID and Column Width for that field. Currently, all scrollable fields should have the same width. Technically, you can vary the width as long as the total of any set of scrollable columns widths is always the same: 20, 40, 20, 40, 20 (any two consecutive columns total 60).
Your table definition as defined in PDAT must match the first n columns of this action.
Scrolling
You scroll by placing two buttons on the form. The one used to scroll the table left should have the $Rsrc.Table.Scroll action specifying the table ID and the word "Left". The one used to scroll the table right should have the $Rsrc.Table.Scroll action specifying the table ID and the word "Right".
When the user taps either button, the 'Tabl' resource is loaded and modified according to the columns defined above.
| $Rsrc.Table.Filter tableID, PrimaryFieldID, SecondaryFieldID | ||
| Description: | Sets a table's primary and secondary Field ID | |
| Parameters: | tableID: | ID of the table to scroll. |
| PrimaryFieldID: | A field ID using the same rules as in PDA Toolbox. | |
| SecondaryFieldID: | A field ID using the same rules as in PDA Toolbox. | |
| Example: |
$Rsrc.Table.Filter NAME, CATE |
|
This action will change the filtering comparison fields.
| $Rsrc.TableRowColor value | ||
| Description: | Set the color used in tables as the "alternate" color. | |
| Parameters: | value: | Either the word "select" or 0 or a value between 1 and 127. |
| Example: |
$Rsrc.TableRowColor Select |
|
NOTE: This action is available only in OS 3.5 and up.
This is used to set the color used in tables as the alternate row color. If you pass this action the word "Select", then the user will be shown the standard OS color table to choose a color. If zero (0) is passed to this action, then alternating rows is turned off. If a value is passed, then that value is treated as the color.
This action applies only to the calling application. It will not modify resources in another app.
| $Rsrc.tSTR ID, "string", ID, "string"... | ||
| Description: | Creates a string in the source file. | |
| Parameters: | ID: | The ID of the existing or new tSTR resource you want to create. |
| "string": | Quoted string that you want to be in your tSTR resource. | |
| Example: |
$Rsrc.tSTR 2000, "This is a test" |
|
The source file that gets the new resource is either selected or if not selected, then it's the application. Existing strings are expanded and overwritten, new strings are created. You may have several strings specified.
Each string may be a normal double-quoted string with special commands embedded into them. The following table illustrates the commands than may be embedded into the string:
| Parameter Type |
Possible Values |
| text |
All of these items may be embedded in one string: "Zen Master Says \q[QUOT]\q" |
| Purchasing Information |
This program is not Freeware. It is Shareware. This means that you can, and should, try the demo out before buying. Shortly after you register via PayPal, PalmGear, or Handango, you will receive an unlock key that will enable developing with this library.
The cost of this package is US$7.95.
| Support |
You can always contact me at:
email: Rick@SandsUSA.com or at my site http://www.SandsUSA.com.
| Warranty and User License Agreement |
"The Software" is "Runtime Resource Editor Library" aka "PDATRsrc.prc" by Richard R. Sands dba Sands USA.
DISCLAIMER #1 - MUST READ
This product is an "After-Market" utility for PDA Toolbox(tm) and as such, is subject to obsolescence by changes in PDA Toolbox or the Palm OS(tm) itself. This cannot be prevented. I may choose to stop or limit development and support of this product if such situation occurs.
USER LICENSE AGREEMENT
This Agreement sets forth your licensed rights to use "The Software" and is
granted to you upon condition that you accept the terms of this license. Your electronic
indication of agreement, or your use of the program constitute acceptance of all of the
terms of this license.
The program copy and documentation are furnished to make "The Software"
available for your use and remain the property of Sands USA.
IF YOU DO NOT AGREE WITH ANY PART OF THIS LICENSE, DO NOT USE THIS SOFTWARE. Delete
"The Software" and all associated files from all media on which it has been
copied.
LICENSE TERMS AND CONDITIONS
THE LICENSED PRODUCT
"The Software" comprises copyrighted computer programs and utilities for the
reporting of Palm OS(tm) application databases (PRC) created by the PDA
Toolbox(tm) Application Generator. The Licensed
Product in its entirety is protected by US and foreign copyright. YOU MAY NOT
DISTRIBUTE THE LICENSE CODE provided to you.
YOUR USE OF THE LICENSED PRODUCT
General Use. You have the right to use "The Software" with PDAT/Advanced
and to distribute the library file "PDATRsrc.prc" but not
documentation, license codes, or other information about this library. For those purposes, you have the right to install the "The Software"
and any associated files on one (1) computer. Use of "The Software" on a network
or any other arrangement by which its functions are accessible to more than one user at a
time is not permitted.
LIMITATIONS ON USE
General Use Limitations. You have no right to reproduce, transfer, publish or otherwise distribute either
the "The Software" software, or any components or documentation provided.
ALL RIGHTS NOT SPECIFICALLY GRANTED BY THIS LICENSE ARE RESERVED BY SANDS USA.
WARRANTIES, WARNING, DISCLAIMER
Warning and Disclaimer of All Warranties. THE PROGRAM IS FURNISHED "AS IS"
WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, IN ALL JURISDICTIONS WHERE ALL
WARRANTIES MAY BE DISCLAIMED IN THE LICENSING OF INTELLECTUAL PROPERTY.