Using the Symbol Editor > Getting Started with the Symbol Editor > Transforming Symbols using Parameters > Adding Flexibility using Parameters

By default, an object uses static values to control its size. For example, the progressbar object created in Working with Symbols has a minimum width of 0 and a maximum width of 120. The transformation added in Transforming an Object still leaves the maximum at 100. To create re-usable symbols, the best practice is to use parameters to control size. This way, the size of a symbol can be easily adjusted for inclusion in a symbol with different dimensions.

To add flexibility to the basicprogressbar symbol, do the following:

  1. Open the basicprogressbar symbol.
  2. Create a new Integer parameter, maxwidth, with a default value of 100. For more information, see Creating a New Parameter.
  3. Create a new Integer parameter, minwidth, with a default value of 0. For more information, see Creating a New Parameter.
  4. Select the progressbar object in the Symbol Outline pane.
  5. Click the Transform tab in the Styling Customizer.
  6. Click the Bind button next to the Width field. The Transform Element Using Parameter dialog box opens.
  7. Select maxwidth in the Parameter Max list.
  8. Select minwidth in the Parameter Min list.

images/diasym_bindtransformation.png

Figure 1.26 Binding a Transformation to Parameters
  1. Click OK.

Note
The width of a transformed object is calculated in function of the Parameter Max, Parameter Min, Value Max, and Value Min parameter values set in the Transform Element Using Parameter dialog box. If you take the value of Parameter Max to represent 100% of Value Max, the basicprogressbar symbol will expand to the width Value Max in function of the value of Parameter Max. That is, when the progress parameter has a value of 100, the basicprogressbar will be 120 pixels wide.

You can now set the maximum width for this object by changing either the default or the dynamic value of the maxwidth parameter.