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.

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.

Note:
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)
Since:
4.0

#include <xsi_ppgeventcontext.h>

Inheritance diagram for PPGEventContext:
Inheritance graph
[legend]

List of all members.

Public Types

enum   PPGEvent {
  siUndefined = 0,
  siOnInit = 1,
  siOnClosed = 2,
  siParameterChange = 3,
  siButtonClicked = 4,
  siTabChange = 5
}

Public Member Functions

  PPGEventContext ()
  ~PPGEventContext ()
  PPGEventContext (const CRef &in_ref)
  PPGEventContext (const PPGEventContext &in_obj)
bool  IsA (siClassID in_ClassID) const
siClassID  GetClassID () const
PPGEventContext operator= (const PPGEventContext &in_obj)
PPGEventContext operator= (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.

Enumerator:
siUndefined 

Unknown event

siOnInit 

PPG has just been drawn

siOnClosed 

PPG has just been closed

siParameterChange 

Value of a Parameter has changed

siButtonClicked 

The user clicked a button

siTabChange 

User changed tabs on a multi-tab PPG


Constructor & Destructor Documentation

Default constructor.

Default destructor.

PPGEventContext ( const CRef in_ref )

Constructor.

Parameters:
in_ref constant reference object.
PPGEventContext ( const PPGEventContext in_obj )

Copy constructor.

Parameters:
in_obj constant 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.

Parameters:
in_ClassID class type.
Returns:
true if the class is compatible, false otherwise.

Reimplemented from Context.

siClassID GetClassID ( ) const [virtual]

Returns the type of the API class.

Returns:
The class type.

Reimplemented from Context.

PPGEventContext& operator= ( const PPGEventContext in_obj )

Creates an object from another object.

Parameters:
in_obj constant class object.
Returns:
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.

Parameters:
in_ref constant class object.
Returns:
The new PPGEventContext object.

Reimplemented from Context.

PPGEvent GetEventID ( ) const

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

Returns:
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.

Returns:
Array of referendces to CustomProperty objects.
Since:
8.0 (2010)

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