DISPCONTAINERACTIONCALLBACK Callback Function

#include "ltivw.h"

L_INT pEXT_CALLBACK YourFunction(nCellIndex, phBitmapList, uCount, nAction, uMessage, wParam, ptMousePos, pUserData)

L_INT nCellIndex;

/* index of the cell */

HBITMAPLIST * phBitmapList;

/* array of bitmap lists */

L_UINT uCount;

/* number of bitmap lists */

L_INT nAction;

/* action ID */

L_UINT uMessage;

/* message */

WPARAM wParam;

/* extended parameter of the message */

POINT * ptMousePos;

/* mouse position */

L_VOID * pUserData;

/* user data */

This callback function is called each time the user clicks or drags the mouse, rotates the mouse wheel, or presses a keyboard button, if the mouse or keyboard event is associated with a user-defined action.

Parameter

Description

nCellIndex

A zero-based index of the cell which recieved the action.

phBitmapList

An array of bitmap lists that represent all the bitmap lists of all cells selected by the user.

uCount

The number of bitmap lists referenced by phBitmapList.

nAction

Value that indicates the action associated with the mouse or keyboard event. Since this callback is used for user-defined actions, this value should be >= 100. Otherwise, it can be one of the following 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

 

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.

uMessage

Value that represents the message from either the mouse or the keyboard. Possible values are:

 

WM_KEYDOWN

 

WM_KEYUP

 

WM_LBUTTONDOWN

 

WM_LBUTTONUP

 

WM_MBUTTONDOWN

 

WM_MBUTTONUP

 

WM_XBUTTONDOWN

 

WM_XBUTTONUP

 

WM_MOUSEMOVE

 

WM_MOUSEWHEEL

 

WM_RBUTTONDOWN

 

WM_RBUTTONUP

wParam

Additional message information.

ptMousePos

A point that represents the position of the cursor.

pUserData

A void pointer that you can use to access a variable or structure containing data that your callback function needs. This gives you a way to receive data indirectly from the function that uses this callback function. (This is the same pointer that you pass in the pUserData parameter of L_DispContainerCreate) Keep in mind that this is a void pointer, which must be cast to the appropriate data type within your callback function.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

A user-defined action is added to a container by calling L_DispContainerSetAction. If a mouse or keyboard event that is associated with a user-defined action occurs, this callback function is called to allow the user to handle the action.

In order to use this callback function, it must first be set by calling L_DispContainerSetActionCallback.

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_DispContainerSetTagCallBack, L_DispContainerGetTagCallBack, L_DispContainerSetActionCallBack, L_DispContainerGetActionCallBack, DISPCONTAINERTAGCALLBACK

Topics:

Applying Actions

 

Image Viewer Functions: Callbacks

 

Image Viewer Functions: Applying Actions

Example

For an example, refer to L_DispContainerGetActionCallBack.