Skip to content

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 class
  • cDTButton: a button class
  • cDTCheckBox: a checkbox class
  • cDTCJCommandBarSystem: a CodeJock command bar system class
  • cDTCJContextMenu: a CodeJock context menu class
  • cDTCJMenuBar: a CodeJock menubar class
  • cDTCJMenuItem: a CodeJock menu item class
  • cDTCJToolBar: a CodeJock toolbar class
  • cDTCJStatusBar: a CodeJock statusbar class
  • cDTCJStatusBarPane: a CodeJock statusbar pane class
  • cDTClientArea: a client area class
  • cDTComboForm: a combo form class
  • cDTComControl: a COM class — this is typically assigned to COM classes.
  • cDTComDocument: a COM embedded document class — this is typically assigned to COM cComDocumentObject classes.
  • cDTContainer3D: a container class
  • cDTEdit: a text edit class
  • cDTForm: a form class
  • cDTGrid: a grid class
  • cDTGroup: a group class
  • cDTLineControl: a line control class
  • cDTListBox: a listbox class
  • cDTMDIPanel: a MDI main panel class
  • cDTModalPanel: a modal panel class
  • cDTProgressBar: a progress bar class
  • cDTRadio: a radio class
  • cDTRadioGroup: a radiogroup class
  • cDTSpinForm: a spinform class
  • cDTTabDialog: a tab dialog class
  • cDTTabPage: a tab page class
  • cDTTextbox: a textbox class
  • cDTToolPanel: a tool panel class
  • cDTTrackbar: a trackbar class
  • cDTTreeView: a treeview class
  • cDTView: 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 DfBaseControl and cWinControl. 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 be cDTForm, cDTEdit, or cDTListBox, 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.