Example: Object Inserted and Smart Object

Object Insert and Smart Object events can create greatly increase the ability for a screen designer to create powerful CimView screens with a minimum of effort. This is because actions, including opening dialog boxes that ask for values can now be triggered on the CimEdit screen and used for design purposes.

Although the Object Explorer library contains several Smart Objects, a designer may request Smart Objects that more specific to their design. Following is a simple example showing how Smart Object and Object Inserted events interact with other object configuration and how they can be easily scripted.

This example creates a rectangle that will display a fill during runtime. The rectangle becomes a Smart Object with a Smart Object event because the fill will reflect the value of a point that can be specified when the Smart Object is placed in CimEdit, during a CimEdit session and then, in CimView.

 Tip: To protect your named Smart Object from being decomposed, you can save the CimEdit screen as a runtime-only screen (.cimrt). As a result, another designer will be able to link the protected Smart Object, but not copy it or view the code.

Procedures for the following steps will create the Smart Object with the Smart Object and Object Inserted events.

Step 1

Configure the basic object to fill during runtime.

Step 2

Turn the object into a Smart Object with a Smart Object event.

Step 3

Create an Object Insert event.

Step 4

Place the Smart Object in the Object Explorer Library.

Step 5

Test using the Object Insert event.

Step 6

Test using the Smart Object event in CimEdit.

Step 7

Test using the Smart Object event in CimView.

More information

Object events overview.

Available events.