LImageViewer::SetAction

#include "ltwrappr.h"

L_INT LImageViewer::SetAction (nAction, nMouseButton, uFlags);

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. This function is available only in the Medical Imaging Suite toolkits.

Parameter

Description

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_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 moving 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 hilite 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

[18] Magic wand region. Clicking defines the start point of the magic wand. Dragging increases the magic wand threshold.

 

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.

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. The following flags indicate the cells to which the action is applied:

 

Possible values are:

 

Value

Meaning

 

DCACTION_ACTIVEONLY

[0x0000] Apply the effect on the active cell window only.

 

DCACTION_ALLCELLS

[0x0001] 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:

 

DCACTION_REALTIME

[0x0000] Apply the action during the mouse movement. This option is only valid if either DCACTION_ALLCELLS or DCACTION_SELECTED is also set.

 

DCACTION_ONRELEASE

[0x0001] Apply the action after releasing the mouse button. This option is only valid if either DCACTION_ALLCELLS or DCACTION_SELECTED is also set.

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 LImageViewer::AddAction.

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

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

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:

LImageViewer::AddAction, LImageViewer::SetActionProperties, LImageViewer::GetActionProperties, LImageViewer::RemoveAction, LImageViewer::GetActionCount, LImageViewer::SetKeyboardAction, LImageViewer::GetKeyboardAction, LImageViewer::IsActionActive, LImageViewer::EnableActionCallBack, Class Members

Topics:

Applying Actions

 

Window Control/Image Viewer Functions: Applying Actions

Example

For an example, refer to LImageViewer::Create.