Public Types | Public Member Functions
PPGEventContext Class Reference

Detailed Description

This object is provided as the context object in the PPGEvent callback for a Plugin-based CustomProperty object (see PluginRegistrar::RegisterProperty).

Using the information provided by this object, it is possible to implement PPG logic code using the C++ API. For information about implementing logic with scripting see PPGLayout::PutLogic and PPG.

The PPGEventContext::GetEventID function returns information about the specific event that occurred. If the event is PPGEventContext::siOnInit or PPGEventContext::siOnClosed then Context::GetSource returns the CustomProperty object that is being inspected. If the event is PPGEventContext::siParameterChange then Context::GetSource returns the Parameter that changed. If the event is PPGEventContext::siButtonClicked then call Context::GetAttribute to get the attribute "Button", which will return a CString with the script name of the Button that was clicked. If the event is PPGEventContext::siTabChange then call Context::GetAttribute to get the attribute "Tab", which will return a CString with the label of the Tab that was clicked.

If the event is a grid data event ( PPGEventContext::siGridDataOnBeginValueChange, PPGEventContext::siGridDataOnEndValueChange, PPGEventContext::siGridDataOnBeginSelectionChange, PPGEventContext::siGridDataOnEndSelectionChange, PPGEventContext::siGridDataOnButtonClicked, PPGEventContext::siGridDataOnHeaderDoubleClick, PPGEventContext::siGridDataOnContextMenuInit, PPGEventContext::siGridDataOnContextMenuSelected ), then Context::GetSource will return the parameter containing the GridData object. Extra parameters can be retrieved with a call to Context::GetAttribute to get the attribute "ExtraParams", which will return a CValueArray with extra parameters. The first element of the "ExtraParams" array is another CValueArray containing a list of column/row pairs (LONG/LONG) on which the grid data event occurs. If the event is PPGEventContext::siGridDataOnContextMenuSelected, the second element in the "ExtraParams" array contains a LONG value equal to the ID of the selected contextual menu item.

Certain grid data events can also return values to Softimage by calling Context::PutAttribute to set the attribute "Return". PPGEventContext::siGridDataOnBeginValueChange can return a boolean this way to indicate whether the value change should occur (true to allow the modification to all the modified cells and false to prevent it). It can also return a CValueArray made out of one boolean value per modified cell. The same logic applies to PPGEventContext::siGridDataOnBeginSelectionChange, where the return value will dictate whether the cells will get selected or not. Finally, Softimage expects PPGEventContext::siGridDataOnContextMenuInit to return the definition of the contextual menu to display. A CValueArray made out of Name/ID pairs (CString/LONG) will define the menu items.

To force the user interface to be redrawn, call Context::PutAttribute to set the attribute "Refresh" to true. This is useful if the context code changes the underlying PPGLayout during its execution. Similarly, it is possible to close the Property Page by setting the attribute "Close". For the equivalent functionality in scripting see PPG.Refresh and PPG.Close.

The OnChange callback for parameters is only invoked when a user is currently inspecting the property page. However, it may be either the user who changed the value on the inspected page or a change initiated through scripting (excluding a change originating from a callback function, of course). For example, if Parameter X is changed, and the callback code sets Parameter Y to the same value as X, then the PPGEvent is not invoked a second time.

To get the objects inspected by a property page, use the Context::GetSource function.
See also:
PPG.Inspected (object model equivalent of using PPGEventContext::GetSource)

#include <xsi_ppgeventcontext.h>

Inheritance diagram for PPGEventContext:
Inheritance graph

List of all members.

Public Types

enum  PPGEvent {
  siUndefined = 0,
  siOnInit = 1,
  siOnClosed = 2,
  siParameterChange = 3,
  siButtonClicked = 4,
  siTabChange = 5,
  siGridDataOnBeginValueChange = 6,
  siGridDataOnEndValueChange = 7,
  siGridDataOnBeginSelectionChange = 8,
  siGridDataOnEndSelectionChange = 9,
  siGridDataOnButtonClicked = 10,
  siGridDataOnHeaderDoubleClick = 11,
  siGridDataOnContextMenuInit = 12,
  siGridDataOnContextMenuSelected = 13

Public Member Functions

 PPGEventContext ()
 ~PPGEventContext ()
 PPGEventContext (const CRef &in_ref)
 PPGEventContext (const PPGEventContext &in_obj)
bool IsA (siClassID in_ClassID) const
siClassID GetClassID () const
PPGEventContextoperator= (const PPGEventContext &in_obj)
PPGEventContextoperator= (const CRef &in_ref)
PPGEvent GetEventID () const
CRefArray GetInspectedObjects () const

Member Enumeration Documentation

enum PPGEvent

Defines the possible actions that result in the callback function being called.


Unknown event


PPG has just been drawn


PPG has just been closed


Value of a Parameter has changed


The user clicked a button


User changed tabs on a multi-tab PPG


GridData OnBeginValueChange event occured


GridData OnEndValueChange event occured


GridData OnBeginSelectionChange event occured


GridData OnEndSelectionChange event occured


GridData OnButtonClicked event occured


GridData OnHeaderDoubleClick event occured


GridData OnContextMenuInit event occured


GridData OnContextMenuSelected event occured

Constructor & Destructor Documentation

Default constructor.

Default destructor.

PPGEventContext ( const CRef in_ref)


in_refconstant reference object.
PPGEventContext ( const PPGEventContext in_obj)

Copy constructor.

in_objconstant class object.

Member Function Documentation

bool IsA ( siClassID  in_ClassID) const [virtual]

Returns true if a given class type is compatible with this API class.

in_ClassIDclass type.
true if the class is compatible, false otherwise.

Reimplemented from Context.

siClassID GetClassID ( ) const [virtual]

Returns the type of the API class.

The class type.

Reimplemented from Context.

PPGEventContext& operator= ( const PPGEventContext in_obj)

Creates an object from another object.

in_objconstant class object.
The new PPGEventContext object.
PPGEventContext& operator= ( const CRef in_ref)

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

in_refconstant class object.
The new PPGEventContext object.

Reimplemented from Context.

PPGEvent GetEventID ( ) const

Returns information about what specific occurrence in the user interface provoked the callback. For additional information use Context::GetSource and Context::GetAttribute.

Identifier of the most latest fired PPG event.
CRefArray GetInspectedObjects ( ) const

Returns an array containing the CustomProperty objects being inspected by a Property Page. The only case where the array will contain more than one object is if the Property Page is in Multi-edit mode. This should not be confused with the case where a single Property Page frame is inspecting multiple objects at the same time, one above the other.

Array of referendces to CustomProperty objects.
8.0 (2010)

The documentation for this class was generated from the following file: