diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 250ddd0e6a..eb6cace662 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -791,7 +791,12 @@ public: */ void DedicateKey( int keycode ) { +#if WXWIN_COMPATIBILITY_3_0 + // Deprecated: use a hash set instead. m_dedicatedKeys.push_back(keycode); +#else + m_dedicatedKeys.insert(keycode); +#endif } /** @@ -1902,8 +1907,12 @@ protected: #endif /** List of key codes that will not be handed over to editor controls. */ - // FIXME: Make this a hash set once there is template-based wxHashSet. +#if WXWIN_COMPATIBILITY_3_0 + // Deprecated: use a hash set instead. wxVector m_dedicatedKeys; +#else + wxPGHashSetInt m_dedicatedKeys; +#endif // // Temporary values diff --git a/include/wx/propgrid/propgriddefs.h b/include/wx/propgrid/propgriddefs.h index 40311f851f..d48bd8757f 100644 --- a/include/wx/propgrid/propgriddefs.h +++ b/include/wx/propgrid/propgriddefs.h @@ -18,6 +18,7 @@ #include "wx/dynarray.h" #include "wx/vector.h" #include "wx/hashmap.h" +#include "wx/hashset.h" #include "wx/variant.h" #include "wx/any.h" #include "wx/longlong.h" @@ -315,6 +316,12 @@ WX_DECLARE_HASH_MAP_WITH_DECL(wxInt32, wxPGHashMapI2I, class WXDLLIMPEXP_PROPGRID); +WX_DECLARE_HASH_SET_WITH_DECL(int, + wxIntegerHash, + wxIntegerEqual, + wxPGHashSetInt, + class WXDLLIMPEXP_PROPGRID); + WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(wxObject*, wxArrayPGObject, wxBaseArrayPtrVoid, class WXDLLIMPEXP_PROPGRID); diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 0778ed1783..8375f9621b 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -5700,7 +5700,12 @@ void wxPropertyGrid::HandleKeyEvent( wxKeyEvent &event, bool fromChild ) // Except for TAB, ESC, and any keys specifically dedicated to // wxPropertyGrid itself, handle child control events in child control. if ( fromChild && +#if WXWIN_COMPATIBILITY_3_0 + // Deprecated: use a hash set instead. wxPGFindInVector(m_dedicatedKeys, keycode) == wxNOT_FOUND ) +#else + m_dedicatedKeys.find(keycode) == m_dedicatedKeys.end() ) +#endif { // Only propagate event if it had modifiers if ( !event.HasModifiers() )