Add wxHtmlHelpController::SetShouldPreventAppExit().
Add a method which can be used to indicate that the help window should prevent the application from exiting and use it in the help sample to prevent it from closing prematurely. Closes #13046. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -52,6 +52,7 @@ wxHtmlHelpController::wxHtmlHelpController(int style, wxWindow* parentWindow):
|
||||
#endif // wxUSE_CONFIG
|
||||
m_titleFormat = _("Help: %s");
|
||||
m_FrameStyle = style;
|
||||
m_shouldPreventAppExit = false;
|
||||
}
|
||||
|
||||
wxHtmlHelpController::~wxHtmlHelpController()
|
||||
@@ -105,6 +106,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 +171,7 @@ wxHtmlHelpFrame* wxHtmlHelpController::CreateHelpFrame(wxHtmlHelpData *data)
|
||||
#endif // wxUSE_CONFIG
|
||||
);
|
||||
frame->SetTitleFormat(m_titleFormat);
|
||||
frame->SetShouldPreventAppExit(m_shouldPreventAppExit);
|
||||
m_helpFrame = frame;
|
||||
return frame;
|
||||
}
|
||||
|
Reference in New Issue
Block a user