]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/propgrid/propgriddefs.h
Document wxDataViewListModel as common abstract base class for
[wxWidgets.git] / include / wx / propgrid / propgriddefs.h
index a9f7778fb2ebc76a29f84dc292b6e2d4b37174fb..8936b39b5166d824c470b0bbaba5effa6f6e6533 100644 (file)
@@ -6,12 +6,14 @@
 // Created:     2008-08-31
 // RCS-ID:      $Id$
 // Copyright:   (c) Jaakko Salli
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifndef _WX_PROPGRID_PROPGRIDDEFS_H_
 #define _WX_PROPGRID_PROPGRIDDEFS_H_
 
+#include "wx/defs.h"
+
 #if wxUSE_PROPGRID
 
 #include "wx/dynarray.h"
@@ -340,6 +342,19 @@ WX_DECLARE_HASH_MAP_WITH_DECL(wxInt32,
                               wxPGHashMapI2I,
                               class WXDLLIMPEXP_PROPGRID);
 
+// Utility to find if specific item is in a vector. Returns index to
+// the item, or wxNOT_FOUND if not present.
+template<typename CONTAINER, typename T>
+int wxPGFindInVector( CONTAINER vector, const T& item )
+{
+    for ( unsigned int i=0; i<vector.size(); i++ )
+    {
+        if ( vector[i] == item )
+            return (int) i;
+    }
+    return wxNOT_FOUND;
+}
+
 // -----------------------------------------------------------------------
 
 enum wxPG_GETPROPERTYVALUES_FLAGS