3D PLM Enterprise Architecture |
User Interface - Frame |
Object Property AccessHow to add a property page for your object properties |
Technical Article |
AbstractThe 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. |
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.
![]() |
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:
ExtractFromSelection
method of each property editorExtractFromSelection
method determines whether the
object(s) in the CSO implements the property interface(s) this property
editor deals with, and if this is the case, the property page editor creates
the property page dialog to be displayed in the property sheet.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]
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]
You need:
[Top]
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.
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:
ExtractFromSelection
returns the list of objects found in the
Current Set of Objects (CSO) that implement the property interfaceGetEditorTitle
returns the property page titleSetEditorSize
lets you request which size you need to
accommodate your property page, among the possible values: small, medium, or
largeBuildEditor
instantiates the associated dialog classSetPropertyValue
sets the values and options in the property
page dialog from the objectsCommitModification
applies to the selected objects the
modifications made to values and options in the property page dialog.CancelModification
is empty, but exists and could be used to
delete temporary objects that could possibly be allocated in previous
methodsCloseWindowFromEditor
is called whenever the end user selects
another property page.The methods ExtractFromSelection
, GetEditorTitle
, SetEditorSize
,
BuildEditor
, and SetPropertyValue
are executed in this
order when instantiating the property page.
When the end user clicks:
CommitModification
method is executed and the window
is closedCommitModification
method is executed, but
the window is not closedCancelModification
method is executed and the
window is closedSetPropertyValue
, CommitModification
, and CancelModification
call in turn the methods with the same name of the associated dialog class.
[Top]
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]
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]
[1] | Application Property Access |
[Top] |
Version: 1 [Jan 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.