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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user