Audacity  2.2.0
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 
52  #if 0 // Disabled for version 1.2.0 since it doesn't work quite right...
53  ETBZoomToggleID,
54  #endif
55 
58 
59 #if defined(EXPERIMENTAL_EFFECTS_RACK)
60  ETBEffectsID,
61 #endif
62 
64 };
65 
66 // flags so 1,2,4,8 etc.
67 enum {
70 };
71 
72 class EditToolBar final : public ToolBar {
73 
74  public:
75 
76  EditToolBar();
77  virtual ~EditToolBar();
78 
79  void Create(wxWindow *parent);
80 
81  void OnButton(wxCommandEvent & event);
82 
83  void Populate();
84  void Repaint(wxDC * WXUNUSED(dc)) {};
85  void EnableDisableButtons();
86  void UpdatePrefs();
87 
88  private:
89 
90  AButton *AddButton(teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
91  int id, const wxChar *label, bool toggle = false);
92 
93  void AddSeparator();
94 
95  void MakeButtons();
96 
97  void RegenerateTooltips() override;
98  void ForAllButtons(int Action);
99 
101 
102  wxImage *upImage;
103  wxImage *downImage;
104  wxImage *hiliteImage;
105 
106  public:
107 
108  DECLARE_CLASS(EditToolBar)
109  DECLARE_EVENT_TABLE()
110 };
111 
112 #endif
113 
void EnableDisableButtons()
Definition: EditToolBar.cpp:204
Definition: EditToolBar.h:38
AButton * AddButton(teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled, int id, const wxChar *label, bool toggle=false)
Definition: EditToolBar.cpp:100
void Repaint(wxDC *WXUNUSED(dc))
Definition: EditToolBar.h:84
Definition: EditToolBar.h:56
Definition: EditToolBar.h:49
Definition: EditToolBar.h:34
A ToolBar that has the edit buttons on it.
Definition: EditToolBar.h:72
wxImage * upImage
Definition: EditToolBar.h:102
wxString label
Definition: Tags.cpp:717
Definition: EditToolBar.h:69
void UpdatePrefs()
Definition: EditToolBar.cpp:188
int teBmps
Definition: Theme.h:28
void Create(wxWindow *parent)
Definition: EditToolBar.cpp:87
Definition: EditToolBar.h:31
Definition: EditToolBar.h:32
wxImage * downImage
Definition: EditToolBar.h:103
void AddSeparator()
Definition: EditToolBar.cpp:92
void OnButton(wxCommandEvent &event)
Definition: EditToolBar.cpp:276
Definition: EditToolBar.h:37
Definition: EditToolBar.h:57
void ForAllButtons(int Action)
Definition: EditToolBar.cpp:238
AButton * mButtons[ETBNumButtons]
Definition: EditToolBar.h:100
Definition: EditToolBar.h:35
Definition: EditToolBar.h:63
wxImage * hiliteImage
Definition: EditToolBar.h:104
Definition: EditToolBar.h:68
void Populate()
Definition: EditToolBar.cpp:125
void RegenerateTooltips() override
Definition: EditToolBar.cpp:199
Definition: EditToolBar.h:33
void MakeButtons()
virtual ~EditToolBar()
Definition: EditToolBar.cpp:83
Definition: EditToolBar.h:50
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:27