]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/cshelp.cpp
Pressing build-in joystick on WinCE phones fires wxEVT_JOY_BUTTON_DOWN event.
[wxWidgets.git] / src / common / cshelp.cpp
index b4887f7ddb3a00db0ec1309220f2f280a9533f63..ae2a282c3a8e0260b37d86acf8ecc2c99b0469b8 100644 (file)
@@ -330,9 +330,11 @@ wxHelpProvider::~wxHelpProvider()
 // wxSimpleHelpProvider
 // ----------------------------------------------------------------------------
 
+#define WINHASH_KEY(w) wxPtrToUInt(w)
+
 wxString wxSimpleHelpProvider::GetHelp(const wxWindowBase *window)
 {
-    wxLongToStringHashMap::iterator it = m_hashWindows.find((long)window);
+    wxSimpleHelpProviderHashMap::iterator it = m_hashWindows.find(WINHASH_KEY(window));
 
     if ( it == m_hashWindows.end() )
     {
@@ -346,13 +348,13 @@ wxString wxSimpleHelpProvider::GetHelp(const wxWindowBase *window)
 
 void wxSimpleHelpProvider::AddHelp(wxWindowBase *window, const wxString& text)
 {
-    m_hashWindows.erase((long)window);
-    m_hashWindows[(long)window] = text;
+    m_hashWindows.erase(WINHASH_KEY(window));
+    m_hashWindows[WINHASH_KEY(window)] = text;
 }
 
 void wxSimpleHelpProvider::AddHelp(wxWindowID id, const wxString& text)
 {
-    wxLongToStringHashMap::key_type key = (wxLongToStringHashMap::key_type)id;
+    wxSimpleHelpProviderHashMap::key_type key = (wxSimpleHelpProviderHashMap::key_type)id;
     m_hashIds.erase(key);
     m_hashIds[key] = text;
 }
@@ -360,7 +362,7 @@ void wxSimpleHelpProvider::AddHelp(wxWindowID id, const wxString& text)
 // removes the association
 void wxSimpleHelpProvider::RemoveHelp(wxWindowBase* window)
 {
-    m_hashWindows.erase((long)window);
+    m_hashWindows.erase(WINHASH_KEY(window));
 }
 
 bool wxSimpleHelpProvider::ShowHelp(wxWindowBase *window)