]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/helpctrl.cpp
Updates to OS/2 makefiles.
[wxWidgets.git] / src / html / helpctrl.cpp
index 26911db463e8e8a0b507e50dd5b2dfc883a99543..0d36aed6e4aa5fa8566dfea19ceda62e919442ea 100644 (file)
 #include "wx/wx.h"
 #include "wx/busyinfo.h"
 
+#if wxUSE_HELP
+#include "wx/tipwin.h"
+#endif
+
 IMPLEMENT_DYNAMIC_CLASS(wxHtmlHelpController, wxHelpControllerBase)
 
 wxHtmlHelpController::wxHtmlHelpController(int style)
@@ -187,6 +191,33 @@ bool wxHtmlHelpController::DisplaySection(int sectionNo)
     return Display(sectionNo);
 }
 
+bool wxHtmlHelpController::DisplayTextPopup(const wxString& text, const wxPoint& WXUNUSED(pos))
+{
+#if wxUSE_HELP
+    static wxTipWindow* s_tipWindow = NULL;
+
+    if (s_tipWindow)
+    {
+        // Prevent s_tipWindow being nulled in OnIdle,
+        // thereby removing the chance for the window to be closed by ShowHelp
+        s_tipWindow->SetTipWindowPtr(NULL);
+        s_tipWindow->Close();
+    }
+    s_tipWindow = NULL;
+
+    if ( !text.empty() )
+    {
+        s_tipWindow = new wxTipWindow(wxTheApp->GetTopWindow(), text, 100, & s_tipWindow);
+
+        return TRUE;
+    }
+
+    return FALSE;
+#else
+    return FALSE;    
+#endif
+}
+
 void wxHtmlHelpController::SetFrameParameters(const wxString& title,
                                    const wxSize& size,
                                    const wxPoint& pos,
@@ -218,5 +249,20 @@ bool wxHtmlHelpController::Quit()
     return TRUE;
 }
 
+// Sets the specified book or all books to have the given base path
+void wxHtmlHelpController::SetBookBasePath(const wxString& basePath, int which)
+{
+    size_t i;
+    for (i = 0; i < m_helpData.GetBookRecArray().Count(); i++ )
+    {
+        if (i == (size_t) which || which == -1)
+        {
+            wxHtmlBookRecord& book = m_helpData.GetBookRecArray()[i];
+            book.SetBasePath(basePath);
+        }
+        if (i == (size_t) which)
+            return;
+    }
+}
 
 #endif