L_DispContainerGetActiveSubCellChangedCallBack

#include "l_bitmap.h"

L_LTIVW_API L_INT EXT_FUNCTION L_DispContainerGetActiveSubCellChangedCallBack (hCellWnd, ppfnCallBack, ppUserData)

HWND hCellWnd;

/* handle to the cell window */

DISPCONTAINERACTIVESUBCELLCHANGED * ppfnCallBack;

/* pointer to the callback function */

LPVOID * ppUserData;

/* pointer to be updated with user data */

Gets a callback function that 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.

ppfnCallBack

Pointer to a pointer to a callback function to be updated with the last active sub-cell changed callback function set using L_DispContainerGetActiveSubCellChangedCallBack.

ppUserData

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.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function gets the active sub-cell changed callback. To set the active sub-cell changed callback use L_DispContainerSetActiveSubCellChangedCallBack.

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

Functions:

L_DispContainerSetRegionCallBack, L_DispContainerGetRegionCallBack, L_DispContainerSetMouseCallBack, L_DispContainerSetActionCallBack, L_DispContainerSetTagCallBack, L_DispContainerGetTagCallBack, L_DispContainerSetAnnotationCallBack, L_DispContainerGetAnnotationCallBack, L_DispContainerGetAnnotationCreatedCallBack, L_DispContainerSetAnnotationCreatedCallBack, L_DispContainerSetPrePaintCallBack, L_DispContainerGetPrePaintCallBack, DISPCONTAINERPREPAINTCALLBACK, L_DispContainerGetPostPaintCallBack, L_DispContainerSetPostPaintCallBack, DISPCONTAINERPOSTPAINTCALLBACK, DISPCONTAINERANNOTATIONCALLBACK, DISPCONTAINERANNOTATIONCREATEDCALLBACK, DISPCONTAINERTAGCALLBACK, DISPCONTAINERACTIONCALLBACK

Topics:

Image Viewer Cells

 

Image Viewer Functions: Image Viewer Cells

Example

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

#if defined LEADTOOLS_V17_OR_LATER


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;
}

#else





L_INT EXT_FUNCTION ActiveSubCellChangedCallBack(L_INT    nCellIndex,
                                                L_INT    nSubCellIndex,
                                                L_INT    nPreviousSubCellIndex,
                                                L_VOID * pUserData)
{
   UNREFERENCED_PARAMETER(nPreviousSubCellIndex);
   HDISPCONTAINER hCon = (HDISPCONTAINER)pUserData;
   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);

   L_DispContainerGetActionProperties(hCon, CONTAINER_ACTION_STACK, nIndex, 0, &ActionProperties, 0);
   L_DispContainerGetCellProperties(hCon, nIndex, &CellProp, 0);
   ActionProperties.nActiveSubCell = nSubCellIndex % (CellProp.uNumCols * CellProp.uNumRows);
   ActionProperties.nScrollValue = nSubCellIndex - ActionProperties.nActiveSubCell;
   L_DispContainerSetActionProperties(hCon, CONTAINER_ACTION_STACK, nIndex, 0, &ActionProperties, CONTAINER_ACTION_CELLLEVEL);

   return SUCCESS;
}


L_INT DispContainerActiveSubCellChangedExample(HDISPCONTAINER hCon)
{
   DISPCONTAINERACTIVESUBCELLCHANGED oldCallBack;
   L_VOID *                          pOldUserData;


   L_DispContainerGetActiveSubCellChangedCallBack(hCon, &oldCallBack, &pOldUserData);

   L_DispContainerSetActiveSubCellChangedCallBack(hCon, ActiveSubCellChangedCallBack, hCon);

   return SUCCESS;
}

#endif