Using IPropertyManagerPage2 and the Related Objects
IPropertyManagerPage2
and related objects provide an add-in application with the ability to
create a PropertyManager page with the same look and feel as SOLIDWORKS
PropertyManager pages. The SOLIDWORKS API provides a series of standard
controls that are managed by the SOLIDWORKS application.
This topic explains:
What is available?
The SOLIDWORKS API provides:
See Controls
on Multipage PropertyManager Page for details about programming controls
on a multipage PropertyManager page.
Back to top
What does the add-in have to do?
To take advantage of this functionality, the
add-in application must:
Implement an object that supports
IPropertyManagerPage2Handler8.
Call ISldWorks::CreatePropertyManagerPage
to create the new page, including a pointer to the IPropertyManagerPage2Handler8
for that page.
Use the pointer returned by ISldWorks::CreatePropertyManagerPage
to add group boxes and controls to the new page using IPropertyManagerPage2::AddControl,
IPropertyManagerPage2::AddGroupBox, and
IPropertyManagerPageGroup::AddControl.
Call IPropertyManagerPage2::Show
to display the PropertyManager page in the user interface.
Respond to events generated by the SOLIDWORKS
application (such as
IPropertyManagerPage2Handler8::OnButtonPress
or
IPropertyManagerPage2Handler8::OnClose)
to collect data that your
user typed in the PropertyManager page and take action based on that data,
if necessary.
Destroy the IPropertyManagerPage2 object.
Back to top
What does the SOLIDWORKS application do?
When you create a IPropertyManagerPage2 object, SOLIDWORKS:
Creates the PropertyManager page (not visible)
and associates it with the specified IPropertyManagerPage2Handler8 in
the add-in application.
Makes calls to the IPropertyManagerPage2Handler8
based on end-user, initiated events.
Closes the PropertyManager page in the user interface
when the end-user clicks OK or
Cancel, but does not destroy the
IPropertyManagerPage2 object.
Back to top
IPropertyManagerPage2 states
The controls associated with IPropertyManagerPage2 have two distinct
states: not visible and visible.
When the PropertyManager is not visible, the window does not exist.
The only items that exist are the API objects. These objects hold onto
only the default values that are set by the application before it displays
the PropertyManager.
When the PropertyManager is visible, the objects represent the controls
displayed in the PropertyManager window. When a given control is queried,
the value represents the current setting of the control.
These states are important because if the end-user closes a PropertyManager
page, you cannot determine
the user-specified value for the control. It is up to you to provide data
exchange between your application and the controls while they are visible
and before the PropertyManager page goes away.
Back to top