]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/helpctrl.cpp
Optimized sizers to not call CalcMin more often than neccessary
[wxWidgets.git] / src / html / helpctrl.cpp
index 67726f7456e702e6607e4bbddde2be0c549a3acc..87be6838d1d4fc3e73e694672fbb56bb58a5c2f8 100644 (file)
@@ -9,7 +9,7 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation "helpctrl.h"
 #endif
 
 #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)
 
@@ -105,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();
@@ -142,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);
 }
 
@@ -187,10 +196,15 @@ 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(wxFileName(actualFilename));
 }
 
@@ -319,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;
 }