#include "ltwrappr.h"
virtual L_INT LImageViewerCell::AnnotationCallBack(hCellWnd, uMessage, nX, nY, nCellIndex, nSubCellIndex)
HWND hCellWnd; |
handle to the cell window |
L_UINT uMessage; |
message |
L_INT nX; |
X mouse position |
L_INT nY; |
Y mouse position |
L_INT nCellIndex; |
index of the affected cell |
L_INT nSubCellIndex; |
index into the image list attached to the cell |
This callback function is called every time the user clicks on an annotation object.
Parameter |
Description |
hCellWnd |
A handle to the window that represents the Medical Viewer Cell. |
uMessage |
Value that represents the message from the mouse. Possible values are: WM_LBUTTONDOWN WM_LBUTTONUP WM_MBUTTONDOWN WM_MBUTTONUP WM_MOUSEMOVE WM_RBUTTONDOWN WM_RBUTTONUP |
nX |
A Value that represents the X position of the cursor. |
nY |
A Value that represents the Y position of the cursor. |
nCellIndex |
Index of the cell that contains the sub-cell that annotation object |
nSubCellIndex |
Index of the sub-cell that contains that annotation object. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
In order to use this callback function, it must first be set by calling LImageViewerCell::EnableAnnotationCreatedCallBack 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. |
This example will convert the rectangle, ellipse or hilite annotation into region once the user clicks on them.
#ifdef LImageViewerChild
class LImageViewerChild :public LImageViewerCell
{
virtual L_INT AnnotationCallBack(HWND hCellWnd,
L_UINT uMessage,
L_INT nX,
L_INT nY,
L_INT nCellIndex,
L_INT nSubCellIndex);
};
#endif
L_INT LImageViewerChild ::AnnotationCallBack(HWND hCellWnd,
L_UINT uMessage,
L_INT nX,
L_INT nY,
L_INT nCellIndex,
L_INT nSubCellIndex)
{
UNREFERENCED_PARAMETER(hCellWnd);
UNREFERENCED_PARAMETER(nCellIndex);
UNREFERENCED_PARAMETER(nX);
UNREFERENCED_PARAMETER(nY);
UNREFERENCED_PARAMETER(uMessage);
DISPCONTAINERANNATTRIBS AnnAttrib;
AnnAttrib.uStructSize = sizeof(DISPCONTAINERANNATTRIBS);
GetSelectedAnnotationAttributes(nSubCellIndex, &AnnAttrib, 0);
switch(AnnAttrib.uType)
{
case ANNOBJECT_RECT:
case ANNOBJECT_ELLIPSE:
case ANNOBJECT_HILITE:
AnnToRgn(nSubCellIndex, L_RGN_OR, TRUE, 0);
break;
}
return SUCCESS;
}
L_INT LImageViewer_AnnotationCallbacksExample(LImageViewerCell& ImageViewerCell)
{
ImageViewerCell.EnableAnnotationCallBack(TRUE);
return SUCCESS;
}