Access Graphical Properties and Methods Using the Editor Object

About Editor Objects

The Editor object provides access to the purely graphical properties and methods of Chart objects. Each Chart object has its own Editor object.

Access the Editor Object

You cannot directly create or destroy the Editor and Clipboard objects as you do other Stateflow® API objects. However, you can attach a handle to them to use their properties and methods for modifications to Stateflow charts.

When you create a chart, an Editor object is automatically created for it. If ch is a workspace handle to a chart, you create a handle to the Editor object for that chart with this command:

ed = ch.Editor;

Change the Display in the Stateflow Editor

Use the handle ed from the preceding example to access the Editor object properties and methods. For example, this command calls the zoomIn method to zoom in the chart by a factor of 20%:

ed.zoomIn;

Or, you can simply set the ZoomFactor property to an absolute zoom factor of 150%:

ed.ZoomFactor = 1.5;

You can also use an Editor object to change the window position of the Stateflow Editor. For a reference to all the Editor object's properties and methods, see Stateflow.Editor Properties and Stateflow.Editor Methods.

Was this topic helpful?