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 it’s a user-defined action. Otherwise it should be one of these predefined actions.

 

Value

Meaning

 

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

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:

 

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.