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.
#include <xsi_ppgeventcontext.h>
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 |
enum PPGEvent |
Defines the possible actions that result in the callback function being called.
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 |
PPGEventContext | ( | ) |
Default constructor.
~PPGEventContext | ( | ) |
Default destructor.
PPGEventContext | ( | const CRef & | in_ref | ) |
Constructor.
in_ref | constant reference object. |
PPGEventContext | ( | const PPGEventContext & | in_obj | ) |
Copy constructor.
in_obj | constant class object. |
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
in_ClassID | class type. |
Reimplemented from Context.
siClassID GetClassID | ( | ) | const [virtual] |
PPGEventContext& operator= | ( | const PPGEventContext & | in_obj | ) |
Creates an object from another object.
in_obj | constant class 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_ref | constant class 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.
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.