MATLAB Report Generator    

Creating a New Attribute

You can create a new attribute by editing getinfo.m. This methods file contains information on component attributes and how they are displayed in the component attribute page (shown in the Options tab of the Setup File Editor).

All attribute information for a component is taken from out.att.XXX and out.attx.XXX lines in getinfo.m. The out.att.XXX lines are attributes and the out.attx.XXX lines are UI options. The out.attx.XXX lines are optional; they do not need to be included in getinfo.m. If you do not include them, default UI controls are used for the attribute.

Finding Attributes and Their Default Values

Find the following section in getinfo.m.

This section shows that there are two attributes.

Adding a New Attribute and Default Value

Create another attribute called isVisibleAxes. This attribute determines whether the figure axes are visible. The attribute will have a default value of logical 1 (axes on).

To complete this task, add the following line to this section.

Specifying Attribute Name, Data Type and UI Control

To specify attribute name, data type, and UI Control, (corresponds to Att. name, Data type, and Control type fields in the Component Attributes page), find the following section in getinfo.m.

Attribute Name.   out.attx.isVisibleAxes.String is the name of the attribute as it appears in the Setup File Editor (corresponding to the Att. name field of the Component Attributes page in the Component Creation Wizard).

To create the attribute name for isVisibleAxes called 'Make figure axes visible', add the following line to this section.

Attribute Data Type.   out.attx.isVisibleAxes.Type is the data type of the attribute (corresponds to the Data type field of the Component Attributes page in the Component Creation Wizard).

To specify the data type for isVisibleAxes to be logical, add the following line to this section.

LOGICAL sets the data type to be a logical or Boolean number.

Attribute UI Control.   out.attx.isVisibleAxes.UIcontrol is the type of UI control for the attribute (corresponding to the Control type option of the Component Attributes page in the Component Creation Wizard).

To specify the UI control for isVisibleAxes to be a check box, add the following line to this section.


  Using the New Component Creating Another Attribute