Audacity  2.2.0
ErrorDialog.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  ErrorDialog.h
6 
7  Jimmy Johnson
8  James Crook
9 
10 **********************************************************************/
11 
12 #ifndef __AUDACITY_ERRORDIALOG__
13 #define __AUDACITY_ERRORDIALOG__
14 
15 #include "../Audacity.h"
16 #include <wx/defs.h>
17 #include <wx/window.h>
18 #include "wxPanelWrapper.h"
19 
20 class AudacityProject;
21 
22 class ErrorDialog /* not final */ : public wxDialogWrapper
23 {
24 public:
25  // constructors and destructors
26  ErrorDialog(wxWindow *parent,
27  const wxString & dlogTitle,
28  const wxString & message,
29  const wxString & helpPage,
30  const bool Close = true, const bool modal = true);
31 
32  virtual ~ErrorDialog(){}
33 
34 private:
35  wxString dhelpPage;
36  bool dClose;
37  bool dModal;
38 
39  void OnOk( wxCommandEvent &event );
40  void OnHelp( wxCommandEvent &event );
41  DECLARE_EVENT_TABLE()
42 };
43 
44 // Helper class to make browser "simulate" a modal dialog
45 class HtmlTextHelpDialog final : public BrowserDialog
46 {
47 public:
48  HtmlTextHelpDialog(wxWindow *pParent, const wxString &title)
49  : BrowserDialog{ pParent, title }
50  {
51 #if !wxCHECK_VERSION(3, 0, 0)
52  MakeModal( true );
53 #endif
54  }
56  {
57 #if !wxCHECK_VERSION(3, 0, 0)
58  MakeModal( false );
59 #endif
60  // On Windows, for some odd reason, the Audacity window will be sent to
61  // the back. So, make sure that doesn't happen.
62  GetParent()->Raise();
63  }
64 };
65 
67 void ShowErrorDialog(wxWindow *parent,
68  const wxString &dlogTitle,
69  const wxString &message,
70  const wxString &helpPage,
71  bool Close = true);
72 
74 void ShowModelessErrorDialog(wxWindow *parent,
75  const wxString &dlogTitle,
76  const wxString &message,
77  const wxString &helpPage,
78  bool Close = true);
79 
82  const wxString &dlogTitle,
83  const wxString &message,
84  const wxString &helpPage,
85  const bool Close = true);
86 
87 #endif // __AUDACITY_ERRORDIALOG__
virtual ~ErrorDialog()
Definition: ErrorDialog.h:32
virtual ~HtmlTextHelpDialog()
Definition: ErrorDialog.h:55
void ShowErrorDialog(wxWindow *parent, const wxString &dlogTitle, const wxString &message, const wxString &helpPage, bool Close=true)
Displays an error dialog with a button that offers help.
Definition: ErrorDialog.cpp:176
void OnOk(wxCommandEvent &event)
Definition: ErrorDialog.cpp:149
void OnHelp(wxCommandEvent &event)
Definition: ErrorDialog.cpp:158
Definition: ErrorDialog.h:45
void ShowAliasMissingDialog(AudacityProject *parent, const wxString &dlogTitle, const wxString &message, const wxString &helpPage, const bool Close=true)
Displays a custom modeless error dialog for aliased file errors.
Definition: ErrorDialog.cpp:208
Definition: wxPanelWrapper.h:19
ErrorDialog(wxWindow *parent, const wxString &dlogTitle, const wxString &message, const wxString &helpPage, const bool Close=true, const bool modal=true)
Definition: ErrorDialog.cpp:80
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:161
HtmlTextHelpDialog(wxWindow *pParent, const wxString &title)
Definition: ErrorDialog.h:48
Definition: LinkingHtmlWindow.h:39
bool dClose
Definition: ErrorDialog.h:36
bool dModal
Definition: ErrorDialog.h:37
void ShowModelessErrorDialog(wxWindow *parent, const wxString &dlogTitle, const wxString &message, const wxString &helpPage, bool Close=true)
Displays a modeless error dialog with a button that offers help.
Definition: ErrorDialog.cpp:189
Gives an Error message with an option for help.
Definition: ErrorDialog.h:22
wxString dhelpPage
Definition: ErrorDialog.h:35