Audacity 3.2.0
SnappingToolBar.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/**********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 SnappingToolBar.h
7
8 Dmitry Vedenko
9
10**********************************************************************/
11
12#pragma once
13
14#include <type_traits>
15#include <wx/weakref.h>
16
17#include <array>
18
19#include "ToolBar.h"
21
22#include "Observer.h"
23
24class wxCheckBox;
25class wxComboCtrl;
26class wxSizeEvent;
27
28class AudacityProject;
29
30class SnappingToolBar final : public ToolBar {
31
32 public:
33 static Identifier ID();
34
36 virtual ~SnappingToolBar();
37
38 bool ShownByDefault() const override;
39 DockID DefaultDockID() const override;
40
42 static const SnappingToolBar& Get(const AudacityProject& project);
43
44 void Create(wxWindow *parent) override;
45
46 void Populate() override;
47 void Repaint(wxDC * WXUNUSED(dc)) override {};
48 void EnableDisableButtons() override {};
49 void UpdatePrefs() override;
50
51 void RegenerateTooltips() override;
52
53 private:
54 void OnSize(wxSizeEvent &evt);
55 void OnSnapModeChanged();
56
57 wxWeakRef<wxCheckBox> mSnapModeCheckBox;
58 wxWeakRef<wxComboCtrl> mSnapToCombo;
59
61
62 public:
63
64 DECLARE_CLASS(SelectionBar)
65 DECLARE_EVENT_TABLE()
66};
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
(not quite a Toolbar) at foot of screen for setting and viewing the selection range.
Definition: SelectionBar.h:37
static Identifier ID()
void Repaint(wxDC *WXUNUSED(dc)) override
void Populate() override
virtual ~SnappingToolBar()
void RegenerateTooltips() override
bool ShownByDefault() const override
Whether the toolbar should be shown by default. Default implementation returns true.
void OnSize(wxSizeEvent &evt)
void UpdatePrefs() override
void Create(wxWindow *parent) override
void EnableDisableButtons() override
Observer::Subscription mSnappingModeChangedSubscription
SnappingToolBar(AudacityProject &project)
static SnappingToolBar & Get(AudacityProject &project)
wxWeakRef< wxComboCtrl > mSnapToCombo
DockID DefaultDockID() const override
Which dock the toolbar defaults into. Default implementation chooses the top dock.
wxWeakRef< wxCheckBox > mSnapModeCheckBox
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.
Definition: ToolBar.h:74
DockID
Identifies one of the docking areas for toolbars.
Definition: ToolBar.h:92