GetCurrentCell
It retrieve the location of the cursor on the active sheet.
int GetCurrentCell( int & nRow, int & nCol, BOOL bTranslate = true )
-1 if grid not present
0 if no cursor
1 if cursor is in data area, if bTranslate = FALSE, then will just return 1 regardless if in Data or Label region
2 if cursor is in Column Label area but not in Row Label area
4 if cursor is in Row Label area but not in Column Label area
6 if cursor is in both Column Label and Row Label area
EX1
void Grid_GetCurrentCell_ex1() { Worksheet wks = Project.ActiveLayer(); if ( wks ) { Grid grid; grid.Attach(wks); int nRow, nCol; BOOL bTranslate = true; int nRet = grid.GetCurrentCell(nRow, nCol, bTranslate); printf("Select cell in active worksheet is (%d, %d)\n", nRow + 1, nCol + 1); } }
origin.h