1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
/**********************************************************************
Audacity: A Digital Audio Editor
ScrubbingToolbar.h
Paul Licameli
**********************************************************************/
#ifndef __AUDACITY_SCRUBBING_TOOLBAR__
#define __AUDACITY_SCRUBBING_TOOLBAR__
#include <wx/defs.h>
#include "ToolBar.h"
class AudacityProject;
class wxCommandEvent;
class wxDC;
class wxImage;
class wxWindow;
class AButton;
enum {
STBScrubID,
STBSeekID,
STBRulerID,
STBNumButtons,
STBFirstButton = STBScrubID
};
class ScrubbingToolBar final : public ToolBar {
public:
ScrubbingToolBar( AudacityProject &project );
virtual ~ScrubbingToolBar();
static ScrubbingToolBar &Get( AudacityProject &project );
static const ScrubbingToolBar &Get( const AudacityProject &project );
void Create(wxWindow *parent) override;
void OnButton(wxCommandEvent & event);
void Populate() override;
void Repaint(wxDC * WXUNUSED(dc)) override {};
void EnableDisableButtons() override;
void UpdatePrefs() override;
void RegenerateTooltips() override;
private:
static AButton *AddButton(
ScrubbingToolBar *pBar,
teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
int id, const TranslatableString &label, bool toggle = false);
void MakeButtons();
AButton *mButtons[STBNumButtons];
wxImage *upImage;
wxImage *downImage;
wxImage *hiliteImage;
void OnIdle( wxIdleEvent &evt );
public:
DECLARE_CLASS(ScrubbingToolBar)
DECLARE_EVENT_TABLE()
private:
void DoRegenerateTooltips( bool force );
bool mLastScrub{ false };
bool mLastSeek{ false };
bool mLastRuler{ false };
};
#endif
|