OwnerActionSample Example for Visual C++ 5.0
void OwnerActionSample(CLEADRasterContainerViewer * pLEADContainerViewer)
{
TRY
{
pLEADContainerViewer->SetEnableMethodErrors (TRUE);
// Activate owner action if the action is not activated
if(!pLEADContainerViewer->OwnerAction (0).GetUse ())
pLEADContainerViewer->OwnerAction(0).ActivateAction (TRUE, 0);
// Select left mouse button to control owner action parameters.
pLEADContainerViewer->OwnerAction(0). SetMouseButtonAction (CONVIEW_MOUSE_BUTTON_LEFT, CONVIEW_ACTION_ACTIVEONLY|CONVIEW_ACTION_REALTIME);
// Select left, right, up, and down keys to control owner action parameters.
pLEADContainerViewer->OwnerAction(0).SetModifier (CONVIEW_KEY_ALT);
pLEADContainerViewer->OwnerAction(0).SetKey (VK_DOWN);
pLEADContainerViewer->OwnerAction(0).SetKeyboardAction (CONVIEW_MOUSEMOVE_DOWN);
pLEADContainerViewer->OwnerAction(0).SetKey(VK_UP);
pLEADContainerViewer->OwnerAction(0).SetKeyboardAction(CONVIEW_MOUSEMOVE_UP);
// Select owner action cursor.
CPictureHolder PicHolder;
if(PicHolder.CreateFromIcon(LoadCursor(NULL, IDC_CROSS)))
{
pLEADContainerViewer->OwnerAction(0).SetCursor (PicHolder.GetPictureDispatch());
}
// Specify owner action parameters.
pLEADContainerViewer->OwnerAction(0).SetChange (100);
pLEADContainerViewer->OwnerAction(0).SetCircularMouseMove (TRUE);
// Set owner action parameters.
pLEADContainerViewer->OwnerAction(0).SetAction ();
}
CATCH_ALL(e)
{
e->ReportError();
}
END_CATCH_ALL
}