L_DispContainerGetCellPosition

Summary

Retrieves the column and row number for the cell with the specified index.

Syntax

#include "ltivw.h"

L_LTIVW_API L_INT L_DispContainerGetCellPosition(hCon, nCellIndex, puRow, puCol, uFlags)

Parameters

HDISPCONTAINER hCon

Handle to the container.

L_INT nCellIndex

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

L_UINT * puRow

Pointer to a variable to be updated with the vertical position (row) of the specified cell. Row numbering starts with 1.

L_UINT * puCol

Pointer to a variable to be updated with the horizontal position (column) of the specified cell. Column numbering starts with 1.

L_UINT uFlags

Reserved for future use. Pass 0.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

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

Required DLLs and Libraries

See Also

Functions

Topics

Example

This function scroll down or up in order to make the cell become visible

L_INT DispContainerGetCellPositionExample(HDISPCONTAINER hCon, 
                                                          L_INT          nCellIndex) 
{ 
   L_INT nRet; 
   L_INT nCount;  
   L_UINT uRow;  
   L_UINT uCol;  
   DISPCONTAINERPROPERTIES DispContainerProp;  
 
   // Get Cells Count 
   nCount = L_DispContainerGetCellCount (hCon, 0);  
 
   if ((nCellIndex < 0) || (nCellIndex >= nCount))  
      return 0;  
 
   // get the row count of the container 
   DispContainerProp.uStructSize = sizeof(DISPCONTAINERPROPERTIES);  
   DispContainerProp.uMask = DCPF_NUMROWS;  
   nRet = L_DispContainerGetProperties (hCon, &DispContainerProp, 0);  
   if(nRet != SUCCESS) 
      return nRet; 
 
   // get the row and the col position 
   nRet = L_DispContainerGetCellPosition(hCon, nCellIndex, &uRow, &uCol, 0);  
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = L_DispContainerSetFirstVisibleRow (hCon, max(0, ((L_INT)uRow - (L_INT)DispContainerProp.uNumRows + 1)), 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 API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.