|
|
发表于 2006-10-30 17:49:07
|
显示全部楼层
|
<p>更详细的原文如下:</p><p>A <b>Type Definition</b> can have a different name, description, default value, size, color, or style of control (such as a knob instead of a slide), as long as the <u>data type</u> matches the master copy of the control. A type definition only identifies the correct “type” for each instance of a custom control. The “type” does not include things like data range for a numeric controls, or item names in a ring control. So if you change the data range on a numeric control or an item name on a ring control that are part of a type definition control, it will <u>not</u> change these properties on all instances of the control. However, if you change the item name in a type definition for an enumerated type (enum), all instances change as well, since the item name is part of the “type” for an enum. You can also use normal property nodes with type definitions as you would with a non-custom control.<br/><br/>A <b>Strict Type Definition</b> forces almost everything about the control to be identical, including its size, color, and appearance. Strict type definitions are more restrictive and unlike general type definitions, they define other values, such as range checking on numeric controls and item names on ring controls. The only flexibility to a strict type definition is the name, description, and default value which all can be different for separate instances of the same control. The only properties available for a strict type definition control are those that affect the appearance of the control such as Visible, Disabled, Key Focus, Blinking, Position, and Bounds. For example, if you have a strict type definition which is made up of a cluster of various controls, properties for each individual control would not be available. Only appearance properties for the overall custom control would be allowed.<br/><br/><u>Additional Note:</u> Most programmers use type definitions and strict type definitions to create a custom control using a cluster of many controls. This way, if they want to later add a new control and pass a new value to every subVI, adding the new control to the custom control can easily accomplish this. This saves the programmer from having to add the new control to each subVI’s front panel and making new wires and terminals. <br/></p> |
|