OffsetActionSample Example for Visual C++ 5.0

void OffsetActionSample(CLEADRasterContainerViewer * pLEADContainerViewer) 
{
   TRY
   {
      pLEADContainerViewer->SetEnableMethodErrors (TRUE); 

      // Activate offset action if the action is not activated
      if(!pLEADContainerViewer->OffsetAction ().GetUse ())
         pLEADContainerViewer->OffsetAction().ActivateAction (TRUE, 0); 
      // Select left mouse button to control offset action parameters. 
      pLEADContainerViewer->OffsetAction().SetMouseButtonAction (CONVIEW_MOUSE_BUTTON_LEFT, CONVIEW_ACTION_ACTIVEONLY|CONVIEW_ACTION_REALTIME); 

      // Select left, right, up, and down keys to control offset parameters. 
      pLEADContainerViewer->OffsetAction().SetModifier (CONVIEW_KEY_SHIFT); 
      pLEADContainerViewer->OffsetAction().SetKey (VK_DOWN); 
      pLEADContainerViewer->OffsetAction().SetKeyboardAction (CONVIEW_MOUSEMOVE_DOWN); 
      pLEADContainerViewer->OffsetAction().SetKey(VK_UP); 
      pLEADContainerViewer->OffsetAction().SetKeyboardAction(CONVIEW_MOUSEMOVE_UP); 
      pLEADContainerViewer->OffsetAction().SetKey(VK_LEFT); 
      pLEADContainerViewer->OffsetAction().SetKeyboardAction(CONVIEW_MOUSEMOVE_LEFT); 
      pLEADContainerViewer->OffsetAction().SetKey(VK_RIGHT); 
      pLEADContainerViewer->OffsetAction().SetKeyboardAction(CONVIEW_MOUSEMOVE_RIGHT); 

      // Select offset cursor. 
      CPictureHolder PicHolder; 
      if(PicHolder.CreateFromIcon(LoadCursor(NULL, IDC_CROSS))) 
      {
         pLEADContainerViewer->OffsetAction().SetCursor (PicHolder.GetPictureDispatch());
      }
      // Specify offset parameters. 
      pLEADContainerViewer->OffsetAction().SetChange (100); 
      pLEADContainerViewer->OffsetAction().SetCircularMouseMove (TRUE); 
      
      // Set offset parameters. 
      pLEADContainerViewer->OffsetAction ().SetAction (0, CONVIEW_ACTIONLEVEL_CONTAINER); 

   }
   CATCH_ALL(e) 
   {
       e->ReportError();
   }
   END_CATCH_ALL
}