Save your own project symbols
A symbol is a set of one or more screen objects that is saved in the Symbols library, so that you can reuse it in your projects.
Every time you reuse a symbol, you actually make a copy that is linked to the master symbol in the Symbols library. (These linked copies are also called “instances” of the symbol.) Thereafter, if you make any changes to the master symbol, those changes automatically propagate to every linked copy in every project.
You can customize each linked copy of the master symbol by defining Custom Properties. For example, when you create a gauge that displays tank levels and then save that gauge as a master symbol, you can define custom properties on the symbol that will allow each linked copy to display the level of a different tank.
Create a master symbol
To create a master symbol and save it to the Symbols folder:
- Design your symbol just as you would normally draw a project screen, using any combination of Static and Active Objects. For example, three check boxes in a rectangular pane:
Figure 2. Drawing objects in a project screen
- Select the object(s) or Group that you want to save as a symbol.
Figure 3. Selecting the objects
Note: It is not necessary to make a Group out of two or more objects before saving them as a symbol. Saving the objects together as a symbol effectively groups them.There is a situation, however, where you may want to group the objects first. A symbol can have only one hint. If more than one object has a hint configured on it (in the Object Properties), those hints are not shown when the objects are saved together as a symbol. To specify a hint for the symbol as a whole, you must first group the objects and then configure the hint on the Group. That hint will carry through when you save the Group as a symbol.
- Right-click on the selection, and then click Create Linked Symbol on the shortcut menu.
Figure 4. Creating a linked symbol
- A standard Save As dialog box is displayed, and you are prompted to give the new symbol a file name. Symbol files (*.sym) are saved in the Symbol folder of your project.
Figure 5. Saving the symbol file
- Click Save to save the file. The symbol appears in the Project Symbols folder, in the Graphics tab of the Project Explorer.
Figure 6. Symbol file in the Project Explorer
The symbol also appears in the Project Symbols folder of the Library.
The symbol is now ready to be reused in your project, but the way it is currently saved, every copy will have identical properties. You must now define custom properties on the symbol — that is, the properties you want to be able to customize each time you reuse the symbol.
Edit the master symbol
You can edit a master symbol after you’ve initially saved it, to add or delete objects in the symbol or to define custom properties on it. Remember that any changes you make to the master symbol will automatically propagate to every linked copy in every project.
- Right-click on the symbol file in the Symbols folder, and then choose Edit from the shortcut menu.
Figure 7. Editing the symbol file
Tip: You can also right-click on any instance of the symbol and choose Edit Linked Symbol from the shortcut menu.The symbol file is opened for editing in its own window. This symbol editor works in the same way as a regular screen editor, except that every object in the window is part of the symbol. If you add, move or delete objects in the symbol editor, you may change the size or shape of the symbol and disrupt the layout of any Screens where it is used.Figure 8. Symbol file opened for editing
Besides adding, moving or deleting objects in the symbol, you can also edit the Object Properties as you normally would. You may want some properties to be the same in every instance of the symbol, but other properties need to be customized according to where and how the symbol is used. In this example, you probably want to customize the captions for the three check boxes, the tags with which the check boxes are associated, and the caption for the pane itself.
- Select the first object in the symbol and open its Object Properties. For example, the first check box:
Figure 9. Object Properties dialog box for the first Check Box object
- In any field where you would normally configure a tag, expression, or value, you can instead define a custom property using the sytax…
#[Category.]Property:[Value]
…where:- Category is an optional name for a collection of related properties, such as all captions or all Check Box values. If you do not specify Category for a property, it will be automatically listed under the “Main” category.
- Property is a label to identify the specific property. Property is required for each property, and it must always be followed by a colon (:).
- Value is an optional default value for the property.
Note: All Tag/Expression syntax rules apply to Value, including tag names, pointers, arrays, strings, numerical and boolean values, and scripting functions.
In the following example, we want to be able to customize which tag will be set when the Check Box is selected or cleared. So, in the Tag field, type #Option1.Tag: as shown.Figure 10. Defining a custom property for the Tag property
When you go to complete the properties on an instance of the symbol, #Option1.Tag: will appear like this:Figure 11. Custom properties on a symbol
But more about that later…
- Depending on the context, some object properties require a specific type of value like a String, a Boolean or a numerical value. For these properties, you must enclose the custom property declaration in curly brackets ({}).
In this example, the Caption field requires a String, so type {#Option1.Caption:”Option 1″} as shown.Figure 12. Defining a custom property for the Caption property
Again, when you go to complete the properties on an instance of the symbol, they will appear like this:Figure 13. Custom properties on a symbol
- Repeat steps 2 through 4 as needed, to define the rest of the custom properties on the symbol.
In this example, the finished symbol has all of the following properties:Figure 14. Custom properties on a symbol
- Save the symbol and close the symbol editor.
- On the Home tab of the ribbon, in the Tools group, click Verify. This will update all existing instances of the symbol in your project.
Add tooltips to custom properties
Password protect a symbol
You can put a password on any of your user-made symbols to prevent them from being edited or analyzed by other users. To protect a symbol:
- In the Symbols folder, right-click on the desired symbol file (.sym) and then choose Password Protection from the shortcut menu. A Password Protection dialog box is displayed.
- In the New Password field, type your password.
- In the Confirm Password field, type your password again.
- Click OK.
Once this is done, you will be prompted for the password whenever you attempt to edit the symbol or unlink an instance of the symbol.
Make a user-made symbol available to other projects
- In the Symbols folder of the Project Explorer, right-click the desired symbol file ( .sym ) and then choose Send to System Symbols from the shortcut menu. A standard Save As dialog box is displayed, automatically pointing to the Symbol sub-directory of the IWS program directory instead of the Symbol sub-folder of your project folder.
Figure 17. Saving a symbol
- Choose a location in which to save the symbol file. You can choose one of the existing categories/folders, or you can create a new one.
- Click Save. The symbol file is saved in the specified location and the symbol is displayed in the System Symbols folder of the Symbols library.
Figure 18. Saving a symbol
For more information, see Using the Library.
Insert a symbol in a project screen
To insert a symbol in a project screen and then complete its custom properties:
- Open the desired project screen from the Screens folder, or insert a new screen. The screen is opened for editing.
- Open the Symbols Library by doing one of the following:
- On the Graphics tab of the ribbon, in the Libraries group, click Symbols;
- Double-click Symbols in the Project Explorer; or
- Right-click in the screen where you want to insert the symbol, and then click Insert Linked Symbol on the shortcut menu.
- Select the symbol from the Symbols Library, and then click in the screen:
Figure 19. Symbol placed in a project screen
Once the symbol is inserted, you can manipulate it like any other object in the screen. You can align and distribute it with other objects, and you can apply Animations to it. However, the first thing to do is complete the custom properties for this instance of the symbol.Figure 20. Object Properties dialog box for the symbol
- Open the Object Properties for the symbol.
- Click Expand to open the Symbol Properties dialog box.
Figure 21. Symbol Properties dialog box for the symbol
To see all of the properties at the same time, select the Display properties from all categories check box.Figure 22. Displaying properties from all categories
- Enter the property values as needed. In this example, the three check boxes are used to determine whether to alert Tom, Dick and/or Harry. The captions are updated accordingly, and the check box tags are configured with the first three elements of a Boolean array called AlertOptions.
Figure 23. Completed properties for the symbol
- Click OK to close the Symbol Properties dialog box, and then close the Object Properties dialog box.