Fixes to my last commit.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis 2002-04-27 10:37:15 +00:00
parent cf760e4c30
commit 68c5a31c6c

View File

@ -6724,7 +6724,12 @@ void wxGrid::ShowCellEditControl()
#endif // 0
// cell is shifted by one pixel
// However, don't allow x or y to become negative
// since the SetSize() method interprets that as
// "don't change."
if (rect.x > 0)
rect.x--;
if (rect.y > 0)
rect.y--;
wxGridCellAttr* attr = GetCellAttr(row, col);
@ -6859,15 +6864,15 @@ static int CoordToRowOrCol(int coord, int defaultDist, int minDist,
}
if ( coord > BorderArray[i_max])
return -1;
if ( coord < BorderArray[0] )
return 0;
while ( i_max - i_min > 1 )
while ( i_max - i_min > 0 )
{
wxCHECK_MSG(BorderArray[i_min] <= coord && coord < BorderArray[i_max],
-1, _T("wxGrid: internal error in CoordToRowOrCol"));
if (coord >= BorderArray[ i_max - 1])
{
return i_max;
}
else
i_max--;
int median = i_min + (i_max - i_min + 1) / 2;
@ -6899,8 +6904,10 @@ int wxGrid::XToCol( int x )
int wxGrid::YToEdgeOfRow( int y )
{
int i, d;
for ( i = YToRow( y ) - 1; i < m_numRows; i++ )
i = YToRow(y);
if ( i > 0 )
i--;
for ( ; i < m_numRows; i++ )
{
if ( GetRowHeight(i) > WXGRID_LABEL_EDGE_ZONE )
{
@ -6920,8 +6927,10 @@ int wxGrid::YToEdgeOfRow( int y )
int wxGrid::XToEdgeOfCol( int x )
{
int i, d;
for (i = XToCol( x ) - 1; i < m_numCols; i++ )
i = XToCol(x);
if ( i > 0 )
i--;
for ( ; i < m_numCols; i++ )
{
if ( GetColWidth(i) > WXGRID_LABEL_EDGE_ZONE )
{