Move wxList::Member() to pseudo-template base list class.
Member() should be available in all list classes, not just specially crafted list of wxObjects (wxList). See #3616. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65789 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -767,6 +767,9 @@ private:
|
|||||||
virtual nodetype *Find(const wxListKey& key) const \
|
virtual nodetype *Find(const wxListKey& key) const \
|
||||||
{ return (nodetype *)wxListBase::Find(key); } \
|
{ return (nodetype *)wxListBase::Find(key); } \
|
||||||
\
|
\
|
||||||
|
bool Member(const Tbase *object) const \
|
||||||
|
{ return Find(object) != NULL; } \
|
||||||
|
\
|
||||||
int IndexOf(Tbase *object) const \
|
int IndexOf(Tbase *object) const \
|
||||||
{ return wxListBase::IndexOf(object); } \
|
{ return wxListBase::IndexOf(object); } \
|
||||||
\
|
\
|
||||||
@@ -1190,7 +1193,6 @@ public:
|
|||||||
|
|
||||||
// compatibility methods
|
// compatibility methods
|
||||||
void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); }
|
void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); }
|
||||||
bool Member(wxObject *object) const { return Find(object) != NULL; }
|
|
||||||
#endif // !wxUSE_STL
|
#endif // !wxUSE_STL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -722,8 +722,8 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler),
|
|||||||
|
|
||||||
if ( currentMouseWindow->HandleWindowEvent(wxevent) )
|
if ( currentMouseWindow->HandleWindowEvent(wxevent) )
|
||||||
{
|
{
|
||||||
if ((currentMouseWindowParent != NULL) &&
|
if ( currentMouseWindowParent &&
|
||||||
(currentMouseWindowParent->GetChildren().Find(currentMouseWindow) == NULL))
|
!currentMouseWindowParent->GetChildren().Member(currentMouseWindow) )
|
||||||
currentMouseWindow = NULL;
|
currentMouseWindow = NULL;
|
||||||
|
|
||||||
result = noErr;
|
result = noErr;
|
||||||
|
Reference in New Issue
Block a user