2010-01-23 19:44:49 +00:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
|
|
|
|
ErrorDialog.h
|
|
|
|
|
|
|
|
Jimmy Johnson
|
2010-02-13 18:24:57 +00:00
|
|
|
James Crook
|
2010-01-23 19:44:49 +00:00
|
|
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
#ifndef __AUDACITY_ERRORDIALOG__
|
|
|
|
#define __AUDACITY_ERRORDIALOG__
|
|
|
|
|
|
|
|
#include "../Audacity.h"
|
|
|
|
#include <wx/defs.h>
|
|
|
|
#include <wx/window.h>
|
|
|
|
|
2011-04-02 13:03:02 +00:00
|
|
|
class AudacityProject;
|
|
|
|
|
2016-02-24 06:06:39 +00:00
|
|
|
class ErrorDialog /* not final */ : public wxDialog
|
2014-06-06 21:34:36 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// constructors and destructors
|
|
|
|
ErrorDialog(wxWindow *parent,
|
|
|
|
const wxString & dlogTitle,
|
|
|
|
const wxString & message,
|
|
|
|
const wxString & helpURL,
|
|
|
|
const bool Close = true, const bool modal = true);
|
|
|
|
|
|
|
|
virtual ~ErrorDialog(){}
|
|
|
|
|
|
|
|
private:
|
|
|
|
wxString dhelpURL;
|
|
|
|
bool dClose;
|
|
|
|
bool dModal;
|
|
|
|
|
|
|
|
void OnOk( wxCommandEvent &event );
|
|
|
|
void OnHelp( wxCommandEvent &event );
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
|
|
|
// Helper class to make browser "simulate" a modal dialog
|
2016-06-20 18:02:44 +00:00
|
|
|
class HtmlTextHelpDialog final : public BrowserDialog
|
2014-06-06 21:34:36 +00:00
|
|
|
{
|
|
|
|
public:
|
2016-06-20 18:02:44 +00:00
|
|
|
HtmlTextHelpDialog(wxWindow *pParent, const wxString &title)
|
|
|
|
: BrowserDialog{ pParent, title }
|
2014-06-06 21:34:36 +00:00
|
|
|
{
|
2015-06-30 16:25:32 +00:00
|
|
|
#if !wxCHECK_VERSION(3, 0, 0)
|
2014-06-06 21:34:36 +00:00
|
|
|
MakeModal( true );
|
2015-05-16 20:40:29 +00:00
|
|
|
#endif
|
2014-06-06 21:34:36 +00:00
|
|
|
}
|
|
|
|
virtual ~HtmlTextHelpDialog()
|
|
|
|
{
|
2015-06-30 16:25:32 +00:00
|
|
|
#if !wxCHECK_VERSION(3, 0, 0)
|
2014-06-06 21:34:36 +00:00
|
|
|
MakeModal( false );
|
2015-05-16 20:40:29 +00:00
|
|
|
#endif
|
2014-06-06 21:34:36 +00:00
|
|
|
// On Windows, for some odd reason, the Audacity window will be sent to
|
|
|
|
// the back. So, make sure that doesn't happen.
|
|
|
|
GetParent()->Raise();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
/// Displays an error dialog with a button that offers help
|
|
|
|
void ShowErrorDialog(wxWindow *parent,
|
|
|
|
const wxString &dlogTitle,
|
2014-06-03 20:30:19 +00:00
|
|
|
const wxString &message,
|
2010-12-11 22:32:07 +00:00
|
|
|
const wxString &helpURL,
|
|
|
|
bool Close = true);
|
2010-02-13 18:24:57 +00:00
|
|
|
|
2011-03-01 01:29:03 +00:00
|
|
|
/// Displays a modeless error dialog with a button that offers help
|
|
|
|
void ShowModelessErrorDialog(wxWindow *parent,
|
|
|
|
const wxString &dlogTitle,
|
2014-06-03 20:30:19 +00:00
|
|
|
const wxString &message,
|
2011-03-01 01:29:03 +00:00
|
|
|
const wxString &helpURL,
|
|
|
|
bool Close = true);
|
|
|
|
|
2011-03-23 01:01:17 +00:00
|
|
|
/// Displays a custom modeless error dialog for aliased file errors
|
2011-04-02 13:03:02 +00:00
|
|
|
void ShowAliasMissingDialog(AudacityProject *parent,
|
2011-03-23 01:01:17 +00:00
|
|
|
const wxString &dlogTitle,
|
2014-06-03 20:30:19 +00:00
|
|
|
const wxString &message,
|
2011-03-23 01:01:17 +00:00
|
|
|
const wxString &helpURL,
|
|
|
|
const bool Close = true);
|
|
|
|
|
2010-01-23 19:44:49 +00:00
|
|
|
#endif // __AUDACITY_ERRORDIALOG__
|