This callback function is called every time the user changes the active sub-cell.
#include "ltwrappr.h"
virtual L_INT LImageViewerCell::ActiveSubCellChangedCallBack(hCellWnd, nCellIndex, nSubCellIndex, nPreviousSubCellIndex)
A handle to the window that represents the Medical Viewer Cell.
A zero-based index of the cell, that contains the sub-cell that been changed.
A zero-based index of the new active sub-cell.
A zero-based index of the sub-cell that was active before changing the active sub-cell index.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This callback happens when the sub-cell is changed, which occurs by:
In order to use this callback function, it must first be set by calling the LImageViewerCell::EnableActiveSubCellChangedCallBack function.
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;
}