Correctly determine best wxPropertyGrid width.

Improve wxPropertyGrid::DoGetBestSize() to correctly determine the window
width by using the sum of columns widths.

Also correct wxPropertyGridPageState::GetColumnFitWidth() to account for the
bitmaps.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-08-31 21:28:25 +00:00
parent a4dac1907b
commit 890defb4f3
2 changed files with 13 additions and 3 deletions

View File

@@ -1130,7 +1130,15 @@ wxSize wxPropertyGrid::DoGetBestSize() const
10
);
const wxSize sz = wxSize(60, lineHeight*numLines + 40);
wxClientDC dc(const_cast<wxPropertyGrid *>(this));
int width = m_marginWidth;
for ( unsigned int i = 0; i < m_pState->m_colWidths.size(); i++ )
{
width += m_pState->GetColumnFitWidth(dc, m_pState->DoGetRoot(), i, true);
}
const wxSize sz = wxSize(width, lineHeight*numLines + 40);
CacheBestSize(sz);
return sz;
}