X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3755cfa64d2f5182ec88d9d0bf934769e0269d10..94929e7b60de96bd3b064984ae8995d665329411:/src/html/helpctrl.cpp diff --git a/src/html/helpctrl.cpp b/src/html/helpctrl.cpp index cbb26b1b55..28e07592b7 100644 --- a/src/html/helpctrl.cpp +++ b/src/html/helpctrl.cpp @@ -25,7 +25,7 @@ #include "wx/busyinfo.h" #include "wx/html/helpctrl.h" -#include "wx/html/helpwin.h" +#include "wx/html/helpwnd.h" #include "wx/html/helpfrm.h" #include "wx/html/helpdlg.h" @@ -44,6 +44,8 @@ wxHtmlHelpController::wxHtmlHelpController(int style, wxWindow* parentWindow): wxHelpControllerBase(parentWindow) { m_helpWindow = NULL; + m_helpFrame = NULL; + m_helpDialog = NULL; m_Config = NULL; m_ConfigRoot = wxEmptyString; m_titleFormat = _("Help: %s"); @@ -77,19 +79,24 @@ void wxHtmlHelpController::DestroyHelpWindow() parent->Destroy(); m_helpWindow = NULL; } + m_helpDialog = NULL; + m_helpFrame = NULL; } void wxHtmlHelpController::OnCloseFrame(wxCloseEvent& evt) { if (m_Config) WriteCustomization(m_Config, m_ConfigRoot); - + evt.Skip(); OnQuit(); - m_helpWindow->SetController(NULL); + if ( m_helpWindow ) + m_helpWindow->SetController(NULL); m_helpWindow = NULL; + m_helpDialog = NULL; + m_helpFrame = NULL; } void wxHtmlHelpController::SetTitleFormat(const wxString& title) @@ -149,8 +156,9 @@ wxHtmlHelpFrame* wxHtmlHelpController::CreateHelpFrame(wxHtmlHelpData *data) { wxHtmlHelpFrame* frame = new wxHtmlHelpFrame(data); frame->SetController(this); - frame->SetTitleFormat(m_titleFormat); - frame->Create(m_parentWindow, -1, wxEmptyString, m_FrameStyle); + frame->Create(m_parentWindow, -1, wxEmptyString, m_FrameStyle, m_Config, m_ConfigRoot); + frame->SetTitleFormat(m_titleFormat); + m_helpFrame = frame; return frame; } @@ -158,8 +166,9 @@ wxHtmlHelpDialog* wxHtmlHelpController::CreateHelpDialog(wxHtmlHelpData *data) { wxHtmlHelpDialog* dialog = new wxHtmlHelpDialog(data); dialog->SetController(this); - dialog->SetTitleFormat(m_titleFormat); + dialog->SetTitleFormat(m_titleFormat); dialog->Create(m_parentWindow, -1, wxEmptyString, m_FrameStyle); + m_helpDialog = dialog; return dialog; } @@ -231,7 +240,7 @@ void wxHtmlHelpController::UseConfig(wxConfigBase *config, const wxString& rootp bool wxHtmlHelpController::Initialize(const wxString& file) { wxString dir, filename, ext; - wxSplitPath(file, & dir, & filename, & ext); + wxFileName::SplitPath(file, & dir, & filename, & ext); if (!dir.empty()) dir = dir + wxFILE_SEP_PATH;