Similar to the way you add functions to the Designer, you can also define your own object types and register them in List & Label. The user can access the new objects in the usual way on the left toolbar and menu.
Here there is also a special component for adding objects. To use this, you must include the file cmll30ox.ocx in your IDE.
After adding this component to your form, you can define the properties of the new object in the Properties window of the component.
The table provides an overview:
Property |
Description |
Name |
The unique name of the object. |
Description |
This description appears in the Designer. It is allowed to contain spaces but should not be more than 30 characters long. |
Icon |
The icon of the object that will be shown in the toolbar and menu in Designer. It should be a 16x16 pixel, 16-color icon. |
The component has three types of events. First, the DesObj_Picture_CreateDesignerObject event is triggered when the user creates a new object. If desired, you can have an initial dialog appear on the user's screen. For example, this can be a wizard that helps the user to more easily configure the new object. If it is not necessary to use this in a particular case, simply skip handling the event.
The DesObj_Picture_EditDesignerObject event is triggered when the user double-clicks the newly inserted object or selects "Properties" from the context menu.
After you are finished editing the object, you are prompted by List & Label to show the object. The DesObj_Picture_DrawDesignerObject event is triggered for this purpose. Using the usual methods, you can now draw in the workspace. Here, of course, it is also possible or useful to access the stored object properties.