ensure that wxGrid::AutoSizeColumn/Row() never sets column/row size smaller than the minimal size

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@50224 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2007-11-24 17:55:14 +00:00
parent 1129ffa76d
commit d2e72b6805
2 changed files with 14 additions and 0 deletions

View File

@@ -95,6 +95,8 @@ All (GUI):
- Added wxWindow::GetNextSibling() and GetPrevSibling() - Added wxWindow::GetNextSibling() and GetPrevSibling()
- Support wxGRID_AUTOSIZE in wxGrid::SetRow/ColLabelSize() (Evgeniy Tarassov) - Support wxGRID_AUTOSIZE in wxGrid::SetRow/ColLabelSize() (Evgeniy Tarassov)
- Ensure that wxGrid::AutoSizeColumn/Row() never sets column/row size
smaller than the minimal size
All (Unix): All (Unix):

View File

@@ -10529,6 +10529,12 @@ void wxGrid::AutoSizeColOrRow( int colOrRow, bool setAsMin, bool column )
if ( column ) if ( column )
{ {
// Ensure automatic width is not less than minimal width. See the
// comment in SetColSize() for explanation of why this isn't done
// in SetColSize().
if ( !setAsMin )
extentMax = wxMax(extentMax, GetColMinimalWidth(col));
SetColSize( col, extentMax ); SetColSize( col, extentMax );
if ( !GetBatchCount() ) if ( !GetBatchCount() )
{ {
@@ -10544,6 +10550,12 @@ void wxGrid::AutoSizeColOrRow( int colOrRow, bool setAsMin, bool column )
} }
else else
{ {
// Ensure automatic width is not less than minimal height. See the
// comment in SetColSize() for explanation of why this isn't done
// in SetRowSize().
if ( !setAsMin )
extentMax = wxMax(extentMax, GetRowMinimalHeight(row));
SetRowSize(row, extentMax); SetRowSize(row, extentMax);
if ( !GetBatchCount() ) if ( !GetBatchCount() )
{ {