company logo

Defining component resources

In order to define GUI components, i.e. resource collections for being copied to other projects, component resources might be defined. In order to define components, several component resource objects have been defined.

In order to define components, the component definition dialog may be opened via the Designer's or ClassEditor's main menu item Objects/Components:

Components can be created or selected in the list (left side). The right side displays the definition which contains a short description of the component. The Description should contain at least a short description of the components functionality, specific requirements for the components and some hints how to use the components within an application. The second page contains the details for the component definition:

Component definitions consist of a number of resource references. When defining a component as implicit (top right), dependent resources for all referenced resources are copied automatically. The component installer tries to copy as less as possible. Resources, which do already exist in the target database, will not be overwritten.

When context classes defined for component or related resources are implemented in C++ or C# and are also available as OSI classes, the OSI option should be switched on. This allows requesting the OSI implementation when installing the resource. For defining an OSI version for the component, OSI functions have to be provided in an active namespace OSI_IF using the same name as the original class name.

In order to add a resource to a component, select the resource type to be included and select Insert from the context menu. Depending on the component type a component specific insert dialog pops up:

Most components simply allow selecting a global resource (e.g. event action control). Components referring to classes are, however, a bit more complex.

In order to delete a referenced resource, select the resource in the resource tree (right side) and press del or use the context menu action.

Notes:

In ODABA 11 components did not get an inverse reference for referenced resources. Thus, changing names for global resources referenced as components may result in invalid indexes, i.e. the component index will still display the old resource name. This does not cause problems in using the component but might be confusing when maintaining the component. The problem might be solved by calling RepairKey (OSI function) for the invalid reference.