Description
Use this callback to manage the interaction between and custom display and XSI. When there is a change to the selection, a value or the time, XSI sends a notification that can be trapped by the corresponding notification object.
This callback takes the ViewContext object as input which you can use to get one of the View Notification objects:
• CSelectionChangeNotification —holds information about a selection change event.
• CValueChangeNotification —holds information about a value change event.
• CTimeChangeNotification —holds information about a time change event.
Applies To
Syntax
// C++
void <custom_display_name>_Notify( CRef& in_context )
{
...
}
<custom_display_name> is the name specified in the call to RegisterCustomDisplay (see PluginRegistrar ), with any spaces removed.
Parameters
|
Parameter |
Type |
Description |
|
in_context |
CRef & |
A reference to a ViewContext object. |
Examples
CStatus XSILoadPlugin( PluginRegistrar& in_reg )
{
// Set installation options
in_reg.PutVersion( 1, 0 );
// ... (see PluginRegistrar for details)
// Register your custom display (view)
CStatus in_reg.RegisterCustomDisplay( L"MyCustomDisplayName" );
}
CStatus MyCustomDisplayName_Init( CRef& in_context )
{
// Get the XSI parent window handle to use to create a child window
ViewContext ctx( in_context );
HWND hParent = ctx.GetParentWindowHandle();
// Create a new window as a child of the XSI parent window
HWND hChild = CreateDialog( MyDllInstance,
MAKEINTRESOURCE(IDD_MYCUSTOMWINDOW), hParent, (DLGPROC)MyWindowProc );
// ...
}
CStatus MyCustomDisplayName_Notify( CRef& in_context )
{
// Get the notification data through the ViewContext object
ViewContext ctx( in_context );
siEventID in_eNotifcation;
void* in_pData;
ctx.GetNotificationData ( in_eNotifcation, &in_pData );
// Notification handlers
switch ( in_eNotifcation )
{
case siOnSelectionChange:
{
// If selection changed...
}
case siOnTimeChange:
{
// If time changed...
}
case siOnValueChange:
{
// If value changed...
}
}
// ...
}
See Also
• Custom Display (View) Callbacks
SOFTIMAGE|XSI v6.01