]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/helpctrl.cpp
Add doc for wxGraphicsContext.Create(), which is a lightweight context with no target...
[wxWidgets.git] / src / html / helpctrl.cpp
index d093b99b731a83eca918c0f59848032f41b36238..af46650fa42fd4fd9eb014790dd0a49e0d67998e 100644 (file)
@@ -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)