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:
26 static Identifier ID();
27
29 virtual ~TimeToolBar();
30
31 DockID DefaultDockID() const override;
32
34 static const TimeToolBar &Get(const AudacityProject &project);
35
36 void Populate() override;
37 void Repaint(wxDC * WXUNUSED(dc)) override {};
38 void EnableDisableButtons() override {};
39 void UpdatePrefs() override;
40 void RegenerateTooltips() override {};
41 int GetInitialWidth() override {return 250;}
42 int GetMinToolbarWidth() override {return 50;}
43 void SetToDefaultSize() override;
44 wxSize GetDockedSize() override;
45 void SetDocked(ToolDock *dock, bool pushed) override;
47 void ResizingDone() override;
48
49private:
50 void SetResizingLimits();
51 wxSize ComputeSizing(int digitH);
53 void OnUpdate(wxCommandEvent &evt);
54 void OnSize(wxSizeEvent &evt);
55 void OnIdle(wxIdleEvent &evt);
56
60
61 static const int minDigitH = 17;
62 static const int maxDigitH = 100;
63
66
67public:
68
69 DECLARE_CLASS(TimeToolBar)
70 DECLARE_EVENT_TABLE()
71};
72
73#endif
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
An explicitly nonlocalized string, not meant for the user to see.
Definition: Identifier.h:22
A move-only handle representing a connection to a Publisher.
Definition: Observer.h:70
void Repaint(wxDC *WXUNUSED(dc)) override
Definition: TimeToolBar.h:37
static const int minDigitH
Definition: TimeToolBar.h:61
void RegenerateTooltips() override
Definition: TimeToolBar.h:40
void OnIdle(wxIdleEvent &evt)
void OnSize(wxSizeEvent &evt)
static TimeToolBar & Get(AudacityProject &project)
Definition: TimeToolBar.cpp:75
wxSize GetDockedSize() override
DockID DefaultDockID() const override
Which dock the toolbar defaults into. Default implementation chooses the top dock.
Definition: TimeToolBar.cpp:70
Observer::Subscription mFormatsSubscription
Definition: TimeToolBar.h:65
static const int maxDigitH
Definition: TimeToolBar.h:62
void OnFormatsChanged(ProjectNumericFormatsEvent)
void SetToDefaultSize() override
void OnUpdate(wxCommandEvent &evt)
NumericTextCtrl * mAudioTime
Definition: TimeToolBar.h:57
void SetDocked(ToolDock *dock, bool pushed) override
static Identifier ID()
Definition: TimeToolBar.cpp:53
void SetResizingLimits()
virtual ~TimeToolBar()
Definition: TimeToolBar.cpp:66
void SetAudioTimeFormat(const NumericFormatID &format)
float mDigitRatio
Definition: TimeToolBar.h:58
void ResizingDone() override
int GetMinToolbarWidth() override
Definition: TimeToolBar.h:42
void UpdatePrefs() override
int GetInitialWidth() override
Resizable toolbars should implement these.
Definition: TimeToolBar.h:41
Observer::Subscription mFormatChangedToFitValueSubscription
Definition: TimeToolBar.h:64
void Populate() override
Definition: TimeToolBar.cpp:86
bool mSettingInitialSize
Definition: TimeToolBar.h:59
wxSize ComputeSizing(int digitH)
void EnableDisableButtons() override
Definition: TimeToolBar.h:38
TimeToolBar(AudacityProject &project)
Definition: TimeToolBar.cpp:58
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.
Definition: ToolBar.h:73
DockID
Identifies one of the docking areas for toolbars.
Definition: ToolBar.h:91
A dynamic panel where a ToolBar can be docked.
Definition: ToolDock.h:292