LImageViewer::RepositionCell

Summary

Sets the position of the specified cell, based on the index of the cell.

Syntax

#include "ltwrappr.h"

L_INT LImageViewer::RepositionCell (nCellIndex, nTargetIndex, bSwap, uFlags);

Parameters

L_INT nCellIndex

A zero-based index of the cell for which to set the position.

L_INT nTargetIndex

A zero-based index of the new cell position.

L_BOOL bSwap

Flag that indicates whether to perform swap on the cells specified in nCellIndex and nTargetIndex, or to shift the cells according to the parameters and then set the cell with nCellIndex, in the position of nTargetIndex.  Possible values are:

Value Meaning
TRUE Swap the cells.
FALSE Shift the cells.

L_UINT uFlags

Reserved for future use. Pass 0.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. To get extended error information, call GetLastError, and refer to Return Codes.

Comments

The row and column numbers obtained by this function are relative to the first cell in the container.

Set the bSwap flag to TRUE to swap the nCellIndex and nTargetIndex. Otherwise the function will shift the cells and then place the cell with the cell index nCellIndex in the exposed area. See the following illustration:

bSwap value when nCellIndex = 2 and nTargetIndex = 6 Cell order:
1 2 3 ... 4 5 6
TRUE 1 6 3 4 5 2
FALSE 1 3 4 5 6 2

Required DLLs and Libraries

See Also

Functions

Topics

Example

The following function shuffles the order of the cells:

L_INT LImageViewer_RepositionCellExample(LImageViewer& ImageViewer)  
{ 
   L_INT nRet; 
   L_INT nI, nCount;  
 
   // Get the Cell Count 
   nCount = ImageViewer.GetCellCount(0) ;  
 
   srand((L_INT)GetCurrentTime()); 
 
   // Shuffle all the cells 
 
   for (nI = 0; nI < nCount; nI++) 
   { 
      nRet = ImageViewer.RepositionCell(nI, (rand() % nCount), 0, 0);  
      if(nRet != SUCCESS) 
         return nRet; 
   } 
 
   return SUCCESS; 
} 

Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Medical Image Viewer C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.