]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/propgrid/propgriddefs.h
Added wxIsPod<>. Use it in wxAny instead of wxIsMovable<>.
[wxWidgets.git] / include / wx / propgrid / propgriddefs.h
index 8ed9e32b5e15bc9da0d3fe1aa9cb83fe13becdd9..57a042eb35f967538a903179f8b64afd40cbe346 100644 (file)
@@ -18,6 +18,7 @@
 #include "wx/vector.h"
 #include "wx/hashmap.h"
 #include "wx/variant.h"
+#include "wx/any.h"
 #include "wx/longlong.h"
 #include "wx/clntdata.h"
 
@@ -339,6 +340,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
@@ -545,10 +559,13 @@ public:\
 \
     virtual wxVariantData* Clone() const { return new classname##VariantData(m_value); } \
 \
+    DECLARE_WXANY_CONVERSION() \
 protected:\
     classname m_value; \
 };\
 \
+IMPLEMENT_TRIVIAL_WXANY_CONVERSION(classname, classname##VariantData) \
+\
 wxString classname##VariantData::GetType() const\
 {\
     return wxS(#classname);\