다음을 통해 공유


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

Converting Types

Users may want to convert an object's type so they can edit the object by using a different application. To support this function, provide a Convert dialog box, as shown in Figure 12.35. To provide access to the Convert dialog box, include a Convert to button beside the Object type field in an object's property sheet.

Convert dialog box

Figure 12.35 The Convert dialog box

This dialog box displays the current type of the object and a list box that contains all possible conversions. This list is composed of all types registered as capable of reading the selected object's format, but this does not necessarily guarantee the possibility of reverse conversion. If the user selects a new type from the list and then clicks OK, the selected object is converted immediately to the new type. If the object is open, the container closes it before beginning the conversion.

NoteNote

Previous guidelines recommended including a Convert command on the menu for a selected object. You can continue to support this; however, the current preferred method is to provide access through a button on the object's property sheet.

Make sure the application that supplies the conversion does so with minimal impact in the user interface. That is, avoid displaying the application's primary window, but do provide a progress indicator message box with appropriate controls so that the user can monitor or interrupt the conversion process.

If the conversion of the type could result in any lost data or information, the application you use to support the type conversion should display a warning message box indicating that data will be lost and request confirmation by the user before continuing. Make the message as specific as possible about the nature of the information that might be lost; for example, "Text properties will not be preserved."

In addition to converting a type, the Convert dialog box offers the user the option to change the type association for the object by choosing the Activate as option. When the user chooses this option, selects a type from the list, and then clicks OK, the object's type is treated as the new type. This differs from type conversion in that the object's type remains the same, but its activation command is handled by a different application. It also differs in that converting a type affects only the object that is converted. Changing the activation association of a specific type of single object changes it for all embedded objects of that type. For example, converting a rich-text format document to a text document affects only the converted document. However, if the user clicks the Activate as option to change the activation association for the rich-text format object to a text format application, all embedded rich-text format objects would also be affected.

At the bottom of the Convert dialog box, text describes the outcome of the choices the user selects. The following table outlines the syntax of the descriptive text to use in the Convert dialog box.

Descriptive Text for Convert Dialog Box
Function Resulting text
Convert the selected object's type to a new type. "Permanently changes the selected Existing Type Name object to a New Type Name object."
Convert the selected object's type to a new type and display the object as an icon. "Permanently changes the selected Existing Type Name object. The object will be displayed as an icon."
No type change (the selected type is the same as its existing type). "The New Type Name you selected is the same as the type of the selected object, so its type will not be converted."
Change the activation association for the selected object's type. "Every Existing Type Name object will be activated as a New Type Name object, but will not be converted to the new type."
Change the activation association for the selected object's type and display the object as an icon. "Every Existing Type Name object will be activated as a New Type Name object, and will be converted to the new type. The selected object will be displayed as an icon.

For linked objects, disable the Convert to command. The conversion for a link must occur on the link source. If no types are registered for alternative activation, also disable the Activate as command. If the user can neither convert nor change the activation association, disable the Convert to command that displays this dialog box.

Fundamentals of Designing User Interaction

Windows Interface Components

Design Specifications and Guidelines

Appendixes and References