Defining Double-Click Actions for Shapes

3 4

An easy way to make a shape smart is to have it do something when you double-click it. For most Visio shapes, the built-in double-click behavior is to open the shape's text block so that you can type. However, Visio provides several options that you can specify with the Behavior command on the Format menu, as Figure 25-8 shows. For example, you can configure a shape so that the Report dialog box opens when you double-click the shape.

Tip


You can add double-click behavior to objects from another application that you've linked or embedded in Visio. The OLE Verb option in the Behavior dialog box is available only when you select a linked or embedded object.

figure 25-8. on the double-click tab, you can define what will happen when the shape is double-clicked.

Figure 25-8.  On the Double-Click tab, you can define what will happen when the shape is double-clicked.


Displaying a Help File for a Shape

One of the double-click behaviors that you can define for a shape is Display Help. This option is really designed for professional shape developers who want to link shapes to custom Windows help files (.hlp or .chm files). If you fall into this category, you must identify the help file and a topic in that file using the following syntax:

filename!keyword or filename!#Number

Filename is the name of the help file, such as MyShape.hlp or MyShape.chm. To locate a specific help topic in the file, you can specify either a keyword that is associated with the topic, or the ID number that is referenced in the MAP section of the help project file.


Follow these steps to set a shape's double-click behavior:

  1. Select the shape that you want to change.
  2. Choose Format, Behavior, and then click the Double-Click tab.
  3. Choose the action you want to happen when the shape is double-clicked. See Table 25-4 for a list of options and what they do.
  4. Click OK.
  5. To test the new behavior, double-click the shape.

Troubleshooting

The Custom option is not available, or nothing happens when you select a double-click action.

If the Custom option is selected but appears dimmed, the shape already includes a custom double-click formula, which is defined in the ShapeSheet window. If you select a new option on the Double-Click tab, you can overwrite the custom behavior. However, if a custom formula is protected (such as by the GUARD function), specifying a different behavior on the Double-Click tab will have no effect. Visio ignores your setting when you click OK. No error message appears; your change is simply not implemented.


Table 25-4. Double-Click Options for Shapes

Option Description

Perform Default Action

Choose this option to use the default double-click action defined for the shape.

Perform No Action

Choose this option to remove double-click behavior from the shape.

Edit Shape's Text

Choose this option to open the shape's text block with the insertion point.

Open Group In New Window

Choose this option to open the group in the group editing window. This option is available only if you select a group. It has the same effect as choosing Edit, Open Group.

Open Shape's ShapeSheet

Choose this option to display the ShapeSheet window for the shape.

Custom

This option indicates when a custom formula has been defined in the ShapeSheet window for the shape and always appears dimmed.

Display Help

Choose this option to display a custom help topic for a shape. For details, see the next sidebar "Displaying a Help File for a Shape."

OLE Verb

Choose this option for a linked or embedded option to add an OLE command, such as Edit or Open.

Run Macro

Choose this option and select a macro or add-in to run the macro or add-in. The list box includes all the available add-ins, many of them built-in Visio wizards or tools, such as Report and Color Schemes.

Go To Page

Choose this option and select a page number to display that page. Select the Open In New Window check box if you want to display the new page in a separate drawing page window.



Microsoft Visio Version 2002 Inside Out
Microsoft Visio Version 2002 Inside Out (Inside Out (Microsoft))
ISBN: 0735612854
EAN: 2147483647
Year: 2000
Pages: 211
Authors: Nanette Eaton

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net