X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/052e12db71e84fef1c7209daf931a056ad965918..d4aa3a4b860a70c27421411fbc778fc5914f1815:/src/html/helpctrl.cpp diff --git a/src/html/helpctrl.cpp b/src/html/helpctrl.cpp index 2137023534..d51344199c 100644 --- a/src/html/helpctrl.cpp +++ b/src/html/helpctrl.cpp @@ -47,9 +47,25 @@ wxHtmlHelpController::~wxHtmlHelpController() { WriteCustomization(m_Config, m_ConfigRoot); if (m_helpFrame) - m_helpFrame->Close(); + DestroyHelpWindow(); } + +void wxHtmlHelpController::DestroyHelpWindow() +{ + //if (m_Config) WriteCustomization(m_Config, m_ConfigRoot); + if (m_helpFrame) + m_helpFrame->Destroy(); +} + +void wxHtmlHelpController::OnCloseFrame(wxCloseEvent& evt) +{ + evt.Skip(); + + m_helpFrame = NULL; +} + + void wxHtmlHelpController::SetTitleFormat(const wxString& title) { m_titleFormat = title; @@ -77,6 +93,14 @@ bool wxHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg) return retval; } + + +wxHtmlHelpFrame *wxHtmlHelpController::CreateHelpFrame(wxHtmlHelpData *data) +{ + return new wxHtmlHelpFrame(data); +} + + void wxHtmlHelpController::CreateHelpWindow() { if (m_helpFrame) { @@ -91,7 +115,7 @@ void wxHtmlHelpController::CreateHelpWindow() m_ConfigRoot = _T("wxWindows/wxHtmlHelpController"); } - m_helpFrame = new wxHtmlHelpFrame(&m_helpData); + m_helpFrame = CreateHelpFrame(&m_helpData); m_helpFrame->PushEventHandler(this); if (m_Config) @@ -117,4 +141,13 @@ void wxHtmlHelpController::WriteCustomization(wxConfigBase* cfg, const wxString& m_helpFrame->WriteCustomization(cfg, path); } +void wxHtmlHelpController::UseConfig(wxConfigBase *config, const wxString& rootpath) +{ + m_Config = config; + m_ConfigRoot = rootpath; + if (m_helpFrame) m_helpFrame -> UseConfig(config, rootpath); + ReadCustomization(config, rootpath); +} + + #endif