X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b42468496c00cc7384234093227c03edcf04d84c..fb8d7eb7a880f1f2e32d8830f9c5e12b2536e05f:/src/html/helpctrl.cpp diff --git a/src/html/helpctrl.cpp b/src/html/helpctrl.cpp index d093b99b73..af46650fa4 100644 --- a/src/html/helpctrl.cpp +++ b/src/html/helpctrl.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: helpctrl.cpp +// Name: src/html/helpctrl.cpp // Purpose: wxHtmlHelpController // Notes: Based on htmlhelp.cpp, implementing a monolithic // HTML Help controller class, by Vaclav Slavik @@ -42,6 +42,17 @@ IMPLEMENT_DYNAMIC_CLASS(wxHtmlHelpController, wxHelpControllerBase) wxHtmlHelpController::wxHtmlHelpController(int style, wxWindow* parentWindow): wxHelpControllerBase(parentWindow) +{ + Init(style); +} + +wxHtmlHelpController::wxHtmlHelpController(wxWindow* parentWindow, int style): + wxHelpControllerBase(parentWindow) +{ + Init(style); +} + +void wxHtmlHelpController::Init(int style) { m_helpWindow = NULL; m_helpFrame = NULL; @@ -52,8 +63,10 @@ wxHtmlHelpController::wxHtmlHelpController(int style, wxWindow* parentWindow): #endif // wxUSE_CONFIG m_titleFormat = _("Help: %s"); m_FrameStyle = style; + m_shouldPreventAppExit = false; } + wxHtmlHelpController::~wxHtmlHelpController() { #if wxUSE_CONFIG @@ -105,6 +118,13 @@ void wxHtmlHelpController::OnCloseFrame(wxCloseEvent& evt) m_helpFrame = NULL; } +void wxHtmlHelpController::SetShouldPreventAppExit(bool enable) +{ + m_shouldPreventAppExit = enable; + if ( m_helpFrame ) + m_helpFrame->SetShouldPreventAppExit(enable); +} + void wxHtmlHelpController::SetTitleFormat(const wxString& title) { m_titleFormat = title; @@ -163,6 +183,7 @@ wxHtmlHelpFrame* wxHtmlHelpController::CreateHelpFrame(wxHtmlHelpData *data) #endif // wxUSE_CONFIG ); frame->SetTitleFormat(m_titleFormat); + frame->SetShouldPreventAppExit(m_shouldPreventAppExit); m_helpFrame = frame; return frame; } @@ -320,12 +341,12 @@ void wxHtmlHelpController::SetHelpWindow(wxHtmlHelpWindow* helpWindow) helpWindow->SetController(this); } -void wxHtmlHelpController::SetFrameParameters(const wxString& title, +void wxHtmlHelpController::SetFrameParameters(const wxString& titleFormat, const wxSize& size, const wxPoint& pos, bool WXUNUSED(newFrameEachTime)) { - SetTitleFormat(title); + SetTitleFormat(titleFormat); wxHtmlHelpFrame* frame = wxDynamicCast(FindTopLevelWindow(), wxHtmlHelpFrame); wxHtmlHelpDialog* dialog = wxDynamicCast(FindTopLevelWindow(), wxHtmlHelpDialog); if (frame)