Audacity  2.2.2
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 *******************************************************************//*******************************************************************/
27 
28 #ifndef __AUDACITY_PREFS_PANEL__
29 #define __AUDACITY_PREFS_PANEL__
30 
31 #include <wx/window.h>
32 #include "../widgets/wxPanelWrapper.h"
33 
34 /* A few constants for an attempt at semi-uniformity */
35 #define PREFS_FONT_SIZE 8
36 
37 /* these are spacing guidelines: ie. radio buttons should have a 5 pixel
38  * border on each side */
39 #define RADIO_BUTTON_BORDER 5
40 #define TOP_LEVEL_BORDER 5
41 #define GENERIC_CONTROL_BORDER 5
42 
43 class ShuttleGui;
44 
45 class PrefsPanel /* not final */ : public wxPanelWrapper
46 {
47  public:
48  PrefsPanel(wxWindow * parent, wxWindowID winid, const wxString &title)
49  : wxPanelWrapper(parent, winid)
50  {
51  SetLabel(title); // Provide visual label
52  SetName(title); // Provide audible label
53  }
54 
55  virtual ~PrefsPanel();
56 
57  // NEW virtuals
58  virtual void Preview() {} // Make tentative changes
59  virtual bool Commit() = 0; // used to be called "Apply"
60 
61  // If it returns True, the Preview button is added below the panel
62  // Default returns false
63  virtual bool ShowsPreviewButton();
64  virtual void PopulateOrExchange( ShuttleGui & WXUNUSED(S) ){};
65 
66  // If not empty string, the Help button is added below the panel
67  // Default returns empty string.
68  virtual wxString HelpPageName();
69 
70  virtual void Cancel();
71 };
72 
73 class PrefsPanelFactory /* not final */
74 {
75 public:
76  // Precondition: parent != NULL
77  virtual PrefsPanel *operator () (wxWindow *parent, wxWindowID winid) = 0;
78 };
79 
80 #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:64
virtual bool Commit()=0
virtual bool ShowsPreviewButton()
PrefsPanel(wxWindow *parent, wxWindowID winid, const wxString &title)
Definition: PrefsPanel.h:48
Used within the PrefsDialog, classes derived from this class include AudioIOPrefs, BatchPrefs, DirectoriesPrefs, FileFormatPrefs, GUIPrefs, KeyConfigPrefs, MousePrefs, QualityPrefs, SpectrumPrefs and ThemePrefs.
Definition: PrefsPanel.h:45
virtual wxString HelpPageName()
virtual void Preview()
Definition: PrefsPanel.h:58
virtual void Cancel()