]> git.saurik.com Git - wxWidgets.git/commitdiff
Move wxList::Member() to pseudo-template base list class.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 10 Oct 2010 12:48:36 +0000 (12:48 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 10 Oct 2010 12:48:36 +0000 (12:48 +0000)
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

include/wx/list.h
src/osx/carbon/nonownedwnd.cpp

index 78e86ee6944990edcc805327bd6d7e249209a40f..a2ba1882f4522e5083c54a0f142bb1cc78f47363 100644 (file)
@@ -767,6 +767,9 @@ private:
         virtual nodetype *Find(const wxListKey& key) const                  \
             { return (nodetype *)wxListBase::Find(key); }                   \
                                                                             \
+        bool Member(const Tbase *object) const                              \
+            { return Find(object) != NULL; }                                \
+                                                                            \
         int IndexOf(Tbase *object) const                                    \
             { return wxListBase::IndexOf(object); }                         \
                                                                             \
@@ -1190,7 +1193,6 @@ public:
 
     // compatibility methods
     void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); }
-    bool Member(wxObject *object) const { return Find(object) != NULL; }
 #endif // !wxUSE_STL
 };
 
index 66c0f90d92122b09e69ac3522ca01454d24effae..c61fb32f8e7a58a803d57d4cc0b8f7dc2dba1e1a 100644 (file)
@@ -722,8 +722,8 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler),
 
         if ( currentMouseWindow->HandleWindowEvent(wxevent) )
         {
-            if ((currentMouseWindowParent != NULL) &&
-                (currentMouseWindowParent->GetChildren().Find(currentMouseWindow) == NULL))
+            if ( currentMouseWindowParent &&
+                 !currentMouseWindowParent->GetChildren().Member(currentMouseWindow) )
                 currentMouseWindow = NULL;
 
             result = noErr;