#include "ltivw.h"
L_LTIVW_API L_INT L_DispContainerRemoveAction(hCellWnd, nAction, uFlags)
Removes the specified action from the container.
A handle to the window that represents the Medical Viewer Cell.
Value that represents the action to be removed. If nAction is equal to or greater than 100, it is a user-defined action. Otherwise, it can be one of the following predefined actions.
Value | Meaning |
---|---|
CONTAINER_ACTION_NONE | [0] No action |
CONTAINER_ACTION_WINDOWLEVEL | [1] Window leveling |
CONTAINER_ACTION_SCALE | [2] Scaling |
CONTAINER_ACTION_OFFSET | [3] Offset |
CONTAINER_ACTION_STACK | [4] Stacking |
CONTAINER_ACTION_MAG | [5] Magnifying glass |
CONTAINER_ACTION_ALPHA | [6] Alpha |
CONTAINER_ACTION_ANNOTATION_RULER | [7] Ruler annotation |
CONTAINER_ACTION_ANNOTATION_ANGLE | [8] Angle annotation |
CONTAINER_ACTION_ANNOTATION_TEXT | [9] Text annotation |
CONTAINER_ACTION_ANNOTATION_ARROW | [10] Arrow annotation |
CONTAINER_ACTION_ANNOTATION_RECTANGLE | [11] Rectangle annotation |
CONTAINER_ACTION_ANNOTATION_ELLIPSE | [12] Ellipse annotation |
CONTAINER_ACTION_ANNOTATION_HILITE | [13] Highlight annotation |
CONTAINER_ACTION_REGION_RECTANGLE | [14] Rectangular region |
CONTAINER_ACTION_REGION_ELLIPSE | [15] Elliptical region |
CONTAINER_ACTION_REGION_FREEHAND | [16] Free hand region |
CONTAINER_ACTION_REGION_POLYGON | [17] Polygon region |
CONTAINER_ACTION_REGION_MAGICWAND | [18] Magic wand (contiguous color) region |
CONTAINER_ACTION_REGION_COLORRANGE | [19] Color range region |
CONTAINER_ACTION_REGION_CIRCLE | [20] Circular region |
CONTAINER_ACTION_REGION_SQUARE | [21] Square region |
CONTAINER_ACTION_REGION_NUDGETOOL | [22] Nudge tool |
CONTAINER_ACTION_REGION_SHRINKTOOL | [23] Shrink tool |
Reserved for future use. Pass 0.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
When an action is removed from a container, all properties, mouse buttons, and keystroke combinations are also removed.
Required DLLs and Libraries
This function checks whether the action is assigned to a keyboard shortcut or not, if not the function removes it.
L_INT DispContainerRemoveActionExample(HWND hWnd,
HDISPCONTAINER hCon,
L_INT nAction)
{
L_INT nRet;
L_BOOL bActive;
L_UINT uVk1, uVk2, uVk3, uVk4, uModifiers;
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);
// Is the action added to the image viewer.
bActive = L_DispContainerIsActionActive (hCellWnd, nAction, 0);
if (!bActive)
{
// Check whether a keyboard shortcut is assigned to the action or not.
nRet = L_DispContainerGetKeyboardAction(hCellWnd, nAction, CONTAINER_MOUSEMOVE_DOWN, &uVk1, &uModifiers, 0);
if(nRet != SUCCESS)
return nRet;
nRet = L_DispContainerGetKeyboardAction(hCellWnd, nAction, CONTAINER_MOUSEMOVE_DOWN, &uVk2, &uModifiers, 0);
if(nRet != SUCCESS)
return nRet;
nRet = L_DispContainerGetKeyboardAction(hCellWnd, nAction, CONTAINER_MOUSEMOVE_DOWN, &uVk3, &uModifiers, 0);
if(nRet != SUCCESS)
return nRet;
nRet = L_DispContainerGetKeyboardAction(hCellWnd, nAction, CONTAINER_MOUSEMOVE_DOWN, &uVk4, &uModifiers, 0);
if(nRet != SUCCESS)
return nRet;
// If there is no keyboard shortcut assigned to the action the function will remove it.
if ((!uVk1) && (!uVk2) && (!uVk3) && (!uVk4))
{
nRet = L_DispContainerRemoveAction (hCellWnd, nAction, 0);
if(nRet != SUCCESS)
return nRet;
}
}
else
{
MessageBox(hWnd, TEXT("This action is not added to the image viewer"), TEXT("Error!"), MB_OK);
}
return SUCCESS;
}