diff --git a/include/wx/list.h b/include/wx/list.h index c51e085977..0621496821 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -990,6 +990,27 @@ private: #ifdef wxLIST_COMPATIBILITY +// inline compatibility functions + +// ----------------------------------------------------------------------------- +// wxNodeBase deprecated methods +// ----------------------------------------------------------------------------- + +inline wxNode *wxNodeBase::Next() const { return (wxNode *)GetNext(); } +inline wxNode *wxNodeBase::Previous() const { return (wxNode *)GetPrevious(); } +inline wxObject *wxNodeBase::Data() const { return (wxObject *)GetData(); } + +// ----------------------------------------------------------------------------- +// wxListBase deprecated methods +// ----------------------------------------------------------------------------- + +inline int wxListBase::Number() const { return (int)GetCount(); } +inline wxNode *wxListBase::First() const { return (wxNode *)GetFirst(); } +inline wxNode *wxListBase::Last() const { return (wxNode *)GetLast(); } +inline wxNode *wxListBase::Nth(size_t n) const { return (wxNode *)Item(n); } +inline wxListBase::operator wxList&() const { return *(wxList*)this; } + + // define this to make a lot of noise about use of the old wxList classes. //#define wxWARN_COMPAT_LIST_USE diff --git a/src/common/list.cpp b/src/common/list.cpp index 8c6d14fdba..9532eac9ca 100644 --- a/src/common/list.cpp +++ b/src/common/list.cpp @@ -574,24 +574,6 @@ void wxListBase::DeleteNodes(wxNodeBase* first, wxNodeBase* last) #ifdef wxLIST_COMPATIBILITY -// ----------------------------------------------------------------------------- -// wxNodeBase deprecated methods -// ----------------------------------------------------------------------------- - -wxNode *wxNodeBase::Next() const { return (wxNode *)GetNext(); } -wxNode *wxNodeBase::Previous() const { return (wxNode *)GetPrevious(); } -wxObject *wxNodeBase::Data() const { return (wxObject *)GetData(); } - -// ----------------------------------------------------------------------------- -// wxListBase deprecated methods -// ----------------------------------------------------------------------------- - -int wxListBase::Number() const { return GetCount(); } -wxNode *wxListBase::First() const { return (wxNode *)GetFirst(); } -wxNode *wxListBase::Last() const { return (wxNode *)GetLast(); } -wxNode *wxListBase::Nth(size_t n) const { return (wxNode *)Item(n); } -wxListBase::operator wxList&() const { return *(wxList*)this; } - // ----------------------------------------------------------------------------- // wxList (a.k.a. wxObjectList) // -----------------------------------------------------------------------------