From: Vadim Zeitlin Date: Sun, 14 Sep 2008 23:06:36 +0000 (+0000) Subject: need to AdjustScrollbars() after changing the virtual size in CalcDimensions() X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ace8d849d4e972e451b2a2ebbe697efb735f018f?hp=69367c566e7b86f7387f730cd3b4b947a44017df need to AdjustScrollbars() after changing the virtual size in CalcDimensions() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55628 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index ace7f4c362..68a0709125 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -96,7 +96,7 @@ struct wxGridCellWithAttr { if (attr != new_attr) { - // "Delete" (i.e. DecRef) the old attribute. + // "Delete" (i.e. DecRef) the old attribute. attr->DecRef(); attr = new_attr; // Take ownership of the new attribute, i.e. no IncRef. @@ -4688,10 +4688,11 @@ void wxGrid::CalcDimensions() if ( y >= h ) y = wxMax( h - 1, 0 ); - // do set scrollbar parameters + // update the virtual size and refresh the scrollbars to reflect it SetScrollRate(m_scrollLineX, m_scrollLineY); m_gridWin->SetVirtualSize(w, h); Scroll(x, y); + AdjustScrollbars(); // if our OnSize() hadn't been called (it would if we have scrollbars), we // still must reposition the children @@ -9931,7 +9932,7 @@ void wxGrid::ClearAttrCache() // wxSafeDecRec(...) might cause event processing that accesses // the cached attribute, if one exists (e.g. by deleting the // editor stored within the attribute). Therefore it is important - // to invalidate the cache before calling wxSafeDecRef! + // to invalidate the cache before calling wxSafeDecRef! wxSafeDecRef(oldAttr); } } @@ -10346,9 +10347,9 @@ void wxGrid::SetRowSize( int row, int height ) wxClientDC dc(m_rowLabelWin); dc.SetFont(GetLabelFont()); StringToLines(GetRowLabelValue( row ), lines); - GetTextBoxSize( dc, lines, &w, &h ); - //check that it is not less than the minimal height - height = wxMax(h, GetRowMinimalAcceptableHeight()); + GetTextBoxSize( dc, lines, &w, &h ); + //check that it is not less than the minimal height + height = wxMax(h, GetRowMinimalAcceptableHeight()); } // See comment in SetColSize @@ -10409,8 +10410,8 @@ void wxGrid::SetColSize( int col, int width ) else GetTextBoxSize( dc, lines, &h, &w ); width = w + 6; - //check that it is not less than the minimal width - width = wxMax(width, GetColMinimalAcceptableWidth()); + //check that it is not less than the minimal width + width = wxMax(width, GetColMinimalAcceptableWidth()); } // should we check that it's bigger than GetColMinimalWidth(col) here?