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.

Creating Another Attribute

Create another attribute called AxesColor, which lets the user choose one of four colors for the axes: white, green, red and blue. The default color will be white. The name of the attribute, as is appears in the Setup File Editor, will be Color of Axes.

To do this task, add the following lines of code to getinfo.m (comments are preceded by `%' and are optional).

Note that out.attx.AxesColor.UIcontrol and out.attx.AxesColor.Type are not specified here. A default UI control and data type are used, according to the default value.

Changing a Previously Created Attribute

You can change a field for any attribute that you create by editing the getinfo.m.

The slider created for NumLines has a range of -inf to inf.

A slider by default has a range of: [-inf +inf]; it guesses about the range. Change the slider range to [1 10] (minimum and maximum number of lines).


 Using the New Component Changing the Outline String