Audacity  2.2.2
EditToolBar.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5 
6  EditToolbar.h
7 
8  Dominic Mazzoni
9  Shane T. Mueller
10  Leland Lucius
11 
12 **********************************************************************/
13 
14 #ifndef __AUDACITY_EDIT_TOOLBAR__
15 #define __AUDACITY_EDIT_TOOLBAR__
16 
17 #include <wx/defs.h>
18 
19 #include "ToolBar.h"
20 #include "../Theme.h"
21 #include "../Experimental.h"
22 
23 class wxCommandEvent;
24 class wxDC;
25 class wxImage;
26 class wxWindow;
27 
28 class AButton;
29 
30 enum {
36 
39 
40 #ifdef EXPERIMENTAL_SYNC_LOCK
41  //Undefined, so no sync-lock on/off button.
42  //#define OPTION_SYNC_LOCK_BUTTON
43 #endif
44 
45 #ifdef OPTION_SYNC_LOCK_BUTTON
46  ETBSyncLockID,
47 #endif
48 
51 #ifdef EXPERIMENTAL_ZOOM_TOGGLE_BUTTON
53 #endif
54 
57 
58 #if defined(EXPERIMENTAL_EFFECTS_RACK)
59  ETBEffectsID,
60 #endif
61 
63 };
64 
65 const int first_ETB_ID = 11300;
66 
67 // flags so 1,2,4,8 etc.
68 enum {
71 };
72 
73 class EditToolBar final : public ToolBar {
74 
75  public:
76 
77  EditToolBar();
78  virtual ~EditToolBar();
79 
80  void Create(wxWindow *parent) override;
81 
82  void OnButton(wxCommandEvent & event);
83 
84  void Populate() override;
85  void Repaint(wxDC * WXUNUSED(dc)) override {};
86  void EnableDisableButtons() override;
87  void UpdatePrefs() override;
88 
89  private:
90 
91  static AButton *AddButton(
92  EditToolBar *pBar,
93  teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
94  int id, const wxChar *label, bool toggle = false);
95 
96  void AddSeparator();
97 
98  void MakeButtons();
99 
100  void RegenerateTooltips() override;
101  void ForAllButtons(int Action);
102 
104 
105  wxImage *upImage;
106  wxImage *downImage;
107  wxImage *hiliteImage;
108 
109  public:
110 
111  DECLARE_CLASS(EditToolBar)
112  DECLARE_EVENT_TABLE()
113 };
114 
115 #endif
116 
void UpdatePrefs() override
static AButton * AddButton(EditToolBar *pBar, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled, int id, const wxChar *label, bool toggle=false)
A ToolBar that has the edit buttons on it.
Definition: EditToolBar.h:73
wxImage * upImage
Definition: EditToolBar.h:105
wxString label
Definition: Tags.cpp:727
void EnableDisableButtons() override
void Create(wxWindow *parent) override
Definition: EditToolBar.cpp:88
int teBmps
Definition: Theme.h:28
wxImage * downImage
Definition: EditToolBar.h:106
void AddSeparator()
Definition: EditToolBar.cpp:93
void Populate() override
void OnButton(wxCommandEvent &event)
void ForAllButtons(int Action)
AButton * mButtons[ETBNumButtons]
Definition: EditToolBar.h:103
wxImage * hiliteImage
Definition: EditToolBar.h:107
void Repaint(wxDC *WXUNUSED(dc)) override
Definition: EditToolBar.h:85
void RegenerateTooltips() override
void MakeButtons()
const int first_ETB_ID
Definition: EditToolBar.h:65
virtual ~EditToolBar()
Definition: EditToolBar.cpp:84
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed...
Definition: ToolBar.h:87
A wxButton with mouse-over behaviour.
Definition: AButton.h:28