X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad9fb0334fbfe5747b67c09ba714c1f00bd40ff8..eaf6274cc01dec5faebd88d9cd06c17a462d32c5:/src/common/cshelp.cpp diff --git a/src/common/cshelp.cpp b/src/common/cshelp.cpp index f25d0943e7..8071439665 100644 --- a/src/common/cshelp.cpp +++ b/src/common/cshelp.cpp @@ -56,6 +56,8 @@ public: //// Data wxContextHelp* m_contextHelp; + + DECLARE_NO_COPY_CLASS(wxContextHelpEvtHandler) }; // ============================================================================ @@ -170,7 +172,7 @@ bool wxContextHelp::EndContextHelp() bool wxContextHelp::EventLoop() { m_inHelp = TRUE; - + while ( m_inHelp ) { if (wxTheApp->Pending()) @@ -182,7 +184,7 @@ bool wxContextHelp::EventLoop() wxTheApp->ProcessIdle(); } } - + return TRUE; } @@ -225,9 +227,9 @@ bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt) { wxHelpEvent helpEvent(wxEVT_HELP, subjectOfHelp->GetId(), pt) ; helpEvent.SetEventObject(this); - + eventProcessed = win->GetEventHandler()->ProcessEvent(helpEvent); - + // Go up the window hierarchy until the event is handled (or not). // I.e. keep submitting ancestor windows until one is recognised // by the app code that processes the ids and displays help. @@ -246,7 +248,6 @@ bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt) * to put the application into context help mode. */ -#if !defined(__WXMSW__) static const char * csquery_xpm[] = { "12 11 2 1", " c None", @@ -262,7 +263,6 @@ static const char * csquery_xpm[] = { " .. ", " .. ", " "}; -#endif IMPLEMENT_CLASS(wxContextHelpButton, wxBitmapButton) @@ -275,8 +275,15 @@ wxContextHelpButton::wxContextHelpButton(wxWindow* parent, const wxPoint& pos, const wxSize& size, long style) - : wxBitmapButton(parent, id, wxBITMAP(csquery), +#if defined(__WXPM__) + : wxBitmapButton(parent, id, wxBitmap(wxCSQUERY_BITMAP + ,wxBITMAP_TYPE_RESOURCE + ), + pos, size, style) +#else + : wxBitmapButton(parent, id, wxBitmap(csquery_xpm), pos, size, style) +#endif { } @@ -329,11 +336,13 @@ wxString wxSimpleHelpProvider::GetHelp(const wxWindowBase *window) void wxSimpleHelpProvider::AddHelp(wxWindowBase *window, const wxString& text) { + m_hashWindows.Delete((long)window); m_hashWindows.Put((long)window, text); } void wxSimpleHelpProvider::AddHelp(wxWindowID id, const wxString& text) { + m_hashIds.Delete((long)id); m_hashIds.Put(id, text); } @@ -408,7 +417,7 @@ bool wxHelpControllerHelpProvider::ShowHelp(wxWindowBase *window) // Convenience function for turning context id into wxString wxString wxContextId(int id) { - return wxString(IntToString(id)); + return wxString::Format(_T("%d"), id); } // ----------------------------------------------------------------------------