]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/helpfrm.cpp
fixed (rare but fatal) bug in wxWindowDisabler
[wxWidgets.git] / src / html / helpfrm.cpp
index 0df2ab25b733c982f2101d82ccd600d1f78d61bd..b36d1c62e6ac5484583985a2ead636294aff5714 100644 (file)
@@ -29,6 +29,7 @@
 #endif
 
 #include "wx/html/helpfrm.h"
 #endif
 
 #include "wx/html/helpfrm.h"
+#include "wx/html/helpctrl.h"
 #include "wx/notebook.h"
 #include "wx/imaglist.h"
 #include "wx/treectrl.h"
 #include "wx/notebook.h"
 #include "wx/imaglist.h"
 #include "wx/treectrl.h"
@@ -91,6 +92,7 @@ class wxHtmlHelpHashData : public wxObject
     public:
         wxHtmlHelpHashData(int index, wxTreeItemId id) : wxObject()
             { m_Index = index; m_Id = id;}
     public:
         wxHtmlHelpHashData(int index, wxTreeItemId id) : wxObject()
             { m_Index = index; m_Id = id;}
+        ~wxHtmlHelpHashData() {}
         
         int m_Index;
         wxTreeItemId m_Id;
         
         int m_Index;
         wxTreeItemId m_Id;
@@ -183,6 +185,7 @@ void wxHtmlHelpFrame::Init(wxHtmlHelpData* data)
 
     m_PagesHash = NULL;
     m_UpdateContents = TRUE;
 
     m_PagesHash = NULL;
     m_UpdateContents = TRUE;
+    m_helpController = (wxHelpControllerBase*) NULL;
 }
 
 // Create: builds the GUI components.
 }
 
 // Create: builds the GUI components.
@@ -456,7 +459,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id, const wxString& ti
 
 wxHtmlHelpFrame::~wxHtmlHelpFrame()
 {
 
 wxHtmlHelpFrame::~wxHtmlHelpFrame()
 {
-    PopEventHandler(); // wxhtmlhelpcontroller
+    // PopEventHandler(); // wxhtmlhelpcontroller (not any more!)
     delete m_ContentsImageList;
     if (m_DataCreated)
         delete m_Data;
     delete m_ContentsImageList;
     if (m_DataCreated)
         delete m_Data;
@@ -604,7 +607,7 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword)
 
     wxProgressDialog progress(_("Searching..."), _("No matching page found yet"),
                               status.GetMaxIndex(), this,
 
     wxProgressDialog progress(_("Searching..."), _("No matching page found yet"),
                               status.GetMaxIndex(), this,
-                              wxPD_APP_MODAL | wxPD_CAN_ABORT | wxPD_AUTO_HIDE | wxGA_SMOOTH);
+                              wxPD_APP_MODAL | wxPD_CAN_ABORT | wxPD_AUTO_HIDE);
 
     while (status.IsActive()) {
         curi = status.GetCurIndex();
 
     while (status.IsActive()) {
         curi = status.GetCurIndex();
@@ -924,7 +927,7 @@ class wxHtmlHelpFrameOptionsDialog : public wxDialog
                                    "</body></html>"));
             }
 
                                    "</body></html>"));
             }
 
-        void OnUpdate(wxCloseEvent& event)
+        void OnUpdate(wxCommandEvent& event)
             {
                 UpdateTestWin();
             }
             {
                 UpdateTestWin();
             }
@@ -1145,7 +1148,10 @@ void wxHtmlHelpFrame::OnToolbar(wxCommandEvent& event)
             {
                 if (m_Printer == NULL) 
                     m_Printer = new wxHtmlEasyPrinting(_("Help Printing"), this);
             {
                 if (m_Printer == NULL) 
                     m_Printer = new wxHtmlEasyPrinting(_("Help Printing"), this);
-                m_Printer -> PrintFile(m_HtmlWin -> GetOpenedPage());
+                if (!m_HtmlWin -> GetOpenedPage())
+                    wxLogWarning(_("Cannot print empty page."));
+                else
+                    m_Printer -> PrintFile(m_HtmlWin -> GetOpenedPage());
             }
             break;
 #endif
             }
             break;
 #endif
@@ -1309,6 +1315,11 @@ void wxHtmlHelpFrame::OnCloseWindow(wxCloseEvent& evt)
     if (m_Config)
         WriteCustomization(m_Config, m_ConfigRoot);
 
     if (m_Config)
         WriteCustomization(m_Config, m_ConfigRoot);
 
+    if (m_helpController && m_helpController->IsKindOf(CLASSINFO(wxHtmlHelpController)))
+    {
+        ((wxHtmlHelpController*) m_helpController)->OnCloseFrame(evt);
+    }
+
     evt.Skip();
 }
 
     evt.Skip();
 }