]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed premature exit of helpview sample and utility
authorJulian Smart <julian@anthemion.co.uk>
Fri, 2 Mar 2007 19:48:43 +0000 (19:48 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 2 Mar 2007 19:48:43 +0000 (19:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44600 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/html/helpfrm.h
samples/html/helpview/helpview.cpp
src/html/helpfrm.cpp
utils/helpview/src/helpview.cpp

index cc50b5fc577ecf6fdf0401e34cf948e6dd3cd543..4c53f11e40a2370310045f5f673e9ede93253699 100644 (file)
@@ -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);
index 3cb2b9bc4d25aa92c196f62cac1f653432653afa..238deea26a2f5b6d1628266571cd7ecde9fe8edf 100644 (file)
@@ -84,6 +84,8 @@ bool MyApp::OnInit()
 
     help -> DisplayContents();
 
+    SetTopWindow(help->GetFrame());
+
     return true;
 }
 
index c3a082efb9945f366156daa03acc3c514bfec1f5..7066746015c38f0537e17ea7fc12d84f1a0f7ebb 100644 (file)
@@ -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
index 72b3daa6a34c2e2f4b5fc9ad9725be498f3059a3..68991f746792e1b05f1fef5e15a2feb942b3e183 100644 (file)
@@ -219,6 +219,8 @@ bool hvApp::OnInit()
 
     m_helpController->DisplayContents();
 
+    SetTopWindow(m_helpController->GetFrame());
+
     return true;
 }