relayout the window after adding/removing the columns (fixes a SF bug I closed a long time ago -- but forgot to commit the fix)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15877 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -4956,6 +4956,13 @@ void wxListCtrl::ClearAll()
|
|||||||
bool wxListCtrl::DeleteColumn( int col )
|
bool wxListCtrl::DeleteColumn( int col )
|
||||||
{
|
{
|
||||||
m_mainWin->DeleteColumn( col );
|
m_mainWin->DeleteColumn( col );
|
||||||
|
|
||||||
|
// if we don't have the header any longer, we need to relayout the window
|
||||||
|
if ( !GetColumnCount() )
|
||||||
|
{
|
||||||
|
ResizeReportView(FALSE /* no header */);
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5027,8 +5034,17 @@ long wxListCtrl::InsertItem( long index, const wxString &label, int imageIndex )
|
|||||||
|
|
||||||
long wxListCtrl::InsertColumn( long col, wxListItem &item )
|
long wxListCtrl::InsertColumn( long col, wxListItem &item )
|
||||||
{
|
{
|
||||||
wxASSERT( m_headerWin );
|
wxCHECK_MSG( m_headerWin, -1, _T("can't add column in non report mode") );
|
||||||
|
|
||||||
m_mainWin->InsertColumn( col, item );
|
m_mainWin->InsertColumn( col, item );
|
||||||
|
|
||||||
|
// if we hadn't had header before and have it now we need to relayout the
|
||||||
|
// window
|
||||||
|
if ( GetColumnCount() == 1 )
|
||||||
|
{
|
||||||
|
ResizeReportView(TRUE /* have header */);
|
||||||
|
}
|
||||||
|
|
||||||
m_headerWin->Refresh();
|
m_headerWin->Refresh();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user