Move class HtmlTextHelpDialog out of header

This commit is contained in:
Paul Licameli 2019-03-31 14:54:32 -04:00
parent b83ed90cfb
commit e2c5444c1d
4 changed files with 28 additions and 23 deletions

View File

@ -40,6 +40,7 @@ effects from this one class.
#include <wx/datetime.h>
#include <wx/intl.h>
#include <wx/log.h>
#include <wx/scrolwin.h>
#include <wx/sizer.h>
#include <wx/slider.h>
#include <wx/sstream.h>

View File

@ -13,6 +13,7 @@
#include "../commands/CommandContext.h"
#include "../commands/CommandManager.h"
#include "../widgets/HelpSystem.h"
#include "../widgets/LinkingHtmlWindow.h"
#if defined(EXPERIMENTAL_CRASH_REPORT)
#include <wx/debugrpt.h>

View File

@ -16,7 +16,6 @@
#include <wx/defs.h>
#include <wx/msgdlg.h> // to inherit
#include "LinkingHtmlWindow.h"
#include "wxPanelWrapper.h"
class AudacityProject;
@ -43,28 +42,6 @@ private:
DECLARE_EVENT_TABLE()
};
// Helper class to make browser "simulate" a modal dialog
class HtmlTextHelpDialog final : public BrowserDialog
{
public:
HtmlTextHelpDialog(wxWindow *pParent, const wxString &title)
: BrowserDialog{ pParent, title }
{
#if !wxCHECK_VERSION(3, 0, 0)
MakeModal( true );
#endif
}
virtual ~HtmlTextHelpDialog()
{
#if !wxCHECK_VERSION(3, 0, 0)
MakeModal( false );
#endif
// On Windows, for some odd reason, the Audacity window will be sent to
// the back. So, make sure that doesn't happen.
GetParent()->Raise();
}
};
/// Displays an error dialog with a button that offers help
void ShowErrorDialog(wxWindow *parent,
const wxString &dlogTitle,

View File

@ -51,6 +51,32 @@ const wxString HelpSystem::HelpServerManDir = wxT("/man/");
const wxString HelpSystem::LocalHelpManDir = wxT("/man/");
const wxString HelpSystem::ReleaseSuffix = wxT(".html");
namespace {
// Helper class to make browser "simulate" a modal dialog
class HtmlTextHelpDialog final : public BrowserDialog
{
public:
HtmlTextHelpDialog(wxWindow *pParent, const wxString &title)
: BrowserDialog{ pParent, title }
{
#if !wxCHECK_VERSION(3, 0, 0)
MakeModal( true );
#endif
}
virtual ~HtmlTextHelpDialog()
{
#if !wxCHECK_VERSION(3, 0, 0)
MakeModal( false );
#endif
// On Windows, for some odd reason, the Audacity window will be sent to
// the back. So, make sure that doesn't happen.
GetParent()->Raise();
}
};
}
/// Mostly we use this so that we have the code for resizability
/// in one place. Other considerations like screen readers are also
/// handled by having the code in one place.