Audacity  2.3.1
PrefsPanel.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  PrefsPanel.h
6 
7  Joshua Haberman
8 
9 *******************************************************************//*******************************************************************/
32 
33 #ifndef __AUDACITY_PREFS_PANEL__
34 #define __AUDACITY_PREFS_PANEL__
35 
36 #include <wx/window.h>
37 #include "../widgets/wxPanelWrapper.h"
38 
39 /* A few constants for an attempt at semi-uniformity */
40 #define PREFS_FONT_SIZE 8
41 
42 /* these are spacing guidelines: ie. radio buttons should have a 5 pixel
43  * border on each side */
44 #define RADIO_BUTTON_BORDER 5
45 #define TOP_LEVEL_BORDER 5
46 #define GENERIC_CONTROL_BORDER 5
47 
48 class ShuttleGui;
49 
50 class PrefsPanel /* not final */ : public wxPanelWrapper
51 {
52  public:
53  PrefsPanel(wxWindow * parent, wxWindowID winid, const wxString &title)
54  : wxPanelWrapper(parent, winid)
55  {
56  SetLabel(title); // Provide visual label
57  SetName(title); // Provide audible label
58  }
59 
60  virtual ~PrefsPanel();
61 
62  // NEW virtuals
63  virtual void Preview() {} // Make tentative changes
64  virtual bool Commit() = 0; // used to be called "Apply"
65 
66  // If it returns True, the Preview button is added below the panel
67  // Default returns false
68  virtual bool ShowsPreviewButton();
69  virtual void PopulateOrExchange( ShuttleGui & WXUNUSED(S) ){};
70 
71  // If not empty string, the Help button is added below the panel
72  // Default returns empty string.
73  virtual wxString HelpPageName();
74 
75  virtual void Cancel();
76 };
77 
78 class PrefsPanelFactory /* not final */
79 {
80 public:
81  // Precondition: parent != NULL
82  virtual PrefsPanel *operator () (wxWindow *parent, wxWindowID winid) = 0;
83 };
84 
85 #endif
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:409
virtual ~PrefsPanel()
virtual PrefsPanel * operator()(wxWindow *parent, wxWindowID winid)=0
virtual void PopulateOrExchange(ShuttleGui &WXUNUSED(S))
Definition: PrefsPanel.h:69
virtual bool Commit()=0
virtual bool ShowsPreviewButton()
PrefsPanel(wxWindow *parent, wxWindowID winid, const wxString &title)
Definition: PrefsPanel.h:53
Base class for a panel in the PrefsDialog. Classes derived from this class include BatchPrefs...
Definition: PrefsPanel.h:50
virtual wxString HelpPageName()
Base class for factories such as GUIPrefsFactory that produce a PrefsPanel.
Definition: PrefsPanel.h:78
virtual void Preview()
Definition: PrefsPanel.h:63
virtual void Cancel()