CGXGridCore::OnLeftCell

virtual BOOL OnLeftCell(ROWCOL nRow, ROWCOL nCol, ROWCOL nNewRow, ROWCOL nNewCol);?

nRow

Specifies the row id of the old current cell.

nCol

Specifies the column id of the old current cell.

nNewRow

Specifies the row id of the new current cell.

nNewCol

Specifies the column id of the new current cell.

Return Value

Specifies whether SetCurrentCell needs to refresh the current cell. If you return FALSE, SetCurrentCell will not do any further refreshing.

Remarks

Called from CGXControl::OnLeftCell after the current cell has been deactivated. So, at the time this event is called, there is no current cell in the grid. Override this method if you want to hook into refreshing the current cell after being deactivated.

See the description of SetCurrentCell for further information on what events are called when the current cell is positioned to a new cell.

Example

This example shows you the implemenation of OnLeftCell in CGXBrowserGrid. When the user has moved the current cell to a new row, CGXBrowserGrid needs to redraw the whole row. OnLeftCell will return FALSE to prevent flickering.

// OnLeftCell
//
// OnLeftCell is called after the old current cell has been deactivated.
// So, at the time this event is called, there is no current cell in
// the grid.
//
BOOL CGXBrowserGrid::OnLeftCell(ROWCOL nRow, ROWCOL nCol, ROWCOL nNewRow, ROWCOL nNewCol)
{
   // Unused:
   nRow, nCol, nNewCol;
   CGXBrowseParam* pBrowseData = GetBrowseParam( );
   if (m_bUpdateDone && nNewRow != pBrowseData->m_nCurrentRow)
   {
      RedrawRowCol(CGXRange( ).SetRows(pBrowseData->m_nCurrentRow));
         // no further redrawing of current cell necessary
      return FALSE;
   }
   return TRUE; // SetCurrentCell will redraw current cell
}

See Also

 CGXGridCore::SetCurrentCell  CGXControl::OnLeftCell

CGXGridCore

 Class Overview |  Class Members