CompositeClass Meta-Tag
See Also: Class Meta-Data Tags
Purpose
The CompositeClass setting is used to connect two or more classes that are conceptually bound together in operations. For example, it is used to assign a tab page class to a tab dialog class, and by Studio designers to determine which class to use when placing tab page objects inside tab dialog objects.
Syntax
{ CompositeClass={CompositeClassName} }
where {CompositeClassName} is the name of the associated composite class.
Use
CompositeClass is used to assign a child object class to a parent container object class. This is utilized by the Studio's Visual Designer whenever creating certain composite classes, made up of a parent container object with child objects inside that parent object.
For example, if a new TabDialog subclass is created and you want that class to use a new TabPage class, you would set the class name using CompositeClass. When the Studio creates new tab page objects, it will use this new class.
Classes Using the CompositeClass Tag
| Parent Container Class | Child Object Class |
|---|---|
| cCJGrid | cCJGridColumn |
| cScrollingContainer | cScrollingClientArea |
| cSplitterContainer | cSplitterContainerChild |
| cDbCJGrid | cDbCJGridColumn |
| cDbScrollingContainer | cDbScrollingClientArea |
| cDbSplitterContainer | cDbSplitterContainerChild |
| dbTabDialog | dbTabPage |
| dbTabDialogView | dbTabView |
| TabDialog | TabPage |
Example
If a developer creates custom tab dialog and tab page classes, named cMyTabDialog and cMyTabPage, respectively, and wants the Studio to use objects of class cMyTabPage whenever adding tab pages to objects of class cMyTabDialog, the developer can place the CompositeClass meta-data tag above the class declaration line and set it to cMyTabPage.
{ CompositeClass=cMyTabPage }
Class cMyTabDialog is a cTabDialog
End_Class
Use in Grids
CompositeClass is also used by the CodeJock grid classes to determine which grid column class to use when dragging columns from DDO Explorer onto the grid in the Visual Designer.
Example
{ CompositeClass=cMyGridColumn }
Class cMyGrid is a cDbCJGrid
End_Class
This would ensure that when columns are dropped onto a cMyGrid object in the Visual Designer, the class used to create the columns would be the cMyGridColumn class.
Of Special Note
The CompositeClass class meta-data tag is inherited. If a superclass is assigned a particular composite class, any subclasses of that class will use the same composite class.