This document describes the Danger Resource Editor (dre). The resource editor allows you to view and edit resource files using a graphical interface. While you can always edit your resource files with a basic text editor, dre allows you to quickly edit and view your resource file without having to compile your application.

Before reading this document, you should read the information on resource files contained in the drc documentation.

Getting started with dre
dre reads and edits .rsrc files directly. There is no intermediate format, and dre does not read or edit .rdb files. Whether you use dre or not, you still need to use drc to compile your resource files.

To run dre, you will need to use the following .jar files: library.jar, simulator.jar, previewapp.jar, and either dre13.jar or dre14.jar. dre requires JDK 1.3 or later, but is best used with JDK 1.4 or later. Use dre14.jar if you are running JDK 1.4 or later; use dre13.jar if you only have JDK 1.3. The JDK 1.4 version allows dre to save preferences, which will make it easier to use dre. If you are running JDK 1.3, you can set some of these preferences on the command-line instead. (Need to tell them how to do so...need section on preferences)

NOTE: should embed network.disable and network.autolaunch settings in app, rather than have them passed on command line.

To run dre, simply execute:

java -classpath {4 jar files as listed above} tools.dre.ResourceEditor
NOTE: maybe should put tools.dre.ResourceEditor in manifest file?

You can also pass in other arguments on the command line, but we'll explain those later. NOTE: need section on other args.

dre windows
When you first start dre, you will see two windows. One of the windows should look familiar -- it is basically the simulator window. This Preview Window will be used to display previews of resources. The other window is an Rsrc Window -- a view of an empty .rsrc file. You can either use it to create a new .rsrc file, or open an existing .rsrc file by using the Open command from the File menu.

If you close the Preview window or all of the Rsrc windows, dre will quit. Alternatively, you can select Exit from the File menu to quit.

Each Rsrc Window has 4 basic components.

On top is a menu bar which lets you do things like create or delete resources.

On the left is a table which lists all the different types of resources (strings, bitmaps, menus, alerts, etc.) and a summary of what's in this .rsrc file. For each resource type it lists the number of resources and the amount of space those resources will take up in the .rdb file. Click on a resource type to view those resources.

On the right is a table which lists all the resources of the selected resource type. For each resource, the resource key is listed, as well as how much space the resource will take up in the .rdb file. Click on an individual resource to view or edit that resource.

On the bottom is the editing panel. This is where you can edit the resource. For sound and sequence resources, this panel will also let you hear the resources (click the Play button). For bitmap resources, this panel will display the bitmap.

When you select an individual visual resource (bitmap, menu, alert, etc.), that resource will be displayed in the Preview window, exactly as it will appear on the device. If you modify a resource in the editing panel, the Preview window will usually be updated automatically. If you need to manually update the Preview window, select the Preview menu item. Sound, sequence, string, string array, and data resources are not displayed in the Preview window. If you click on the Preview window, you can use the same keys as you use with the simulator to interact with the Preview to see how the resource behaves.

Editing Panel
Currently, the editing panel does not let you edit dialog or screen resources. You will have to use a text editor to edit those resources. As a convenience, dre provides a Reload function. If you are editing dialog or screen resources, this will come in handy. Open your .rsrc file with dre. Then open the same .rsrc file with a text editor and edit your dialog and screen resources. Back in dre, select the Reload menu item. You'll now be able to preview the dialog and screen resources that you edited with your text editor.

Editing string resources: blah blah blah.

Editing menu resources: blah blah blah.

Editing alert resources: blah blah blah.

NOTE: say something about preserving comments in .rsrc files. Maybe try to preserve whitespace within resources?