X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c010d6a9854627296ec3e097e70a5c39fccdffdd..b88ccc4e8e2f933f2db3072757bbdce815578072:/src/html/helpctrl.cpp diff --git a/src/html/helpctrl.cpp b/src/html/helpctrl.cpp index b55d11fcb9..87be6838d1 100644 --- a/src/html/helpctrl.cpp +++ b/src/html/helpctrl.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "helpctrl.h" #endif @@ -38,6 +38,12 @@ #if wxUSE_HELP #include "wx/tipwin.h" #endif + + +#if wxUSE_LIBMSPACK +#include "wx/html/forcelnk.h" +FORCE_LINK(wxhtml_chm_support) +#endif IMPLEMENT_DYNAMIC_CLASS(wxHtmlHelpController, wxHelpControllerBase) @@ -84,6 +90,11 @@ void wxHtmlHelpController::SetTitleFormat(const wxString& title) } +bool wxHtmlHelpController::AddBook(const wxFileName& book_file, bool show_wait_msg) +{ + return AddBook(wxFileSystem::FileNameToURL(book_file), show_wait_msg); +} + bool wxHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg) { wxBusyCursor cur; @@ -100,6 +111,8 @@ bool wxHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg) #if wxUSE_BUSYINFO if (show_wait_msg) delete busy; +#else + wxUnusedVar(show_wait_msg); #endif if (m_helpFrame) m_helpFrame->RefreshLists(); @@ -137,6 +150,7 @@ void wxHtmlHelpController::CreateHelpWindow() m_helpFrame->Create(NULL, wxID_HTML_HELPFRAME, wxEmptyString, m_FrameStyle); m_helpFrame->SetTitleFormat(m_titleFormat); + m_helpFrame->Show(TRUE); } @@ -171,7 +185,7 @@ bool wxHtmlHelpController::Initialize(const wxString& file) wxSplitPath(file, & dir, & filename, & ext); if (!dir.IsEmpty()) - dir = dir + wxString(wxT("/")); + dir = dir + wxFILE_SEP_PATH; // Try to find a suitable file wxString actualFilename = dir + filename + wxString(wxT(".zip")); @@ -182,11 +196,16 @@ bool wxHtmlHelpController::Initialize(const wxString& file) { actualFilename = dir + filename + wxString(wxT(".hhp")); if (!wxFileExists(actualFilename)) - return FALSE; + { +#if wxUSE_LIBMSPACK + actualFilename = dir + filename + wxString(wxT(".chm")); + if (!wxFileExists(actualFilename)) +#endif + return false; + } } } - - return AddBook(actualFilename); + return AddBook(wxFileName(actualFilename)); } bool wxHtmlHelpController::LoadFile(const wxString& WXUNUSED(file)) @@ -266,7 +285,7 @@ void wxHtmlHelpController::AddGrabIfNeeded() // Check if there are any modal windows present, // in which case we need to add a grab. - for ( wxWindowList::Node * node = wxTopLevelWindows.GetFirst(); + for ( wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() ) { @@ -314,10 +333,11 @@ bool wxHtmlHelpController::DisplayIndex() return success; } -bool wxHtmlHelpController::KeywordSearch(const wxString& keyword) +bool wxHtmlHelpController::KeywordSearch(const wxString& keyword, + wxHelpSearchMode mode) { CreateHelpWindow(); - bool success = m_helpFrame->KeywordSearch(keyword); + bool success = m_helpFrame->KeywordSearch(keyword, mode); AddGrabIfNeeded(); return success; }