X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b8b9d8a790b93e749cc886b4d63245de8cac74d2..4b056ef54f29582e2a5154bf148f7ebc5877b51b:/src/common/cshelp.cpp diff --git a/src/common/cshelp.cpp b/src/common/cshelp.cpp index 2cc7626a4a..4d173898bc 100644 --- a/src/common/cshelp.cpp +++ b/src/common/cshelp.cpp @@ -6,7 +6,7 @@ // Created: 08/09/2000 // RCS-ID: $Id$ // Copyright: (c) 2000 Julian Smart, Vadim Zeitlin -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -87,6 +87,9 @@ wxContextHelp::~wxContextHelp() EndContextHelp(); } +// Not currently needed, but on some systems capture may not work as +// expected so we'll leave it here for now. +#if 0 static void wxPushOrPopEventHandlers(wxContextHelp* help, wxWindow* win, bool push) { if (push) @@ -103,6 +106,7 @@ static void wxPushOrPopEventHandlers(wxContextHelp* help, wxWindow* win, bool pu node = node->Next(); } } +#endif // Begin 'context help mode' bool wxContextHelp::BeginContextHelp(wxWindow* win) @@ -122,8 +126,8 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win) m_status = FALSE; -// win->PushEventHandler(new wxContextHelpEvtHandler(this)); - wxPushOrPopEventHandlers(this, win, TRUE); + win->PushEventHandler(new wxContextHelpEvtHandler(this)); + //wxPushOrPopEventHandlers(this, win, TRUE); win->CaptureMouse(); @@ -131,8 +135,8 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win) win->ReleaseMouse(); -// win->PopEventHandler(TRUE); - wxPushOrPopEventHandlers(this, win, FALSE); + win->PopEventHandler(TRUE); + //wxPushOrPopEventHandlers(this, win, FALSE); win->SetCursor(oldCursor); @@ -140,14 +144,14 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win) { wxPoint pt; wxWindow* winAtPtr = wxFindWindowAtPointer(pt); - /* + /* if (winAtPtr) { - wxString msg; + wxString msg; msg.Printf("Picked %s (%d)", (const char*) winAtPtr->GetName(), winAtPtr->GetId()); cout << msg << '\n'; } - */ + */ if (winAtPtr) DispatchEvent(winAtPtr, pt); @@ -166,6 +170,7 @@ bool wxContextHelp::EndContextHelp() bool wxContextHelp::EventLoop() { m_inHelp = TRUE; + while ( m_inHelp ) { if (wxTheApp->Pending()) @@ -177,6 +182,7 @@ bool wxContextHelp::EventLoop() wxTheApp->ProcessIdle(); } } + return TRUE; } @@ -219,6 +225,7 @@ 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). @@ -268,8 +275,15 @@ wxContextHelpButton::wxContextHelpButton(wxWindow* parent, const wxPoint& pos, const wxSize& size, long style) +#if defined(__WXPM__) + : wxBitmapButton(parent, id, wxBitmap(wxCSQUERY_BITMAP + ,wxBITMAP_TYPE_RESOURCE + ), + pos, size, style) +#else : wxBitmapButton(parent, id, wxBITMAP(csquery), pos, size, style) +#endif { } @@ -297,6 +311,11 @@ void wxHelpProvider::AddHelp(wxWindowID WXUNUSED(id), { } +// removes the association +void wxHelpProvider::RemoveHelp(wxWindowBase* WXUNUSED(window)) +{ +} + wxHelpProvider::~wxHelpProvider() { } @@ -325,6 +344,12 @@ void wxSimpleHelpProvider::AddHelp(wxWindowID id, const wxString& text) m_hashIds.Put(id, text); } +// removes the association +void wxSimpleHelpProvider::RemoveHelp(wxWindowBase* window) +{ + m_hashWindows.Delete((long)window); +} + bool wxSimpleHelpProvider::ShowHelp(wxWindowBase *window) { #if wxUSE_TIPWINDOW