L_DispContainerSetAction

#include "ltivw.h"

L_LTIVW_API L_INT L_DispContainerSetAction(hCellWnd, nAction, nMouseButton, uFlags)

L_HWND hCellWnd;

handle to the cell window

L_INT nAction;

action to set

L_INT nMouseButton;

mouse button indicator

L_UINT uFlags;

flag

Specifies the action for each one of the mouse buttons.

Parameter Description
hCellWnd A handle to the window that represents the Medical Viewer Cell.
nAction Value that indicates the action to associate with the specified mouse button. If nAction is equal or greater than 100 then its a user-defined action. Otherwise, it can be one of the following predefined actions:
  Value Meaning
  CONTAINER_ACTION_NONE [0] No action. Also referred to as select mode." In this mode no action is applied when the mouse is dragged. You can still select, adjust and move the annotation objects.
  CONTAINER_ACTION_WINDOWLEVEL [1] Window leveling. Moving the mouse horizontally controls the window center parameter of the window level. Moving the mouse vertically controls the window width parameter of the window level.
  CONTAINER_ACTION_SCALE [2] Scaling. Moving the mouse vertically controls the scale factor of the image.
  CONTAINER_ACTION_OFFSET [3] Offset. Moving the mouse to any direction causes the image to move towards that direction.
  CONTAINER_ACTION_STACK [4] Stacking. Moving the mouse vertically scrolls through the frames.
  CONTAINER_ACTION_MAG [5] Magnifying glass. Moving the mouse causes the magnify glass object to move
  CONTAINER_ACTION_ALPHA [6] Alpha. Moving the mouse horizontally changes the alpha factor of the LUT curve.
  CONTAINER_ACTION_ANNOTATION_RULER [7] Ruler annotation. Clicking and dragging creates a ruler object.
  CONTAINER_ACTION_ANNOTATION_ANGLE [8] Angle annotation. Clicking and dragging creates an angle object.
  CONTAINER_ACTION_ANNOTATION_TEXT [9] Text annotation. Clicking and dragging creates a text object.
  CONTAINER_ACTION_ANNOTATION_ARROW [10] Arrow annotation. Clicking and dragging creates an arrow object.
  CONTAINER_ACTION_ANNOTATION_RECTANGLE [11] Rectangle annotation. Clicking and dragging creates a rectangle object.
  CONTAINER_ACTION_ANNOTATION_ELLIPSE [12] Ellipse annotation. Clicking and dragging creates an ellipse object.
  CONTAINER_ACTION_ANNOTATION_HILITE [13] Highlight annotation. Clicking and dragging creates a Highlight object.
  CONTAINER_ACTION_REGION_RECTANGLE [14] Rectangular region. Clicking and dragging creates a rectangular region.
  CONTAINER_ACTION_REGION_ELLIPSE [15] Elliptical region. Clicking and dragging creates an elliptical region.
  CONTAINER_ACTION_REGION_FREEHAND [16] Free hand region. Clicking and dragging creates a free hand region.
  CONTAINER_ACTION_REGION_POLYGON [17] Polygon region. Clicking defines the point of the polygon. Double clicking closes the polygon region.
  CONTAINER_ACTION_REGION_MAGICWAND Magic Wand Region: sets a region based on the color at a selected point, growing outward in all directions from that point. Dragging increases the variation allowed from the selected color.
  CONTAINER_ACTION_REGION_COLORRANGE [19] Color range region. Moving the mouse horizontally controls the lower tolerance. Moving the mouse vertically controls the upper tolerance.
  CONTAINER_ACTION_REGION_CIRCLE [20] Circular region. Clicking and dragging creates a circular region.
  CONTAINER_ACTION_REGION_SQUARE [21] Square region. Clicking and dragging creates a square region.
  CONTAINER_ACTION_REGION_NUDGETOOL 22] Nudge tool. Clicking and dragging will add a region to the existing region (if exists). Pressing Shift while pressing the mouse will inverse this effect, making it act like the shrink tool. This action can be used as a nudge tool to nudge the edge of the existing region, or it can be used as a region painter. You can change the shape and size of the brush  using the properties of the corresponding structure and then send it through the function L_DispContainerSetActionProperites. For more information, see DISPNUDGETOOLACTIONPROPS.
  CONTAINER_ACTION_REGION_SHRINKTOOL [23] Shrink tool. Clicking and dragging will remove parts of the region from the existing region (if exists). Pressing Shift while pressing the mouse will inverse this effect, making it act like the nudge tool. This action can be used to reduce or trim the existing region.  You can change the shape and size of the brush using the properties of the corresponding structure, and then send it through the function L_DispContainerSetActionProperites. For more information, see DISPNUDGETOOLACTIONPROPS.

 

nMouseButton Value that indicates the mouse event to be associated with the specified action. Possible values are:
  Value Meaning
  CONTAINER_MOUSE_BUTTON_NONE [0x000] No button is attached.
  CONTAINER_MOUSE_BUTTON_LEFT [0x001] Left mouse button.
  CONTAINER_MOUSE_BUTTON_RIGHT [0x002] Right mouse button.
  CONTAINER_MOUSE_BUTTON_MIDDLE [0x003] Middle mouse button.
  CONTAINER_MOUSE_WHEEL [0x004] Mouse wheel.
  CONTAINER_MOUSE_BUTTON_XBUTTON1 [0x005] X button 1.
  CONTAINER_MOUSE_BUTTON_XBUTTON2 [0x006] X button 2.
uFlags Flags that indicate the cells to which the action is applied and when the action is applied.  Possible values are:

 

  Value Meaning
  DCACTION_ACTIVEONLY [0x0001] Apply the effect on the active cell window only.
  DCACTION_ALLCELLS [0x0004] Apply the effect on all the cells.
  DCACTION_SELECTED [0x0002] Apply the effect on the selected cells only.
  The following flags indicate when the action is applied, these flags are only useful when combining them with either DCACTION_ALLCELLS or DCACTION_SELECTED, because they only apply to how the action will be applied on more than one cell.
  Value Meaning
  DCACTION_REALTIME [0x0010] Apply the action during the mouse movement. This option is only valid if either DCACTION_ALLCELLS or DCACTION_SELECTED is also set.
  DCACTION_ONRELEASE [0x0020] Apply the action after releasing the mouse button. This option is only valid if either DCACTION_ALLCELLS or DCACTION_SELECTED is also set.
  DCACTION_KEEPPREVIOUSASSIGNMENT [0x0100] This flag tells the engine not to remove the action previous mouse button assignment. For example if you previously set an action to the left mouse button, then assigned the same action to the right mouse button while using this flag, the action then can be activated using either the left or the right mouse button.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

An action must be added to a container before it can be assigned to a mouse button. To add an action to a container call L_DispContainerAddAction.

If an action is set to a mouse button that is already used by another action, the new action will overwrite the old one.

The L_DispContainerIsButtonValid function is preferred to use before calling this function to check the validity of assigning a button to a specific action.  For example, if the user passed CONTAINER_MOUSE_WHEEL to the MouseButton parameter and CONTAINER_ACTION_MAG to the nAction parameter, the function will return ERROR_INV_PARAMETER, while if the same values are passed as parameters to the function L_DispContainerIsButtonValid, the function will return 0 as an indication that the mouse button is not valid for this action.

uFlags is used only with the following actions:

Window level

Alpha

Offset

Scale

Stack

for any other action, uFlags must  be 0, otherwise, the function will return ERROR_INV_PARAMETER.

Actions can also be associated with keystroke combinations. To assign an action to a keystroke combination, call L_DispContainerSetKeyboardAction.

To retrieve the mouse button associated with the specific action, call the L_DispContainerGetActionButton 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.

Help Version 19.0.2017.10.18
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Medical Image Viewer C API Help