Override ClearColumns() in wxDataViewListCtrl.
Without this, the associated store's columns would be out of sync, causing asserts next time a column is appended. Fixes #14952. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75258 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -972,6 +972,9 @@ public:
|
|||||||
void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxUIntPtr data = 0 );
|
void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxUIntPtr data = 0 );
|
||||||
void DeleteItem( unsigned int pos );
|
void DeleteItem( unsigned int pos );
|
||||||
void DeleteAllItems();
|
void DeleteAllItems();
|
||||||
|
#if wxABI_VERSION >= 30001
|
||||||
|
void ClearColumns();
|
||||||
|
#endif
|
||||||
|
|
||||||
unsigned int GetItemCount() const;
|
unsigned int GetItemCount() const;
|
||||||
|
|
||||||
@@ -1040,6 +1043,9 @@ public:
|
|||||||
virtual bool PrependColumn( wxDataViewColumn *col );
|
virtual bool PrependColumn( wxDataViewColumn *col );
|
||||||
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col );
|
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col );
|
||||||
virtual bool AppendColumn( wxDataViewColumn *col );
|
virtual bool AppendColumn( wxDataViewColumn *col );
|
||||||
|
#if wxABI_VERSION >= 30001
|
||||||
|
virtual bool ClearColumns();
|
||||||
|
#endif
|
||||||
|
|
||||||
wxDataViewColumn *AppendTextColumn( const wxString &label,
|
wxDataViewColumn *AppendTextColumn( const wxString &label,
|
||||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||||
|
@@ -1790,6 +1790,11 @@ void wxDataViewListStore::DeleteAllItems()
|
|||||||
Reset( 0 );
|
Reset( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxDataViewListStore::ClearColumns()
|
||||||
|
{
|
||||||
|
m_cols.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void wxDataViewListStore::SetItemData( const wxDataViewItem& item, wxUIntPtr data )
|
void wxDataViewListStore::SetItemData( const wxDataViewItem& item, wxUIntPtr data )
|
||||||
{
|
{
|
||||||
wxDataViewListStoreLine* line = m_data[GetRow(item)];
|
wxDataViewListStoreLine* line = m_data[GetRow(item)];
|
||||||
@@ -1893,6 +1898,12 @@ bool wxDataViewListCtrl::AppendColumn( wxDataViewColumn *col )
|
|||||||
return AppendColumn( col, "string" );
|
return AppendColumn( col, "string" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxDataViewListCtrl::ClearColumns()
|
||||||
|
{
|
||||||
|
GetStore()->ClearColumns();
|
||||||
|
return wxDataViewCtrl::ClearColumns();
|
||||||
|
}
|
||||||
|
|
||||||
wxDataViewColumn *wxDataViewListCtrl::AppendTextColumn( const wxString &label,
|
wxDataViewColumn *wxDataViewListCtrl::AppendTextColumn( const wxString &label,
|
||||||
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
|
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user