WinStudio

About the Diagram Component

The Diagram toolset component uses the Nevron Diagram application to create drag-and-drop diagram tasks and then interact with them via event handlers and scripting APIs. For a complete set of Nevron Diagram for .Net documentation, see the Nevron web site.

Component Properties

When you add a Diagram component to a form, set the following diagram-specific options using the Data Source - Binding property of the component.

Type

Choose between Manual and Automatic.

Background Style and Style Sheets

The visual appearance of all diagram elements is controlled with styles. Define style sheets at the diagramming document level, then assign them to shapes on the diagram to control their appearance. Your choices include Bridge, Start/End Arrowhead, Shadow, Stroke, and Text.

Design Mode Options

The Diagram component creates two button-based toolbars.

Design Mode Toolbar

Button Description
Grid Enable/disable diagramming area grid.
Rulers Enable/disable horizontal/vertical rulers.
Library Browser Enable/disable shape library browser.
Ports Show/hide shape ports.
Arrowheads Show/hide connector arrowheads.
Shadows Show/hide shape shadows.
Pan and Zoom      Enable/disable Pan and Zoom control.
View Layout Diagram viewing layout option:
  • Normal
  • Fit
  • Stretch
  • Stretch-to-Width
  • Stretch-to-Height
Undo / Redo Undo/redo previous action(s).

Runtime Toolbar

Button Description
Print Setup Display print setup dialog.
Print Directing the current diagram to a printer.
Copy to Clipboard       Copying the current diagram to clipboard.
Save to Image Saving the current diagram as image.
Pan and Zoom Enable/disable Pan and Zoom control.
View Layout Diagram viewing layout option:
  • Normal
  • Fit
  • Stretch
  • Stretch-to-Width
  • Stretch-to-Height
Auto-Layout Type IDO collection-based flowchart's auto-layout option:
  • Graph - Barycenter
  • Graph - Spring
  • Graph - Symmetrical
  • Graph - Layered (Default)
  • Graph - Orthogonal
  • Graph - Radial
  • Graph - Single Cycle
  • Tree - Layered
  • Tree - Compact Depth
  • Tree - Tip-Over
  • Tree - Balloon
  • Cells - Stack
  • Cells - Flow
  • Cells - Table
  • Cells - Dock
Auto-layout Direction Layout direction option:
  • Top-to-Bottom (Default)
  • Left-to-Right
  • Bottom-to-Top
  • Right-to-Left
Undo / Redo Undo/redo previous action(s).

Right-click Menus

The diagram, as a whole, as well as the individual shapes within the diagram, can have right-click menus assigned to them.

To set the right-click menu for the diagram:

  1. Enter Design Mode.
  2. Select the diagram component, which open the form property sheet.
  3. In the Right-Click Menu field, select the menu type to assign to this component.

To set the right-click menu for shapes within the diagram:

  1. Double-click the shape. The Properties form displays.
  2. Select the Data tab.
  3. In the Right-Click Menu field, select the menu type to assign to this component.

Scripting API for the Diagram Component

API Description
DiagramApplyStyleSheetAt Apply a specified style sheet for the specified shape.
DiagramGetSelectedShapeTagItem Return a tag item dictionary (name-value pairs) defined for the currently-selected shape.
DiagramShowShapeLibraryBrowser      Show the shape library browser.
DiagramHideShapeLibraryBrowser Hide the shape library browser.
DiagramAddShapeLibrary Add the specified shape library (for example, Flowchart Shape Library) into the library browser.
DiagramRemoveShapeLibrary Remove the specified shape library (for example, Flowchart Shape Library) from the library browser.
DiagramHideShape Hide a specified diagram shape. If the shape has connector(s), they are also hidden.
DiagramShowShape Show a hidden diagram shape. If the shape had connector(s) hidden, they become visible if both of their start/end points are visible.
DiagramUpdateIdoObjectProperty Update the specified IDO collection item property with the current diagram data (XML and/or binary).
DiagramLoadFromIdoObjectProperty      Load the diagram component from the specified IDO collection item property (XML and/or binary).
DiagramSaveToFile Save the current diagram into a file (XML and/or binary).
DiagramLoadFromFile Load the diagram from a file (XML and/or binary).

Related Topics

Add a Component to a Form