i've got a problem today where i think many people noticed that problem too.
i have to view information in a wxListCtrl,
the Size of the Coloums should be as least as possible, but it should show all data. (all data means the Header and all Rows,
on MSW wxWidgets are supporting wxLIST_AUTOSIZE and wxLIST_AUTOSIZE_USEHEADER.
i made a workaround using this 2 features.
but it works only on MSW because wxLIST_AUTOSIZE_USEHEADER works just under MSW correct.
Code: Select all
//from the first, to the last
int i;
for( i = 0; i <= yourLastColoumn; i++)
{
int minSize = 0;
m_pListCtrl->SetColumnWidth( i, wxLIST_AUTOSIZE );
minSize = m_pListCtrl->GetColumnWidth( i );
m_pListCtrl->SetColumnWidth( i, wxLIST_AUTOSIZE_USEHEADER );
if (m_pListCtrl->GetColumnWidth(i) < minSize )
{
m_pListCtrl->SetColumnWidth( i, minSize );
}
}