Resource
The resource group provides the facility for compiling multiple resources into a single resource file. The resource file would typically be merged with an application or library binary (.exe or .dll), and then used by an application at run time for the creation of resources like dialogs, and icons.
The resource group supports the console part of the capability for an application resource compiler. Using SGMLParse it is possible to create resource files, by collating images and text. By adding context to this information in the SGML resource file, it is possible to build the following entities for use in applications;
- Images
- Image swatches
- Commands
- Menus
- Toolbars
- Controls
- Property pages
- Property groups
- Dialogs
- Document templates
- Window templates
Typically these resource items are nested. A command, for example, consists of a command id, a reference to an image swatch item, and a menu text string. Menus consist of commands. Dialogs consist of controls and property groups.
In addition resources may be inherited, so the resources of a library module can be inherited and extended by an executable module.
A resource binary is manufactured from an SGML resource file using VRC, the Solid Fluid resource compiler. VRC automatically creates a header file that can be included in the application project. Whilst running the VRC checks for conflicts in identifier names to ensure they are unique. Commands support accelerator and shortcut keys, and these too are tested for conflicts.
The binary produced is then included in the executable module or dynamic link library, by the use of the C++ compiler's own resource compiler.
When the compiled application starts the base application object knows about resources and loads them. Once the application is running, menus, dialogs and images can be loaded and placed on the desktop in just a few simple function calls.
|