diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 4fe6b701de..f23c52efcc 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -23,6 +23,7 @@ #include "wx/propgrid/propgridiface.h" #include +#include #ifndef SWIG extern WXDLLIMPEXP_DATA_PROPGRID(const char) wxPropertyGridNameStr[]; @@ -667,12 +668,7 @@ public: // control. 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 } // This static function enables or disables automatic use of @@ -1543,12 +1539,7 @@ protected: #endif // List of key codes that will not be handed over to editor controls. -#if WXWIN_COMPATIBILITY_3_0 - // Deprecated: use a hash set instead. - wxVector m_dedicatedKeys; -#else - wxPGHashSetInt m_dedicatedKeys; -#endif + std::unordered_set m_dedicatedKeys; // // Temporary values diff --git a/include/wx/propgrid/propgriddefs.h b/include/wx/propgrid/propgriddefs.h index fbc76bc250..d6838157a5 100644 --- a/include/wx/propgrid/propgriddefs.h +++ b/include/wx/propgrid/propgriddefs.h @@ -274,12 +274,6 @@ WX_DECLARE_STRING_HASH_MAP_WITH_DECL(wxString, wxPGHashMapS2S, class WXDLLIMPEXP_PROPGRID); -WX_DECLARE_HASH_SET_WITH_DECL(int, - wxIntegerHash, - wxIntegerEqual, - wxPGHashSetInt, - class WXDLLIMPEXP_PROPGRID); - #if WXWIN_COMPATIBILITY_3_0 WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(wxObject*, wxArrayPGObject, wxBaseArrayPtrVoid, @@ -676,22 +670,6 @@ protected: // ----------------------------------------------------------------------- // wxVector utilities -// Utility to check if specific item is in a vector. -template -inline bool wxPGItemExistsInVector(const wxVector& vector, const T& item) -{ -#if wxUSE_STL - return std::find(vector.begin(), vector.end(), item) != vector.end(); -#else - for (typename wxVector::const_iterator it = vector.begin(); it != vector.end(); ++it) - { - if ( *it == item ) - return true; - } - return false; -#endif // wxUSE_STL/!wxUSE_STL -} - // Utility to determine the index of the item in the vector. template inline int wxPGItemIndexInVector(const wxVector& vector, const T& item) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 18b1857552..9edb95b13f 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -5676,13 +5676,7 @@ 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. - !wxPGItemExistsInVector(m_dedicatedKeys, keycode) ) -#else - m_dedicatedKeys.find(keycode) == m_dedicatedKeys.end() ) -#endif + if ( fromChild && m_dedicatedKeys.count(keycode) == 0 ) { // Only propagate event if it had modifiers if ( !event.HasModifiers() )