![]() |
Audacity 3.2.0
|
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed. More...
#include <ToolBar.h>
Public Types | |
using | Holder = wxWindowPtr< ToolBar > |
Public Member Functions | |
ToolBar (AudacityProject &project, int type, const TranslatableString &label, const wxString §ion, bool resizable=false) | |
virtual | ~ToolBar () |
bool | AcceptsFocus () const override |
virtual void | SetToDefaultSize () |
virtual void | Create (wxWindow *parent) |
virtual void | EnableDisableButtons ()=0 |
virtual void | ReCreateButtons () |
void | UpdatePrefs () override |
virtual void | RegenerateTooltips ()=0 |
int | GetType () |
TranslatableString | GetTitle () |
TranslatableString | GetLabel () |
wxString | GetSection () |
ToolDock * | GetDock () |
void | SetLabel (const TranslatableString &label) |
virtual void | SetDocked (ToolDock *dock, bool pushed) |
virtual bool | Expose (bool show=true) |
bool | IsResizable () const |
bool | IsVisible () const |
bool | IsDocked () const |
bool | IsPositioned () |
void | SetVisible (bool bVisible) |
void | SetPositioned () |
virtual int | GetInitialWidth () |
Resizable toolbars should implement these. More... | |
virtual int | GetMinToolbarWidth () |
virtual wxSize | GetDockedSize () |
wxSize | GetSmartDockedSize () |
virtual void | ResizingDone () |
![]() | |
wxPanelWrapper () | |
wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel")) | |
bool | Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel")) |
void | SetLabel (const TranslatableString &label) |
void | SetName (const TranslatableString &name) |
void | SetToolTip (const TranslatableString &toolTip) |
void | SetName () |
![]() | |
wxTabTraversalWrapper (Args &&... args) | |
wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete | |
wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete | |
wxTabTraversalWrapper & | operator= (const wxTabTraversalWrapper &)=delete |
wxTabTraversalWrapper & | operator= (wxTabTraversalWrapper &&)=delete |
Static Public Member Functions | |
static AButton * | MakeButton (wxWindow *parent, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxWindowID id, wxPoint placement, bool processdownevents, wxSize size) |
static AButton * | MakeButton (ToolBar *parent, teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled, int id, bool processdownevents, const TranslatableString &label) |
static void | MakeAlternateImages (AButton &button, int idx, teBmps eUp, teBmps eDown, teBmps eHilite, teBmps eDownHi, teBmps eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxSize size) |
static void | SetButtonToolTip (AudacityProject &project, AButton &button, const ComponentInterfaceSymbol commands[], size_t nCommands) |
static void | MakeButtonBackgroundsSmall () |
static void | MakeButtonBackgroundsLarge () |
Protected Member Functions | |
void | SetButton (bool down, AButton *button) |
wxBoxSizer * | GetSizer () |
void | Add (wxWindow *window, int proportion=0, int flag=wxALIGN_TOP, int border=0, wxObject *userData=NULL) |
void | Add (wxSizer *sizer, int proportion=0, int flag=0, int border=0, wxObject *userData=NULL) |
void | Add (int width, int height, int proportion=0, int flag=0, int border=0, wxObject *userData=NULL) |
void | AddSpacer (int size=14) |
void | AddStretchSpacer (int prop=1) |
void | Detach (wxWindow *window) |
void | Detach (wxSizer *sizer) |
void | Updated () |
int | GetResizeGrabberWidth () |
Returns the width in pixels of the resizer element. More... | |
virtual void | Populate ()=0 |
virtual void | Repaint (wxDC *dc)=0 |
void | OnErase (wxEraseEvent &event) |
void | OnPaint (wxPaintEvent &event) |
void | OnMouseEvents (wxMouseEvent &event) |
![]() | |
virtual void | UpdateSelectedPrefs (int id) |
PrefsListener () | |
virtual | ~PrefsListener () |
virtual void | UpdatePrefs ()=0 |
Static Protected Member Functions | |
static void | MakeMacRecoloredImage (teBmps eBmpOut, teBmps eBmpIn) |
static void | MakeMacRecoloredImageSize (teBmps eBmpOut, teBmps eBmpIn, const wxSize &size) |
static void | MakeRecoloredImage (teBmps eBmpOut, teBmps eBmpIn) |
static void | MakeRecoloredImageSize (teBmps eBmpOut, teBmps eBmpIn, const wxSize &size) |
![]() | |
static void | Broadcast (int id=0) |
Call this static function to notify all PrefsListener objects. More... | |
Protected Attributes | |
AudacityProject & | mProject |
TranslatableString | mLabel |
wxString | mSection |
int | mType |
Private Member Functions | |
void | SetLabel (const wxString &label) override |
void | Init (wxWindow *parent, int type, const wxString &title, const wxString &label) |
Private Attributes | |
wxWindow * | mParent |
Grabber * | mGrabber |
ToolBarResizer * | mResizer |
wxBoxSizer * | mHSizer |
bool | mVisible |
bool | mResizable |
bool | mPositioned |
Friends | |
class | ToolBarResizer |
Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.
using ToolBar::Holder = wxWindowPtr<ToolBar> |
ToolBar::ToolBar | ( | AudacityProject & | project, |
int | type, | ||
const TranslatableString & | label, | ||
const wxString & | section, | ||
bool | resizable = false |
||
) |
Definition at line 330 of file ToolBar.cpp.
|
virtual |
Definition at line 358 of file ToolBar.cpp.
|
inlineoverride |
|
protected |
Definition at line 718 of file ToolBar.cpp.
|
protected |
|
protected |
Definition at line 686 of file ToolBar.cpp.
Referenced by ScrubbingToolBar::AddButton(), TranscriptionToolBar::AddButton(), AudioSetupToolBar::ArrangeButtons(), ControlToolBar::ArrangeButtons(), DeviceToolBar::Populate(), EditToolBar::Populate(), MeterToolBar::Populate(), MixerToolBar::Populate(), SelectionBar::Populate(), TimeToolBar::Populate(), ToolsToolBar::Populate(), and TranscriptionToolBar::Populate().
|
protected |
Definition at line 736 of file ToolBar.cpp.
|
protected |
Definition at line 744 of file ToolBar.cpp.
References mHSizer.
|
virtual |
Reimplemented in AudioSetupToolBar, ControlToolBar, DeviceToolBar, EditToolBar, MeterToolBar, MixerToolBar, ScrubbingToolBar, SelectionBar, SpectralSelectionBar, ToolsToolBar, and TranscriptionToolBar.
Definition at line 475 of file ToolBar.cpp.
References wxPanelWrapper::Create(), GetLabel(), GetTitle(), mParent, mType, mVisible, ReCreateButtons(), and wxPanelWrapper::SetLabel().
Referenced by AudioSetupToolBar::Create(), ControlToolBar::Create(), DeviceToolBar::Create(), EditToolBar::Create(), MeterToolBar::Create(), MixerToolBar::Create(), ScrubbingToolBar::Create(), SelectionBar::Create(), ToolsToolBar::Create(), TranscriptionToolBar::Create(), and ToolManager::ReadConfig().
|
protected |
Definition at line 760 of file ToolBar.cpp.
References mHSizer.
|
protected |
Definition at line 752 of file ToolBar.cpp.
References mHSizer.
Referenced by AudioSetupToolBar::ArrangeButtons(), ControlToolBar::ArrangeButtons(), AudioSetupToolBar::ReCreateButtons(), and ControlToolBar::ReCreateButtons().
|
pure virtual |
Implemented in AudioSetupToolBar, ControlToolBar, DeviceToolBar, EditToolBar, MeterToolBar, MixerToolBar, ScrubbingToolBar, SelectionBar, SpectralSelectionBar, TimeToolBar, ToolsToolBar, and TranscriptionToolBar.
Referenced by ToolManager::Reset(), and ProjectAudioManager::Stop().
|
virtual |
Reimplemented in MeterToolBar.
Definition at line 444 of file ToolBar.cpp.
References IsDocked(), IsPositioned(), mType, mVisible, SetPositioned(), and SetVisible().
Referenced by MeterToolBar::Expose(), ToolDock::Expose(), and ToolManager::Expose().
ToolDock * ToolBar::GetDock | ( | ) |
Definition at line 630 of file ToolBar.cpp.
Referenced by ToolManager::DoneDragging(), ToolManager::Expose(), IsDocked(), ReCreateButtons(), ToolManager::Reset(), Updated(), and ToolManager::WriteConfig().
|
inlinevirtual |
Reimplemented in MeterToolBar, and TimeToolBar.
Definition at line 146 of file ToolBar.h.
Referenced by ToolDock::Dock(), and ToolFrame::ToolFrame().
|
inlinevirtual |
Resizable toolbars should implement these.
Reimplemented in DeviceToolBar, MeterToolBar, MixerToolBar, TimeToolBar, and TranscriptionToolBar.
Definition at line 144 of file ToolBar.h.
Referenced by SetToDefaultSize().
TranslatableString ToolBar::GetLabel | ( | ) |
Definition at line 374 of file ToolBar.cpp.
References mLabel.
Referenced by Create(), and GetTitle().
|
inlinevirtual |
Reimplemented in DeviceToolBar, MeterToolBar, MixerToolBar, TimeToolBar, and TranscriptionToolBar.
Definition at line 145 of file ToolBar.h.
Referenced by ReCreateButtons().
|
protected |
Returns the width in pixels of the resizer element.
Definition at line 1004 of file ToolBar.cpp.
References RWIDTH.
wxString ToolBar::GetSection | ( | ) |
Definition at line 382 of file ToolBar.cpp.
References mSection.
Referenced by ToolManager::ReadConfig(), and ToolManager::WriteConfig().
|
protected |
Definition at line 678 of file ToolBar.cpp.
References mHSizer.
Referenced by AudioSetupToolBar::ArrangeButtons(), ControlToolBar::ArrangeButtons(), MeterToolBar::OnSize(), TimeToolBar::OnSize(), and TimeToolBar::SetResizingLimits().
wxSize ToolBar::GetSmartDockedSize | ( | ) |
Definition at line 503 of file ToolBar.cpp.
References toolbarGap, and toolbarSingle.
Referenced by MeterToolBar::GetDockedSize().
TranslatableString ToolBar::GetTitle | ( | ) |
Definition at line 365 of file ToolBar.cpp.
References GetLabel(), and XO.
Referenced by Create(), SetDocked(), and UpdatePrefs().
int ToolBar::GetType | ( | ) |
Definition at line 390 of file ToolBar.cpp.
References mType.
Referenced by ToolDock::VisitLayout().
|
private |
bool ToolBar::IsDocked | ( | ) | const |
Definition at line 423 of file ToolBar.cpp.
References GetDock().
Referenced by Expose(), ToolManager::Expose(), ToolManager::IsVisible(), ToolManager::OnGrabber(), ToolFrame::OnMotion(), ReCreateButtons(), ToolManager::Reset(), TimeToolBar::SetResizingLimits(), Updated(), and ToolManager::WriteConfig().
|
inline |
Definition at line 138 of file ToolBar.h.
Referenced by Expose(), and ToolManager::WriteConfig().
bool ToolBar::IsResizable | ( | ) | const |
Definition at line 415 of file ToolBar.cpp.
References mResizable.
Referenced by ToolFrame::OnMotion(), ToolFrame::OnPaint(), ReCreateButtons(), ToolManager::Reset(), and ToolFrame::ToolFrame().
bool ToolBar::IsVisible | ( | ) | const |
Definition at line 431 of file ToolBar.cpp.
References mVisible.
Referenced by ToolDock::Dock(), ToolManager::IsVisible(), and ToolBarConfiguration::Write().
|
static |
Definition at line 922 of file ToolBar.cpp.
References ThemeBase::Image(), OverlayImage(), AButton::SetAlternateImages(), size, and theTheme.
Referenced by ControlToolBar::MakeAlternateImages(), TranscriptionToolBar::MakeAlternateImages(), and AdornedRulerPanel::ReCreateButtons().
|
static |
parent | Parent window for the button. |
eEnabledUp | Background for when button is Up. |
eEnabledDown | Background for when button is Down. |
eDisabled | Foreground when disabled. |
id | Windows Id. |
processdownevents | true iff button handles down events. |
label | Button label |
Definition at line 893 of file ToolBar.cpp.
References ThemeBase::ImageSize(), label, MakeButton(), AButton::SetFocusRect(), AButton::SetLabel(), and theTheme.
|
static |
Makes a button and its four different state bitmaps
parent | Parent window for the button. |
eUp | Background for when button is Up. |
eDown | Background for when button is Down. |
eHilite | Background for when button is Hilit. |
eStandardUp | Foreground when enabled, up. |
eStandardDown | Foreground when enabled, down. |
eDisabled | Foreground when disabled. |
id | Windows Id. |
placement | Placement position |
processdownevents | true iff button handles down events. |
size | Size of the background. |
Definition at line 852 of file ToolBar.cpp.
References ThemeBase::Image(), OverlayImage(), safenew, size, and theTheme.
Referenced by EditToolBar::AddButton(), ScrubbingToolBar::AddButton(), TranscriptionToolBar::AddButton(), AudioSetupToolBar::MakeAudioSetupButton(), MakeButton(), ToolsToolBar::MakeTool(), ControlToolBar::Populate(), and AdornedRulerPanel::ReCreateButtons().
|
static |
Definition at line 788 of file ToolBar.cpp.
References gPrefs, MakeMacRecoloredImage(), and MakeRecoloredImage().
Referenced by ControlToolBar::Populate().
|
static |
Definition at line 814 of file ToolBar.cpp.
References gPrefs, MakeMacRecoloredImage(), and MakeRecoloredImage().
Referenced by EditToolBar::Populate(), ScrubbingToolBar::Populate(), ToolsToolBar::Populate(), TranscriptionToolBar::Populate(), and AdornedRulerPanel::ReCreateButtons().
Definition at line 765 of file ToolBar.cpp.
References ThemeBase::Image(), ThemeBase::ReplaceImage(), and theTheme.
Referenced by MakeButtonBackgroundsLarge(), MakeButtonBackgroundsSmall(), MakeMacRecoloredImageSize(), and MakeRecoloredImage().
|
staticprotected |
Definition at line 770 of file ToolBar.cpp.
References ThemeBase::Image(), MakeMacRecoloredImage(), size, and theTheme.
Referenced by AudioSetupToolBar::MakeAudioSetupButton().
Definition at line 776 of file ToolBar.cpp.
References MakeMacRecoloredImage().
Referenced by MakeButtonBackgroundsLarge(), MakeButtonBackgroundsSmall(), and MakeRecoloredImageSize().
|
staticprotected |
Definition at line 782 of file ToolBar.cpp.
References ThemeBase::Image(), MakeRecoloredImage(), size, and theTheme.
Referenced by AudioSetupToolBar::MakeAudioSetupButton().
|
protected |
Definition at line 978 of file ToolBar.cpp.
|
protected |
Definition at line 997 of file ToolBar.cpp.
|
protected |
Definition at line 986 of file ToolBar.cpp.
References ThemeBase::Colour(), Repaint(), and theTheme.
|
protectedpure virtual |
Implemented in AudioSetupToolBar, ControlToolBar, DeviceToolBar, EditToolBar, MeterToolBar, MixerToolBar, ScrubbingToolBar, SelectionBar, SpectralSelectionBar, TimeToolBar, ToolsToolBar, and TranscriptionToolBar.
Referenced by ReCreateButtons().
|
virtual |
Reimplemented in AudioSetupToolBar, ControlToolBar, and MeterToolBar.
Definition at line 516 of file ToolBar.cpp.
References _, GetDock(), GetMinToolbarWidth(), IsDocked(), IsResizable(), mGrabber, mHSizer, mResizer, mType, Populate(), safenew, SetDocked(), toolbarGap, ToolBarResizer, and toolbarSingle.
Referenced by Create(), ProjectWindow::OnThemeChange(), SelectionBar::OnUpdate(), AudioSetupToolBar::ReCreateButtons(), ControlToolBar::ReCreateButtons(), MeterToolBar::ReCreateButtons(), and ToolManager::Reset().
|
pure virtual |
|
protectedpure virtual |
Implemented in AudioSetupToolBar, and ControlToolBar.
Referenced by OnPaint().
|
inlinevirtual |
Reimplemented in TimeToolBar.
Definition at line 197 of file ToolBar.h.
Referenced by ToolBarResizer::OnLeftUp(), and ToolManager::ReadConfig().
|
protected |
Definition at line 963 of file ToolBar.cpp.
References AButton::PopUp(), and AButton::PushDown().
|
static |
Definition at line 946 of file ToolBar.cpp.
References CommandManager::Get(), and AButton::SetToolTip().
Referenced by ScrubbingToolBar::DoRegenerateTooltips(), EditToolBar::ForAllButtons(), AudioSetupToolBar::RegenerateTooltips(), ControlToolBar::RegenerateTooltips(), ToolsToolBar::RegenerateTooltips(), TranscriptionToolBar::RegenerateTooltips(), and AdornedRulerPanel::UpdateButtonStates().
|
virtual |
Reimplemented in MeterToolBar, and TimeToolBar.
Definition at line 638 of file ToolBar.cpp.
References GetTitle(), mGrabber, mResizer, Grabber::PushButton(), and Grabber::SetToolTip().
Referenced by ToolDock::Dock(), ToolManager::DoneDragging(), ToolManager::HandleEscapeKey(), ToolManager::OnMouse(), ToolManager::ReadConfig(), ReCreateButtons(), ToolManager::Reset(), MeterToolBar::SetDocked(), TimeToolBar::SetDocked(), ToolFrame::ToolFrame(), and ToolManager::UndockBar().
void ToolBar::SetLabel | ( | const TranslatableString & | label | ) |
|
overrideprivate |
Definition at line 398 of file ToolBar.cpp.
References label, mLabel, and Verbatim().
Referenced by AudioSetupToolBar::UpdatePrefs(), ControlToolBar::UpdatePrefs(), DeviceToolBar::UpdatePrefs(), EditToolBar::UpdatePrefs(), MeterToolBar::UpdatePrefs(), MixerToolBar::UpdatePrefs(), ScrubbingToolBar::UpdatePrefs(), SelectionBar::UpdatePrefs(), TimeToolBar::UpdatePrefs(), and TranscriptionToolBar::UpdatePrefs().
|
inline |
Definition at line 140 of file ToolBar.h.
Referenced by Expose(), ToolManager::ReadConfig(), and ToolManager::UndockBar().
|
virtual |
Reimplemented in TimeToolBar.
Definition at line 496 of file ToolBar.cpp.
References GetInitialWidth().
Referenced by ToolManager::Reset().
void ToolBar::SetVisible | ( | bool | bVisible | ) |
Definition at line 436 of file ToolBar.cpp.
References mVisible.
Referenced by Expose(), and ToolManager::ReadConfig().
|
protected |
Definition at line 661 of file ToolBar.cpp.
References GetDock(), IsDocked(), and ToolDock::Updated().
Referenced by SelectionBar::OnUpdate(), TimeToolBar::OnUpdate(), ToolBarResizer::ResizeBar(), TimeToolBar::ResizingDone(), SelectionBar::SelectionModeUpdated(), TimeToolBar::SetDocked(), TimeToolBar::SetToDefaultSize(), ControlToolBar::UpdatePrefs(), and MixerToolBar::UpdatePrefs().
|
overridevirtual |
Implements PrefsListener.
Reimplemented in ToolsToolBar, and TranscriptionToolBar.
Definition at line 605 of file ToolBar.cpp.
References _, GetTitle(), mGrabber, mResizer, and Grabber::SetToolTip().
Referenced by AudioSetupToolBar::UpdatePrefs(), ControlToolBar::UpdatePrefs(), DeviceToolBar::UpdatePrefs(), EditToolBar::UpdatePrefs(), MeterToolBar::UpdatePrefs(), MixerToolBar::UpdatePrefs(), ScrubbingToolBar::UpdatePrefs(), SelectionBar::UpdatePrefs(), TimeToolBar::UpdatePrefs(), ToolsToolBar::UpdatePrefs(), and TranscriptionToolBar::UpdatePrefs().
|
friend |
Definition at line 271 of file ToolBar.h.
Referenced by ReCreateButtons().
|
private |
Definition at line 257 of file ToolBar.h.
Referenced by ReCreateButtons(), SetDocked(), and UpdatePrefs().
|
private |
Definition at line 260 of file ToolBar.h.
Referenced by Add(), AddSpacer(), AddStretchSpacer(), Detach(), GetSizer(), and ReCreateButtons().
|
protected |
Definition at line 249 of file ToolBar.h.
Referenced by GetLabel(), and SetLabel().
|
private |
|
protected |
Definition at line 248 of file ToolBar.h.
Referenced by ScrubbingToolBar::DoRegenerateTooltips(), ToolsToolBar::DoToolChanged(), ControlToolBar::EnableDisableButtons(), DeviceToolBar::EnableDisableButtons(), ScrubbingToolBar::EnableDisableButtons(), TranscriptionToolBar::EnableDisableButtons(), MeterToolBar::Expose(), EditToolBar::ForAllButtons(), TranscriptionToolBar::GetSamples(), MixerToolBar::OnAudioCapture(), EditToolBar::OnButton(), ScrubbingToolBar::OnButton(), ControlToolBar::OnFF(), ControlToolBar::OnIdle(), SelectionBar::OnIdle(), TimeToolBar::OnIdle(), ControlToolBar::OnKeyEvent(), ControlToolBar::OnLoop(), AudioSetupToolBar::OnMenu(), ControlToolBar::OnPause(), ControlToolBar::OnPlay(), ControlToolBar::OnRecord(), ControlToolBar::OnRewind(), ControlToolBar::OnStop(), ToolsToolBar::OnTool(), ToolsToolBar::OnToolChanged(), TranscriptionToolBar::PlayAtSpeed(), ControlToolBar::PlayDefault(), MeterToolBar::Populate(), TimeToolBar::Populate(), MeterToolBar::ReCreateButtons(), AudioSetupToolBar::RegenerateTooltips(), ControlToolBar::RegenerateTooltips(), ToolsToolBar::RegenerateTooltips(), TranscriptionToolBar::RegenerateTooltips(), TranscriptionToolBar::SetPlaySpeed(), ControlToolBar::StartScrolling(), ControlToolBar::StartScrollingIfPreferred(), ControlToolBar::StateForStatusBar(), ControlToolBar::StopScrolling(), and ControlToolBar::UpdateStatusBar().
|
private |
Definition at line 263 of file ToolBar.h.
Referenced by IsResizable().
|
private |
Definition at line 258 of file ToolBar.h.
Referenced by ReCreateButtons(), SetDocked(), and UpdatePrefs().
|
protected |
Definition at line 250 of file ToolBar.h.
Referenced by GetSection().
|
protected |
|
private |
Definition at line 262 of file ToolBar.h.
Referenced by Create(), Expose(), IsVisible(), and SetVisible().