#include "l_bitmap.h"
L_LTIVW_API L_INT EXT_FUNCTION L_DispContainerGetActiveSubCellChangedCallBack (hCellWnd, ppfnCallBack, ppUserData)
Gets a callback function that is called every time the user changes the active sub-cell.
A handle to the window that represents the Medical Viewer Cell.
Pointer to a pointer to a callback function to be updated with the last active sub-cell changed callback function set using L_DispContainerGetActiveSubCellChangedCallBack.
Void pointer to be updated with the value of user defined data associated with the status callback. If you are not interested in the user-defined data, pass NULL for this parameter.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function gets the active sub-cell changed callback. To set the active sub-cell changed callback use L_DispContainerSetActiveSubCellChangedCallBack.
Required DLLs and Libraries
This example will link the active sub-cell of the first cell to the second cell and vice versa.
L_INT EXT_FUNCTION ActiveSubCellChangedCallBack(HWND hCellWnd,
L_INT nCellIndex,
L_INT nSubCellIndex,
L_INT nPreviousSubCellIndex,
L_VOID * pUserData)
{
UNREFERENCED_PARAMETER(nPreviousSubCellIndex);
HDISPCONTAINER hCon = (HDISPCONTAINER)pUserData;
UNREFERENCED_PARAMETER(pUserData);
DISPSTACKACTIONPROPS ActionProperties;
DISPCELLPROPERTIES CellProp;
CellProp.uStructSize = sizeof(DISPCELLPROPERTIES);
CellProp.uMask = DCCELLPF_ROWS | DCCELLPF_COLS;
L_INT nIndex = (nCellIndex == 1) ? 0 : 1;
hCellWnd = L_DispContainerGetCellWindowHandle(hCon, nIndex, 0);
ActionProperties.DispContainerActionProps.uStructSize = sizeof(DISPSTACKACTIONPROPS);
L_DispContainerGetActionProperties(hCellWnd, CONTAINER_ACTION_STACK, 0, &ActionProperties, 0);
L_DispContainerGetCellProperties(hCellWnd, &CellProp, 0);
ActionProperties.nActiveSubCell = nSubCellIndex % (CellProp.uNumCols * CellProp.uNumRows);
ActionProperties.nScrollValue = nSubCellIndex - ActionProperties.nActiveSubCell;
L_DispContainerSetActionProperties(hCellWnd, CONTAINER_ACTION_STACK, 0, &ActionProperties, CONTAINER_ACTION_CELLLEVEL);
return SUCCESS;
}
L_INT DispContainerActiveSubCellChangedExample(HDISPCONTAINER hCon)
{
DISPCONTAINERACTIVESUBCELLCHANGED oldCallBack;
L_VOID * pOldUserData;
if (L_DispContainerGetCellCount(hCon, 0) == 0)
{
MessageBox(NULL, TEXT("you must at least have one cell added to the viewer"), TEXT("No Cell attached"), MB_OK);
return FAILURE;
}
HWND hCellWnd = L_DispContainerGetCellWindowHandle(hCon, 0, 0);
L_DispContainerGetActiveSubCellChangedCallBack(hCellWnd, &oldCallBack, &pOldUserData);
L_DispContainerSetActiveSubCellChangedCallBack(hCellWnd, ActiveSubCellChangedCallBack, hCon);
return SUCCESS;
}