L_DispContainerGetActionCount

#include "ltivw.h"

L_LTIVW_API L_INT L_DispContainerGetActionCount(hCellWnd, nCount, uFlags)

HWND hCellWnd;

/* handle to the cell window */

L_INT * nCount;

/* pointer to the variable to be updated */

L_UINT uFlags;

/* reserved for future use */

Gets the number of actions associated with the container.

Parameter

Description

hCellWnd

A handle to the window that represents the Medical Viewer Cell.

nCount

Pointer to a variable to be updated with number of actions associated with the container.

uFlags

Reserved for future use. Pass 0.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Call L_DispContainerAddAction to add an action to a container and call L_DispContainerRemoveAction to remove an action from the container.

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_DispContainerAddAction, L_DispContainerSetAction, L_DispContainerSetActionProperties, L_DispContainerGetActionProperties, L_DispContainerRemoveAction, L_DispContainerSetKeyboardAction, L_DispContainerGetKeyboardAction, L_DispContainerIsActionActive, L_DispContainerGetActionCallBack, L_DispContainerSetActionCallBack

Topics:

Applying Actions

 

Image Viewer Functions: Applying Actions

Example

Remove the actions and remove all the cells and the bitmap lists attached.

#if defined LEADTOOLS_V17_OR_LATER
 L_INT DispContainerGetActionCountExample(HDISPCONTAINER hCon) 
{
   L_INT nRet;
   L_UINT uCount; 

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

   // Check if there is any action added to the container. 
   nRet = L_DispContainerGetActionCount(hCellWnd, (L_INT *)&uCount, 0); 
   if(nRet != SUCCESS)
      return nRet;

   // Remove all the actions. 
   if (uCount != 0) 
   {
      nRet = L_DispContainerRemoveAction (hCellWnd, -1, 0); 
      if(nRet != SUCCESS)
         return nRet;
   }

   // Check if there is any cell inserted to the container. 
   uCount = L_DispContainerGetCellCount (hCon, 0); 

   // Remove all the cells, along with the attached images. 
   if (uCount != 0) 
   {
      nRet = L_DispContainerRemoveCell (hCon, -1, 0); 
      if(nRet != SUCCESS)
         return nRet;
   }
   return SUCCESS;
}

#else



 L_INT DispContainerGetActionCountExample(HDISPCONTAINER hCon) 
{
   L_INT nRet;
   L_UINT uCount; 

   // Check if there is any action added to the container. 
   nRet = L_DispContainerGetActionCount(hCon, (L_INT *)&uCount, 0); 
   if(nRet != SUCCESS)
      return nRet;

   // Remove all the actions. 
   if (uCount != 0) 
   {
      nRet = L_DispContainerRemoveAction (hCon, -1, 0); 
      if(nRet != SUCCESS)
         return nRet;
   }

   // Check if there is any cell inserted to the container. 
   uCount = L_DispContainerGetCellCount (hCon, 0); 

   // Remove all the cells, along with the attached images. 
   if (uCount != 0) 
   {
      nRet = L_DispContainerRemoveCell (hCon, -1, TRUE, 0); 
      if(nRet != SUCCESS)
         return nRet;
   }
   return SUCCESS;
}

#endif