LImageViewer::ActiveSubCellChangedCallBack

#include "ltwrappr.h"

virtual L_INT LImageViewer::ActiveSubCellChangedCallBack(nCellIndex, nSubCellIndex, nPreviousSubCellIndex)

L_INT nCellIndex;

/* index of the cell */

L_INT nSubCellIndex;

/* index of the sub-cell */

L_INT nPreviousSubCellIndex;

/* index into the image list attached to the cell */

This callback function is called every time the user changes the active sub-cell.

Parameter

Description

nCellIndex

A zero-based index of the cell, that contains the sub-cell that been changed.

nSubCellIndex

A zero-based index of the new active sub-cell.

nPreviousSubCellIndex

A zero-based index of the sub-cell that was active before changing the active sub-cell index.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This callback happens when the sub-cell is changed, which occurs by:

1.

Clicking on another sub-cell rect.

2.

Scrolling the cell scroll.

In order to use this callback function, it must first be set by calling the LImageViewer::EnableActiveSubCellChangedCallBack 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.

See Also

Functions:

LImageViewer::RegionCallBack, LImageViewer::EnableRegionCallBack, LImageViewer::MouseCallBack, LImageViewer::ActionCallBack, LImageViewer::TagCallBack, LImageViewer::EnableTagCallBack, LImageViewer::AnnotationCallBack, LImageViewer::EnableAnnotationCallBack, LImageViewer::EnableAnnotationCreatedCallBack, LImageViewer::AnnotationCreatedCallBack, LImageViewer::PrePaintCallBack, LImageViewer::EnablePrePaintCallBack, LImageViewer::EnablePostPaintCallBack, LImageViewer::PostPaintCallBack, Class Members

Topics:

Image Viewer Cells

 

Image Viewer Functions: Image Viewer Cells

 

Image Viewer Functions: Callbacks

Example

This example will link the active sub-cell of the first cell to the second cell and vice versa.

#ifdef LImageViewerChild 
class LImageViewerChild :public LImageViewer
{
   virtual L_INT ActiveSubCellChangedCallBack(L_INT    nCellIndex,
                                              L_INT    nSubCellIndex,
                                              L_INT    nPreviousSubCellIndex);
} ; 
#endif 
L_INT LImageViewerChild::ActiveSubCellChangedCallBack(L_INT    nCellIndex,
                                                L_INT    nSubCellIndex,
                                                L_INT    nPreviousSubCellIndex)
{
   UNREFERENCED_PARAMETER(nPreviousSubCellIndex);
   DISPSTACKACTIONPROPS ActionProperties;
   DISPCELLPROPERTIES CellProp;
   CellProp.uStructSize = sizeof(DISPCELLPROPERTIES);
   CellProp.uMask = DCCELLPF_ROWS | DCCELLPF_COLS;
   L_INT nIndex = (nCellIndex == 1) ? 0 : 1;
   ActionProperties.DispContainerActionProps.uStructSize = sizeof(DISPSTACKACTIONPROPS);
   GetActionProperties( CONTAINER_ACTION_STACK, nIndex, 0, &ActionProperties, 0);
   GetCellProperties( nIndex, &CellProp, 0);
   ActionProperties.nActiveSubCell = nSubCellIndex % (CellProp.uNumCols * CellProp.uNumRows);
   ActionProperties.nScrollValue = nSubCellIndex - ActionProperties.nActiveSubCell;
   SetActionProperties( CONTAINER_ACTION_STACK, nIndex, 0, &ActionProperties, CONTAINER_ACTION_CELLLEVEL);
   return SUCCESS;
}
L_INT LImageViewer_ActiveSubCellChangedExample(LImageViewer& ImageViewer)
{
   ImageViewer.EnableActiveSubCellChangedCallBack( TRUE);
   return SUCCESS;
}