diff --git a/include/wx/listctrl.h b/include/wx/listctrl.h index 4609981ce7..ac807f0c9e 100644 --- a/include/wx/listctrl.h +++ b/include/wx/listctrl.h @@ -187,8 +187,11 @@ private: class WXDLLEXPORT wxListItem : public wxObject { + wxListItem& operator=(const wxListItem& item); + public: wxListItem(); + wxListItem(const wxListItem& item); ~wxListItem() { delete m_attr; } // resetting @@ -361,13 +364,24 @@ class WXDLLEXPORT wxListEvent : public wxNotifyEvent public: wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0) : wxNotifyEvent(commandType, id) - { - m_code = 0; - m_itemIndex = - m_oldItemIndex = 0; - m_col = 0; - } + , m_code(0) + , m_oldItemIndex(0) + , m_itemIndex(0) + , m_col(0) + , m_pointDrag() + , m_item() + { } + wxListEvent(const wxListEvent& event) + : wxNotifyEvent(event) + , m_code(event.m_code) + , m_oldItemIndex(event.m_oldItemIndex) + , m_itemIndex(event.m_itemIndex) + , m_col(event.m_col) + , m_pointDrag(event.m_pointDrag) + , m_item(event.m_item) + { } + int GetCode() const { return m_code; } long GetIndex() const { return m_itemIndex; } int GetColumn() const { return m_col; } diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index b68ffb85ae..48b0ca5226 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -4499,6 +4499,24 @@ wxListItem::wxListItem() Clear(); } +wxListItem::wxListItem(const wxListItem& item) + : wxObject() + , m_mask(item.m_mask) + , m_itemId(item.m_itemId) + , m_col(item.m_col) + , m_state(item.m_state) + , m_stateMask(item.m_stateMask) + , m_text(item.m_text) + , m_image(item.m_image) + , m_data(item.m_data) + , m_format(item.m_format) + , m_width(item.m_width) + , m_attr(NULL) +{ + // copy list item attributes + m_attr = new wxListItemAttr(*item.GetAttributes()); +} + void wxListItem::Clear() { m_mask = 0; @@ -5099,7 +5117,7 @@ bool wxListCtrl::SortItems( wxListCtrlCompare fn, long data ) // event handlers // ---------------------------------------------------------------------------- -void wxListCtrl::OnSize(wxSizeEvent& event) +void wxListCtrl::OnSize(wxSizeEvent& WXUNUSED(event)) { if ( !m_mainWin ) return; @@ -5243,19 +5261,19 @@ void wxListCtrl::SetFocus() // virtual list control support // ---------------------------------------------------------------------------- -wxString wxListCtrl::OnGetItemText(long item, long col) const +wxString wxListCtrl::OnGetItemText(long WXUNUSED(item), long WXUNUSED(col)) const { // this is a pure virtual function, in fact - which is not really pure // because the controls which are not virtual don't need to implement it - wxFAIL_MSG( _T("not supposed to be called") ); + wxFAIL_MSG( _T("wxListCtrl::OnGetItemText not supposed to be called") ); return wxEmptyString; } -int wxListCtrl::OnGetItemImage(long item) const +int wxListCtrl::OnGetItemImage(long WXUNUSED(item)) const { // same as above - wxFAIL_MSG( _T("not supposed to be called") ); + wxFAIL_MSG( _T("wxListCtrl::OnGetItemImage not supposed to be called") ); return -1; }