Audacity 3.2.0
TimeToolBar.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 TimeToolBar.h
6
7 Jonatã Bolzan Loss
8
9**********************************************************************/
10
11#ifndef __AUDACITY_TIME_TOOLBAR__
12#define __AUDACITY_TIME_TOOLBAR__
13
14#include <wx/defs.h>
15
16#include "ToolBar.h"
17#include "../widgets/NumericTextCtrl.h"
18#include "Observer.h"
19
20class NumericTextCtrl;
22
23class TimeToolBar final : public ToolBar
24{
25public:
27 virtual ~TimeToolBar();
28
29 static TimeToolBar &Get(AudacityProject &project);
30 static const TimeToolBar &Get(const AudacityProject &project);
31
32 void Populate() override;
33 void Repaint(wxDC * WXUNUSED(dc)) override {};
34 void EnableDisableButtons() override {};
35 void UpdatePrefs() override;
36 void RegenerateTooltips() override {};
37 int GetInitialWidth() override {return 250;}
38 int GetMinToolbarWidth() override {return 50;}
39 void SetToDefaultSize() override;
40 wxSize GetDockedSize() override;
41 void SetDocked(ToolDock *dock, bool pushed) override;
44 void ResizingDone() override;
45
46private:
47 void SetResizingLimits();
48 wxSize ComputeSizing(int digitH);
49
50 void OnRateChanged(double);
51 void OnUpdate(wxCommandEvent &evt);
52 void OnSize(wxSizeEvent &evt);
53 void OnIdle(wxIdleEvent &evt);
54
59
60 static const int minDigitH = 17;
61 static const int maxDigitH = 100;
62
64
65public:
66
67 DECLARE_CLASS(TimeToolBar)
68 DECLARE_EVENT_TABLE()
69};
70
71inline wxSize TimeToolBar::ComputeSizing(int digitH)
72{
73 return mAudioTime->ComputeSizing(false, digitH * mDigitRatio, digitH);
74}
75
76#endif
int format
Definition: ExportPCM.cpp:56
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:89
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
wxSize ComputeSizing(bool update=true, wxCoord digitW=0, wxCoord digitH=0)
A move-only handle representing a connection to a Publisher.
Definition: Observer.h:70
TimeToolBarListener * mListener
Definition: TimeToolBar.h:55
void Repaint(wxDC *WXUNUSED(dc)) override
Definition: TimeToolBar.h:33
static const int minDigitH
Definition: TimeToolBar.h:60
void SetAudioTimeFormat(const NumericFormatSymbol &format)
void RegenerateTooltips() override
Definition: TimeToolBar.h:36
void OnRateChanged(double)
void OnIdle(wxIdleEvent &evt)
void OnSize(wxSizeEvent &evt)
static TimeToolBar & Get(AudacityProject &project)
Definition: TimeToolBar.cpp:65
wxSize GetDockedSize() override
static const int maxDigitH
Definition: TimeToolBar.h:61
void SetToDefaultSize() override
void SetListener(TimeToolBarListener *l)
void OnUpdate(wxCommandEvent &evt)
NumericTextCtrl * mAudioTime
Definition: TimeToolBar.h:56
void SetDocked(ToolDock *dock, bool pushed) override
void SetResizingLimits()
virtual ~TimeToolBar()
Definition: TimeToolBar.cpp:61
float mDigitRatio
Definition: TimeToolBar.h:57
void ResizingDone() override
int GetMinToolbarWidth() override
Definition: TimeToolBar.h:38
Observer::Subscription mSubscription
Definition: TimeToolBar.h:63
void UpdatePrefs() override
int GetInitialWidth() override
Resizable toolbars should implement these.
Definition: TimeToolBar.h:37
void Populate() override
Definition: TimeToolBar.cpp:76
bool mSettingInitialSize
Definition: TimeToolBar.h:58
wxSize ComputeSizing(int digitH)
Definition: TimeToolBar.h:71
void EnableDisableButtons() override
Definition: TimeToolBar.h:34
TimeToolBar(AudacityProject &project)
Definition: TimeToolBar.cpp:52
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.
Definition: ToolBar.h:101
A dynamic panel where a ToolBar can be docked.
Definition: ToolDock.h:290