Development/Resources

This page describes how to add new resources to a project. It has been written during the work on bug.

Creating resource files
First, we've to create resource files to handle our images. Resource files are splitted in two parts: the  and the. The former will be included in  files and contains resource ID assignments, while the later describes each resource (string, image).

Since each resource must have a unique ID, you have to find the file containing global resource IDs for the module you're working on, it's a .hrc often located in. For calc it's, for writer. Find the last affected ID range and get the next one. You have to add a define,   (which are the same) and   which will be

Then, you can add your own, here is an example:

And the  describing resources in details:

Then, you can add the .src to the  your makefile. Create  if it does not exists.

Add the .srs to the variable  variable of your module's , put your images in   and launch a build, all should be fine.

Accessing your images
If you are performing an incremental build you've to  to get images packed correctly.

Loading an image is as simple as  (the prefix before   varies between modules).