LImageViewerCell::ActiveSubCellChangedCallBack

#include "ltwrappr.h"

virtual L_INT LImageViewerCell::ActiveSubCellChangedCallBack(hCellWnd, nCellIndex, nSubCellIndex, nPreviousSubCellIndex)

This callback function is called every time the user changes the active sub-cell.

Parameters

HWND hCellWnd

A handle to the window that represents the Medical Viewer Cell.

L_INT nCellIndex

A zero-based index of the cell, that contains the sub-cell that been changed.

L_INT nSubCellIndex

A zero-based index of the new active sub-cell.

L_INT nPreviousSubCellIndex

A zero-based index of the sub-cell that was active before changing the active sub-cell index.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

This callback happens when the sub-cell is changed, which occurs by:

  1. Clicking on another sub-cell rect.
  2. Scrolling the cell scroll.

In order to use this callback function, it must first be set by calling the LImageViewerCell::EnableActiveSubCellChangedCallBack function.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example will link the active sub-cell of the first cell to the second cell and vice versa.

#ifdef LImageViewerChild  
class LImageViewerChild :public LImageViewerCell 
{ 
   virtual L_INT ActiveSubCellChangedCallBack(HWND hCellWnd, 
                                              L_INT    nCellIndex, 
                                              L_INT    nSubCellIndex, 
                                              L_INT    nPreviousSubCellIndex); 
 
}; 
#endif 
 
L_INT LImageViewerChild::ActiveSubCellChangedCallBack(HWND hCellWnd, 
                                                      L_INT    nCellIndex, 
                                                      L_INT    nSubCellIndex, 
                                                      L_INT    nPreviousSubCellIndex) 
{ 
   UNREFERENCED_PARAMETER(hCellWnd); 
   UNREFERENCED_PARAMETER(nCellIndex); 
   UNREFERENCED_PARAMETER(nPreviousSubCellIndex); 
   DISPSTACKACTIONPROPS ActionProperties; 
   DISPCELLPROPERTIES CellProp; 
   CellProp.uStructSize = sizeof(DISPCELLPROPERTIES); 
   CellProp.uMask = DCCELLPF_ROWS | DCCELLPF_COLS; 
 
   ActionProperties.DispContainerActionProps.uStructSize = sizeof(DISPSTACKACTIONPROPS); 
 
   GetActionProperties(CONTAINER_ACTION_STACK, 0, &ActionProperties, 0); 
   GetCellProperties(&CellProp, 0); 
   ActionProperties.nActiveSubCell = nSubCellIndex % (CellProp.uNumCols * CellProp.uNumRows); 
   ActionProperties.nScrollValue = nSubCellIndex - ActionProperties.nActiveSubCell; 
   SetActionProperties( CONTAINER_ACTION_STACK, 0, &ActionProperties, CONTAINER_ACTION_CELLLEVEL); 
 
   return SUCCESS; 
} 
 
 
L_INT LImageViewer_ActiveSubCellChangedExample(LImageViewerCell& ImageViewerCell) 
{ 
   ImageViewerCell.EnableActiveSubCellChangedCallBack( TRUE); 
 
   return SUCCESS; 
} 

Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Medical Image Viewer C++ Class Library Help