X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7a893a3152a6ac676b0409320daef188a7be1b7b..db759dde8747767a483f55941eb0b5d15527f06b:/src/common/cshelp.cpp?ds=inline diff --git a/src/common/cshelp.cpp b/src/common/cshelp.cpp index b8d7e4b7b2..f1433c3bed 100644 --- a/src/common/cshelp.cpp +++ b/src/common/cshelp.cpp @@ -13,10 +13,6 @@ // declarations // ============================================================================ -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "cshelp.h" -#endif - // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- @@ -31,10 +27,10 @@ #if wxUSE_HELP #ifndef WX_PRECOMP + #include "wx/app.h" #endif #include "wx/tipwin.h" -#include "wx/app.h" #include "wx/module.h" #include "wx/cshelp.h" @@ -231,7 +227,8 @@ bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt) bool eventProcessed = false; while (subjectOfHelp && !eventProcessed) { - wxHelpEvent helpEvent(wxEVT_HELP, subjectOfHelp->GetId(), pt) ; + wxHelpEvent helpEvent(wxEVT_HELP, subjectOfHelp->GetId(), pt, + wxHelpEvent::Origin_HelpButton); helpEvent.SetEventObject(subjectOfHelp); eventProcessed = win->GetEventHandler()->ProcessEvent(helpEvent); @@ -334,9 +331,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() ) { @@ -350,13 +349,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; } @@ -364,7 +363,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)