HexEdit/GridCtrl_src/GridCtrl.cpp
CCellRange CGridCtrl::GetUnobstructedNonFixedCellRange(BOOL bForceRecalculation /*=FALSE*/)
{
    CRect rect;
    GetClientRect(rect);

    CCellID idTopLeft = GetTopleftNonFixedCell(bForceRecalculation);

    // calc bottom
    int bottom = GetFixedRowHeight();
	int i;
    for (i = idTopLeft.row; i < GetRowCount(); i++)
    {
        bottom += GetRowHeight(i);
        if (bottom >= rect.bottom)
            break;
    }
    int maxVisibleRow = min(i, GetRowCount() - 1);
    if (maxVisibleRow > 0 && bottom > rect.bottom)
        maxVisibleRow--;

    // calc right
    int right = GetFixedColumnWidth();
    for (i = idTopLeft.col; i < GetColumnCount(); i++)
    {
        right += GetColumnWidth(i);
        if (right >= rect.right)
            break;
    }
    int maxVisibleCol = min(i, GetColumnCount() - 1);
    if (maxVisibleCol > 0 && right > rect.right)
        maxVisibleCol--;


    return CCellRange(idTopLeft.row, idTopLeft.col, maxVisibleRow, maxVisibleCol);
}
// used by ResetScrollBars() - This gets only fully visible cells

used by ResetScrollBars() - This gets only fully visible cells
used by ResetScrollBars () - This gets only fully visible cells
CCellRange CGridCtrl::GetUnobstructedNonFixedCellRange(BOOL bForceRecalculation )
{
    CRect rect;
    GetClientRect(rect);
    CCellID idTopLeft = GetTopleftNonFixedCell(bForceRecalculation);
    int bottom = GetFixedRowHeight();
	int i;
    for (i = idTopLeft.row; i < GetRowCount(); i++)
    {
        bottom += GetRowHeight(i);
        if (bottom >= rect.bottom)
            break;
    }
    int maxVisibleRow = min(i, GetRowCount() - 1);
    if (maxVisibleRow > 0 && bottom > rect.bottom)
        maxVisibleRow--;
    int right = GetFixedColumnWidth();
    for (i = idTopLeft.col; i < GetColumnCount(); i++)
    {
        right += GetColumnWidth(i);
        if (right >= rect.right)
            break;
    }
    int maxVisibleCol = min(i, GetColumnCount() - 1);
    if (maxVisibleCol > 0 && right > rect.right)
        maxVisibleCol--;
    return CCellRange(idTopLeft.row, idTopLeft.col, maxVisibleRow, maxVisibleCol);
}
CCellRange CGridCtrl :: GetUnobstructedNonFixedCellRange ( BOOL bForceRecalculation ) { CRect rect ; GetClientRect ( rect ) ; CCellID idTopLeft = GetTopleftNonFixedCell ( bForceRecalculation ) ; int bottom = GetFixedRowHeight ( ) ; int i ; for ( i = idTopLeft . row ; i < GetRowCount ( ) ; i ++ ) { bottom += GetRowHeight ( i ) ; if ( bottom >= rect . bottom ) break ; } int maxVisibleRow = min ( i , GetRowCount ( ) - 1 ) ; if ( maxVisibleRow > 0 && bottom > rect . bottom ) maxVisibleRow -- ; int right = GetFixedColumnWidth ( ) ; for ( i = idTopLeft . col ; i < GetColumnCount ( ) ; i ++ ) { right += GetColumnWidth ( i ) ; if ( right >= rect . right ) break ; } int maxVisibleCol = min ( i , GetColumnCount ( ) - 1 ) ; if ( maxVisibleCol > 0 && right > rect . right ) maxVisibleCol -- ; return CCellRange ( idTopLeft . row , idTopLeft . col , maxVisibleRow , maxVisibleCol ) ; }
used by ResetScrollBars() - This gets only fully visible cells
used by ResetScrollBars () - This gets only fully visible cells
/*=FALSE*/ // calc bottom
 // calc right
