It used to always return 0 in the generic version, return the correct index of
the newly inserted column now.
Closes #13677.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71971
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- Added wxDataViewListCtrl::GetItemCount() (Kry).
- Added support for Korean Johab and Vietnamese encodings (jank9201).
- Fix off by 1 bug with setting font size in points in wxHTML (gevorg).
- Added wxDataViewListCtrl::GetItemCount() (Kry).
- Added support for Korean Johab and Vietnamese encodings (jank9201).
- Fix off by 1 bug with setting font size in points in wxHTML (gevorg).
+- Fix return value of wxGenericListCtrl::InsertColumn() (Sebastian Walderich).
long FindItem( const wxPoint& pt );
long HitTest( int x, int y, int &flags ) const;
void InsertItem( wxListItem &item );
long FindItem( const wxPoint& pt );
long HitTest( int x, int y, int &flags ) const;
void InsertItem( wxListItem &item );
- void InsertColumn( long col, const wxListItem &item );
+ long InsertColumn( long col, const wxListItem &item );
int GetItemWidthWithImage(wxListItem * item);
void SortItems( wxListCtrlCompare fn, wxIntPtr data );
int GetItemWidthWithImage(wxListItem * item);
void SortItems( wxListCtrlCompare fn, wxIntPtr data );
RefreshLines(id, GetItemCount() - 1);
}
RefreshLines(id, GetItemCount() - 1);
}
-void wxListMainWindow::InsertColumn( long col, const wxListItem &item )
+long wxListMainWindow::InsertColumn( long col, const wxListItem &item )
m_dirty = true;
if ( InReportView() )
{
m_dirty = true;
if ( InReportView() )
{
node = m_columns.Item( col );
m_columns.Insert( node, column );
m_aColWidths.Insert( colWidthInfo, col );
node = m_columns.Item( col );
m_columns.Insert( node, column );
m_aColWidths.Insert( colWidthInfo, col );
+ idx = m_aColWidths.GetCount();
m_columns.Append( column );
m_aColWidths.Add( colWidthInfo );
}
m_columns.Append( column );
m_aColWidths.Add( colWidthInfo );
}
// invalidate it as it has to be recalculated
m_headerWidth = 0;
}
// invalidate it as it has to be recalculated
m_headerWidth = 0;
}
}
int wxListMainWindow::GetItemWidthWithImage(wxListItem * item)
}
int wxListMainWindow::GetItemWidthWithImage(wxListItem * item)
{
wxCHECK_MSG( InReportView(), -1, wxT("can't add column in non report mode") );
{
wxCHECK_MSG( InReportView(), -1, wxT("can't add column in non report mode") );
- m_mainWin->InsertColumn( col, item );
+ long idx = m_mainWin->InsertColumn( col, item );
// NOTE: if wxLC_NO_HEADER was given, then we are in report view mode but
// still have m_headerWin==NULL
if (m_headerWin)
m_headerWin->Refresh();
// NOTE: if wxLC_NO_HEADER was given, then we are in report view mode but
// still have m_headerWin==NULL
if (m_headerWin)
m_headerWin->Refresh();
}
bool wxGenericListCtrl::ScrollList( int dx, int dy )
}
bool wxGenericListCtrl::ScrollList( int dx, int dy )