3D PLM Enterprise Architecture

User Interface - Frame

Object Property Access

How to add a property page for your object properties
Technical Article

Abstract

The Edit->Properties menu clicked when one or several objects are selected in the document, as well as the Properties item of an object's contextual menu, displays a dialog box with a property sheet containing property pages. This article explains what are property sheets and pages, and discusses how to create and integrate property pages for your own objects into the property sheet of this dialog box.


What Are the Edit->Properties Property Sheets?

A property sheet is a tabbed dialog box, each tab containing a property page. It enables the end user to work with many properties gathered in a single place, rather than to display several dialog boxes accessed each from a different menu. Each property page contains various controls to set values or options for one or several properties to manage element's persistent parameters that the end user can modify. When the end user clicks on a tab, the controls for the properties are displayed and the end user can alternatively display different property pages by clicking on different tabs. A property sheet can be accessed using the Edit->Properties menu, and applies to the element(s) currently selected. It can also be accessed from the Properties item of an element's contextual menu.

Other property pages can exist, namely those dedicated to the application, or to a given workshop, and accessed using the Tools->Options menu [1]. These property pages manage parameters or attributes that are independent from the current selection and are of general purpose. Their values are saved into, and retrieved from, setting files.

The Edit->Properties property sheet dialog box displays a property page for each property available for the current selection. For example, below is a property sheet with two property pages named Graphic and Texture respectively.

CAACafEditProperties1.jpg (36854 bytes) The Graphic property page is provided by the application and the selected objects need to implement the CATIVisProperties interface for all these properties. If the object does not implement this interface, the page is not displayed.

Each property page displays controls to set parameter values or working options for its related property. These values are read from the element when the property sheet is built. The dialog box works as follows:

When the end user clicks Edit->Properties, or the Properties item of an object's contextual menu, the property pages are built as follows:

To help improve performance when creating the Properties dialog box, you can decide to hide some properties. Their property page editors are not created, as well as their dialogs. The Properties dialog box shows a More... push button that the end user can press to display these properties. To enable property pages to be displayed by default, the document objects must implement the CATIRootProperties interface. The GetListOfEditors method returns the property page editors to instantiate. Otherwise, the property pages are created when the end user presses More.

[Top]

Creating Your Property Page

To create your property page, you need to consider having objects that implement one or several property interfaces, that is, interfaces that derive from CATIEditProperty. If this is the case, you need to create:

Since you new properties and their property pages when you wish, the property page editor instantiation mechanism relies on factories. You need first to create a factory interface, and then implement it to create the property page factory.

Let's detail the tasks to do to create a property page, whose editor is CAAPPEdt.

[Top]

Creating the Property Page Editor Factory

You need:

[Top]

Creating the Property Page Editor

You'll now create the class for the property page. This class derives from the CATEditor class, implements the CATIEditProperties interface and overrides the methods shown in the diagram below.

CAACafEditPropertiesObjects.gif (4424 bytes)

These methods are those of the CATIEditProperties interface and are either pure virtual or empty in their CATEditor implementation. You should provide their body to make them play the following role:

The methods ExtractFromSelection, GetEditorTitle, SetEditorSize, BuildEditor, and SetPropertyValue are executed in this order when instantiating the property page.

When the end user clicks:

SetPropertyValue, CommitModification, and CancelModification call in turn the methods with the same name of the associated dialog class.

[Top]

Creating the Property Page Dialog

This dialog is a class that derives from CATDlgFrame. You can create and arrange the controls, and possibly other dialog objects, such as separators, frames, and so on, to help control arrangement.

[Top]


In Short

Creating a property page for the Edit->Properties menu implies to create a property page editor factory, a property page editor class instantiated by this factory, and to supply a property page dialog class gathering the controls to access the parameters and values of the object's properties you let the end user access and modify.

To be extracted from the Current Set of Objects (CSO), the objects should implement the property interface(s) to which this property page is dedicated.

[Top]


References

[1] Application Property Access
[Top]

History

Version: 1 [Jan 2000] Document created
[Top]

Copyright © 2000, Dassault Systèmes. All rights reserved.