Fixed premature exit of helpview sample and utility
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44600 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -109,7 +109,7 @@ public:
|
||||
|
||||
// we don't want to prevent the app from closing just because a help window
|
||||
// remains opened
|
||||
virtual bool ShouldPreventAppExit() const { return false; }
|
||||
virtual bool ShouldPreventAppExit() const;
|
||||
|
||||
protected:
|
||||
void Init(wxHtmlHelpData* data = NULL);
|
||||
|
@@ -84,6 +84,8 @@ bool MyApp::OnInit()
|
||||
|
||||
help -> DisplayContents();
|
||||
|
||||
SetTopWindow(help->GetFrame());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -55,6 +55,7 @@
|
||||
#include "wx/fontenum.h"
|
||||
#include "wx/artprov.h"
|
||||
#include "wx/spinctrl.h"
|
||||
#include "wx/app.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxHtmlHelpFrame, wxFrame)
|
||||
|
||||
@@ -237,4 +238,11 @@ void wxHtmlHelpFrame::OnAbout(wxCommandEvent& event)
|
||||
}
|
||||
#endif
|
||||
|
||||
// we don't want to prevent the app from closing just because a help window
|
||||
// remains opened
|
||||
bool wxHtmlHelpFrame::ShouldPreventAppExit() const
|
||||
{
|
||||
return (this == wxTheApp->GetTopWindow());
|
||||
}
|
||||
|
||||
#endif // wxUSE_WXHTML_HELP
|
||||
|
@@ -219,6 +219,8 @@ bool hvApp::OnInit()
|
||||
|
||||
m_helpController->DisplayContents();
|
||||
|
||||
SetTopWindow(m_helpController->GetFrame());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user