Use wxUIntPtr instead of wxClientData in wxDataViewListCtrl.
Do not delete the client data in wxDataViewListCtrl, this class mainly exists for compatibility with wxListCtrl and as the latter doesn't delete its client data, neither should the former. See #11088. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71561 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -505,6 +505,11 @@ Major new features in this release
|
|||||||
2.9.4:
|
2.9.4:
|
||||||
------
|
------
|
||||||
|
|
||||||
|
INCOMPATIBLE CHANGES SINCE 2.9.3
|
||||||
|
|
||||||
|
- wxDataViewListCtrl doesn't delete its client data any more for compatibility
|
||||||
|
with wxListCtrl, use full wxDataViewCtrl if you don't need compatibility.
|
||||||
|
|
||||||
All:
|
All:
|
||||||
|
|
||||||
- Added wxLogFormatter to allow customizing wxLog output (Sébastien Gallou).
|
- Added wxLogFormatter to allow customizing wxLog output (Sébastien Gallou).
|
||||||
|
@@ -939,24 +939,20 @@ typedef void (wxEvtHandler::*wxDataViewEventFunction)(wxDataViewEvent&);
|
|||||||
class WXDLLIMPEXP_ADV wxDataViewListStoreLine
|
class WXDLLIMPEXP_ADV wxDataViewListStoreLine
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxDataViewListStoreLine( wxClientData *data = NULL )
|
wxDataViewListStoreLine( wxUIntPtr data = NULL )
|
||||||
{
|
{
|
||||||
m_data = data;
|
m_data = data;
|
||||||
}
|
}
|
||||||
virtual ~wxDataViewListStoreLine()
|
|
||||||
{
|
|
||||||
delete m_data;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetData( wxClientData *data )
|
void SetData( wxUIntPtr data )
|
||||||
{ if (m_data) delete m_data; m_data = data; }
|
{ m_data = data; }
|
||||||
wxClientData *GetData() const
|
wxUIntPtr GetData() const
|
||||||
{ return m_data; }
|
{ return m_data; }
|
||||||
|
|
||||||
wxVector<wxVariant> m_values;
|
wxVector<wxVariant> m_values;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxClientData *m_data;
|
wxUIntPtr m_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -970,9 +966,9 @@ public:
|
|||||||
void InsertColumn( unsigned int pos, const wxString &varianttype );
|
void InsertColumn( unsigned int pos, const wxString &varianttype );
|
||||||
void AppendColumn( const wxString &varianttype );
|
void AppendColumn( const wxString &varianttype );
|
||||||
|
|
||||||
void AppendItem( const wxVector<wxVariant> &values, wxClientData *data = NULL );
|
void AppendItem( const wxVector<wxVariant> &values, wxUIntPtr data = NULL );
|
||||||
void PrependItem( const wxVector<wxVariant> &values, wxClientData *data = NULL );
|
void PrependItem( const wxVector<wxVariant> &values, wxUIntPtr data = NULL );
|
||||||
void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxClientData *data = NULL );
|
void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxUIntPtr data = NULL );
|
||||||
void DeleteItem( unsigned int pos );
|
void DeleteItem( unsigned int pos );
|
||||||
void DeleteAllItems();
|
void DeleteAllItems();
|
||||||
|
|
||||||
@@ -1052,11 +1048,11 @@ public:
|
|||||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||||
int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE );
|
int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE );
|
||||||
|
|
||||||
void AppendItem( const wxVector<wxVariant> &values, wxClientData *data = NULL )
|
void AppendItem( const wxVector<wxVariant> &values, wxUIntPtr data = NULL )
|
||||||
{ GetStore()->AppendItem( values, data ); }
|
{ GetStore()->AppendItem( values, data ); }
|
||||||
void PrependItem( const wxVector<wxVariant> &values, wxClientData *data = NULL )
|
void PrependItem( const wxVector<wxVariant> &values, wxUIntPtr data = NULL )
|
||||||
{ GetStore()->PrependItem( values, data ); }
|
{ GetStore()->PrependItem( values, data ); }
|
||||||
void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxClientData *data = NULL )
|
void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxUIntPtr data = NULL )
|
||||||
{ GetStore()->InsertItem( row, values, data ); }
|
{ GetStore()->InsertItem( row, values, data ); }
|
||||||
void DeleteItem( unsigned row )
|
void DeleteItem( unsigned row )
|
||||||
{ GetStore()->DeleteItem( row ); }
|
{ GetStore()->DeleteItem( row ); }
|
||||||
|
@@ -2315,17 +2315,17 @@ public:
|
|||||||
/**
|
/**
|
||||||
Appends an item (=row) to the control and store.
|
Appends an item (=row) to the control and store.
|
||||||
*/
|
*/
|
||||||
void AppendItem( const wxVector<wxVariant> &values, wxClientData *data = NULL );
|
void AppendItem( const wxVector<wxVariant> &values, wxUIntPtr data = NULL );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Prepends an item (=row) to the control and store.
|
Prepends an item (=row) to the control and store.
|
||||||
*/
|
*/
|
||||||
void PrependItem( const wxVector<wxVariant> &values, wxClientData *data = NULL );
|
void PrependItem( const wxVector<wxVariant> &values, wxUIntPtr data = NULL );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Inserts an item (=row) to the control and store.
|
Inserts an item (=row) to the control and store.
|
||||||
*/
|
*/
|
||||||
void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxClientData *data = NULL );
|
void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxUIntPtr data = NULL );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Delete the row at position @a row.
|
Delete the row at position @a row.
|
||||||
@@ -2658,7 +2658,7 @@ public:
|
|||||||
in number and type. No (default) values are filled in
|
in number and type. No (default) values are filled in
|
||||||
automatically.
|
automatically.
|
||||||
*/
|
*/
|
||||||
void AppendItem( const wxVector<wxVariant> &values, wxClientData *data = NULL );
|
void AppendItem( const wxVector<wxVariant> &values, wxUIntPtr data = NULL );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Prepends an item (=row) and fills it with @a values.
|
Prepends an item (=row) and fills it with @a values.
|
||||||
@@ -2667,7 +2667,7 @@ public:
|
|||||||
in number and type. No (default) values are filled in
|
in number and type. No (default) values are filled in
|
||||||
automatically.
|
automatically.
|
||||||
*/
|
*/
|
||||||
void PrependItem( const wxVector<wxVariant> &values, wxClientData *data = NULL );
|
void PrependItem( const wxVector<wxVariant> &values, wxUIntPtr data = NULL );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Inserts an item (=row) and fills it with @a values.
|
Inserts an item (=row) and fills it with @a values.
|
||||||
@@ -2676,7 +2676,7 @@ public:
|
|||||||
in number and type. No (default) values are filled in
|
in number and type. No (default) values are filled in
|
||||||
automatically.
|
automatically.
|
||||||
*/
|
*/
|
||||||
void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxClientData *data = NULL );
|
void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxUIntPtr data = NULL );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Delete the item (=row) at position @a pos.
|
Delete the item (=row) at position @a pos.
|
||||||
|
@@ -1710,7 +1710,7 @@ wxString wxDataViewListStore::GetColumnType( unsigned int pos ) const
|
|||||||
return m_cols[pos];
|
return m_cols[pos];
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDataViewListStore::AppendItem( const wxVector<wxVariant> &values, wxClientData *data )
|
void wxDataViewListStore::AppendItem( const wxVector<wxVariant> &values, wxUIntPtr data )
|
||||||
{
|
{
|
||||||
wxDataViewListStoreLine *line = new wxDataViewListStoreLine( data );
|
wxDataViewListStoreLine *line = new wxDataViewListStoreLine( data );
|
||||||
line->m_values = values;
|
line->m_values = values;
|
||||||
@@ -1719,7 +1719,7 @@ void wxDataViewListStore::AppendItem( const wxVector<wxVariant> &values, wxClien
|
|||||||
RowAppended();
|
RowAppended();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDataViewListStore::PrependItem( const wxVector<wxVariant> &values, wxClientData *data )
|
void wxDataViewListStore::PrependItem( const wxVector<wxVariant> &values, wxUIntPtr data )
|
||||||
{
|
{
|
||||||
wxDataViewListStoreLine *line = new wxDataViewListStoreLine( data );
|
wxDataViewListStoreLine *line = new wxDataViewListStoreLine( data );
|
||||||
line->m_values = values;
|
line->m_values = values;
|
||||||
@@ -1729,7 +1729,7 @@ void wxDataViewListStore::PrependItem( const wxVector<wxVariant> &values, wxClie
|
|||||||
}
|
}
|
||||||
|
|
||||||
void wxDataViewListStore::InsertItem( unsigned int row, const wxVector<wxVariant> &values,
|
void wxDataViewListStore::InsertItem( unsigned int row, const wxVector<wxVariant> &values,
|
||||||
wxClientData *data )
|
wxUIntPtr data )
|
||||||
{
|
{
|
||||||
wxDataViewListStoreLine *line = new wxDataViewListStoreLine( data );
|
wxDataViewListStoreLine *line = new wxDataViewListStoreLine( data );
|
||||||
line->m_values = values;
|
line->m_values = values;
|
||||||
|
Reference in New Issue
Block a user