X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/18fc605924327cb4e9b3beb994c607cf28a08560..d5f46cddf12e131312240cf64e2dda084b07207d:/src/html/helpctrl.cpp?ds=sidebyside diff --git a/src/html/helpctrl.cpp b/src/html/helpctrl.cpp index a0c120aa75..d1d37b3801 100644 --- a/src/html/helpctrl.cpp +++ b/src/html/helpctrl.cpp @@ -87,12 +87,13 @@ 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; @@ -114,12 +115,7 @@ void wxHtmlHelpController::SetTitleFormat(const wxString& title) // Find the top-most parent window wxWindow* wxHtmlHelpController::FindTopLevelWindow() { - wxWindow* parent = m_helpWindow; - while (parent && !parent->IsTopLevel()) - { - parent = parent->GetParent(); - } - return parent; + return wxGetTopLevelParent(m_helpWindow); } bool wxHtmlHelpController::AddBook(const wxFileName& book_file, bool show_wait_msg) @@ -156,7 +152,7 @@ wxHtmlHelpFrame* wxHtmlHelpController::CreateHelpFrame(wxHtmlHelpData *data) wxHtmlHelpFrame* frame = new wxHtmlHelpFrame(data); frame->SetController(this); frame->Create(m_parentWindow, -1, wxEmptyString, m_FrameStyle, m_Config, m_ConfigRoot); - frame->SetTitleFormat(m_titleFormat); + frame->SetTitleFormat(m_titleFormat); m_helpFrame = frame; return frame; } @@ -165,7 +161,7 @@ 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; @@ -188,7 +184,7 @@ wxWindow* wxHtmlHelpController::CreateHelpWindow() { m_Config = wxConfigBase::Get(false); if (m_Config != NULL) - m_ConfigRoot = _T("wxWindows/wxHtmlHelpController"); + m_ConfigRoot = wxT("wxWindows/wxHtmlHelpController"); } if (m_FrameStyle & wxHF_DIALOG) @@ -239,7 +235,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;