DesignerClass Meta-Tag
See Also: Class Meta-Data Tags
Purpose
Used to assign a class to a designer class, which, in turn, is used by Studio designers to determine how to represent a class.
Syntax
{ DesignerClass={DesignerClassName} }
where {DesignerClassName} can be represented visually as one of:
cDTAnimation: an animation control classcDTButton: a button classcDTCheckBox: a checkbox classcDTCJCommandBarSystem: a CodeJock command bar system classcDTCJContextMenu: a CodeJock context menu classcDTCJMenuBar: a CodeJock menubar classcDTCJMenuItem: a CodeJock menu item classcDTCJToolBar: a CodeJock toolbar classcDTCJStatusBar: a CodeJock statusbar classcDTCJStatusBarPane: a CodeJock statusbar pane classcDTClientArea: a client area classcDTComboForm: a combo form classcDTComControl: a COM class — this is typically assigned to COM classes.cDTComDocument: a COM embedded document class — this is typically assigned to COMcComDocumentObjectclasses.cDTContainer3D: a container classcDTEdit: a text edit classcDTForm: a form classcDTGrid: a grid classcDTGroup: a group classcDTLineControl: a line control classcDTListBox: a listbox classcDTMDIPanel: a MDI main panel classcDTModalPanel: a modal panel classcDTProgressBar: a progress bar classcDTRadio: a radio classcDTRadioGroup: a radiogroup classcDTSpinForm: a spinform classcDTTabDialog: a tab dialog classcDTTabPage: a tab page classcDTTextbox: a textbox classcDTToolPanel: a tool panel classcDTTrackbar: a trackbar classcDTTreeView: a treeview classcDTView: a view class
Use
This meta-data tag can be set to assign a particular representation to a class in the Studio's visual designer.
In most cases, developers will not need to set this tag. Here are some rules of thumb about when to set the DesignerClass tag:
- If a developer subclasses an existing modeled class, they will not need to specify a designer class, because it will be inherited from the modeled superclass, and thus behave like that superclass when modeled.
- If a developer imports an ActiveX or other COM control, they will not need to specify a designer class, because the visual appearance will be picked up from the COM control.
- The only time a developer might need to specify a designer class is if they are wrapping some kind of DLL common control in a class. The two most likely classes that such a class will be based on are
DfBaseControlandcWinControl. When doing this, there is no way to get an accurate visual representation of the control, because the Studio doesn't know anything about the control. The developer will want to pick the simplest design-time class that comes closest to representing the control. Typically, this would becDTForm,cDTEdit, orcDTListBox, which are all just variants of a rectangle. The main things this will allow the Studio to model for these controls will be size, location, color, and text color.
Most of the designer class acquired through class inheritance will provide the best results.
Note that this is used to assign the most appropriate Visual Designer control to a class. When the Visual Designer attempts to display an object, it will base it on the assigned designer class. If you use this tag, assign the designer class that best represents your class. Creating mismatches, such as assigning a cForm to a cDTButton, will only result in incorrect modeling.
Some classes are "composite classes," which are two or more classes that are conceptually bound together in operations. For example, tab pages that are children of a tab dialog. See the CompositeClass class meta-data tag for details.
Example
To indicate that a class should be represented as a list box control in the Studio's visual designer, add the DesignerClass meta-data tag above the class declaration line and set it to cDTListBox.
{ DesignerClass=cDTListBox }
Class cMyCustomControl is a cWinControl
End_Class // cMyCustomControl
Of Special Note
The DesignerClass class meta-data tag is inherited. If a superclass is assigned to a particular designer class, any subclasses of that class will be assigned to the same designer class.
A special DesignerClass constant "None" is also available. This is used to suppress error messages when dialog objects that are not intended to be modeled exist inside other panels that are visually modeled. Notably, this suppresses error messages related to the AboutDialog object declaration inside a Panel object.