Design Specifications and Guidelines - Working with OLE Embedded and Linked Objects


Accessing Properties of Objects

A linked object includes properties, such as the name of its source, its source's type, and the link's updating basis (automatic or manual). A linked object also includes a set of commands related to these properties. The linked object's container gives the user access to these properties and commands by providing a property sheet. You can also include a Links dialog box so that users can view and change the properties of several links simultaneously.

Cross referenceMore Information

For more information about linked objects, see "The Links Command" later in this section.

The following sections describe how to provide user access to the properties of objects.

The Properties Command

Design a container to include a Properties command and property sheets for any objects it contains. If the container application already includes a Properties command for its own native data, you can also use it to support selected embedded or linked objects. Otherwise, add the command (preceded by a menu separator) to the drop-down and shortcut menus that you provide for accessing the other commands for the object, as shown in Figure 12.28. You should also display the properties of an object when the user selects the object and then presses ALT+ENTER.

Properties command

Figure 12.28 The Properties command (click to enlarge image)

When the user clicks the Properties command, the container displays a property sheet containing all the salient properties and values, organized by category, for the selected object. Figure 12.29 shows example property sheet pages for an object.

Embedded object property sheets

Figure 12.29 Embedded object property sheets (click to enlarge image)

Follow the format the system uses for property sheets and the conventions outlined in this book. Use the short type name in the title bar; for a linked object, precede the name with the word "Linked" — for example, "Linked Worksheet." Include a General property page that displays the icon, name, type, size, and location of the object. Also include a Convert button to provide access to the type conversion dialog box. On a View page, display properties associated with the view and presentation of the object within the container. These include properties for scaling or position and for displaying the object as content or as an icon. The Display as icon field includes a Change Icon button that allows the user to customize the icon for the object. The Change Icon dialog box is shown in Figure 12.30.

Change Icon dialog box

Figure 12.30 The Change Icon dialog box

On the property sheet for linked objects, also include a Link page that contains the essential link parameters and commands, as shown in Figure 12.31.

Link page

Figure 12.31 The Link page for the property sheet of a linked object

For the typical link, include the source name, the Update setting (automatic or manual), the Last Update time stamp, and buttons that provide the following link operations:

The Links Command

In addition to property sheets, containers can include link information in the form of a Links command. This command opens a dialog box that enables users to display and manage the properties for multiple links, as shown in Figure 12.32. The list box displays the links in the container.

Links dialog box

Figure 12.32 The Links dialog box

Each line in the list contains the link source's name, the link source's object type (short type name), and whether the link updates automatically or manually. If a link source cannot be found, "Unavailable" appears in the update status column.

If the user clicks the Links command when the current selection includes a linked object (or objects), display that link (or links) as selected in the Links dialog box and scroll the list to display the first selected link at the top of the list box.

Allow 15 characters for the short type name field, and enough space for the words "Automatic" and "Manual" to appear completely. As the user selects each link in the list, display the link's type, name, and updating basis at the bottom of the dialog box. The dialog box also includes the following link management command buttons: Update Now, Open Source, Change Source, and Break Link.

Define the Open Source command to be the default command when the input focus is within the list of links. Support double-clicking an item in the list as a shortcut for opening the link source.

When the user clicks the Change Source button, a version of the Open dialog box appears that enables the user to change the source of a link. If the user enters a source name that does not exist and clicks the default button, display the message box shown in Figure 12.33.

Message box for an invalid source

Figure 12.33 A message box for an invalid source

If the user clicks Yes, display the Change Source dialog box to correct the string. If the user clicks No, store the unparsed display name of the link source until the user links successfully to a newly created object that satisfies the dangling reference. The container application can also choose to allow the user to connect only to valid links.

If the user changes a link source or its folder, and other linked objects in the same container are connected to the same original link source, the container may offer the user the option to change the other references. To support this option, use the message box shown in Figure 12.34.

Changing additional links

Figure 12.34 Changing additional links with the same source