Available in LEADTOOLS Medical Imaging toolkits. |
LImageViewerCell::ActiveSubCellChangedCallBack
#include "ltwrappr.h"
virtual L_INT LImageViewerCell::ActiveSubCellChangedCallBack(hCellWnd, nCellIndex, nSubCellIndex, nPreviousSubCellIndex)
HWND hCellWnd; |
/* handle to the cell window */ |
L_INT nCellIndex; |
/* index of the cell */ |
L_INT nSubCellIndex; |
/* index of the sub-cell */ |
L_INT nPreviousSubCellIndex; |
/* index into the image list attached to the cell */ |
This callback function is called every time the user changes the active sub-cell.
Parameter |
Description |
hCellWnd |
A handle to the window that represents the Medical Viewer Cell. |
nCellIndex |
A zero-based index of the cell, that contains the sub-cell that been changed. |
nSubCellIndex |
A zero-based index of the new active sub-cell. |
nPreviousSubCellIndex |
A zero-based index of the sub-cell that was active before changing the active sub-cell index. |
Returns
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
LTIVW For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Example
This example will link the active sub-cell of the first cell to the second cell and vice versa.
#if defined (LTV17_CONFIG) #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; } #else #ifdef LImageViewerChild class LImageViewerChild :public LImageViewerCell { virtual L_INT ActiveSubCellChangedCallBack(L_INT nCellIndex, L_INT nSubCellIndex, L_INT nPreviousSubCellIndex); } ; #endif L_INT LImageViewerChild::ActiveSubCellChangedCallBack(L_INT nCellIndex, L_INT nSubCellIndex, L_INT nPreviousSubCellIndex) { UNREFERENCED_PARAMETER(nPreviousSubCellIndex); DISPSTACKACTIONPROPS ActionProperties; DISPCELLPROPERTIES CellProp; CellProp.uStructSize = sizeof(DISPCELLPROPERTIES); CellProp.uMask = DCCELLPF_ROWS | DCCELLPF_COLS; L_INT nIndex = (nCellIndex == 1) ? 0 : 1; ActionProperties.DispContainerActionProps.uStructSize = sizeof(DISPSTACKACTIONPROPS); GetActionProperties( CONTAINER_ACTION_STACK, nIndex, 0, &ActionProperties, 0); GetCellProperties( nIndex, &CellProp, 0); ActionProperties.nActiveSubCell = nSubCellIndex % (CellProp.uNumCols * CellProp.uNumRows); ActionProperties.nScrollValue = nSubCellIndex - ActionProperties.nActiveSubCell; SetActionProperties( CONTAINER_ACTION_STACK, nIndex, 0, &ActionProperties, CONTAINER_ACTION_CELLLEVEL); return SUCCESS; } L_INT LImageViewer_ActiveSubCellChangedExample(LImageViewer& ImageViewer) { ImageViewer.EnableActiveSubCellChangedCallBack( TRUE); return SUCCESS; } #endif // LTV17_CONFIG