Audacity 3.2.0
|
#include <TimeToolBar.h>
Public Member Functions | |
TimeToolBar (AudacityProject &project) | |
virtual | ~TimeToolBar () |
DockID | DefaultDockID () const override |
Which dock the toolbar defaults into. Default implementation chooses the top dock. More... | |
void | Populate () override |
void | Repaint (wxDC *WXUNUSED(dc)) override |
void | EnableDisableButtons () override |
void | UpdatePrefs () override |
void | RegenerateTooltips () override |
int | GetInitialWidth () override |
Resizable toolbars should implement these. More... | |
int | GetMinToolbarWidth () override |
void | SetToDefaultSize () override |
wxSize | GetDockedSize () override |
void | SetDocked (ToolDock *dock, bool pushed) override |
void | SetAudioTimeFormat (const NumericFormatID &format) |
void | ResizingDone () override |
Public Member Functions inherited from ToolBar | |
ToolBar (AudacityProject &project, const TranslatableString &label, const Identifier §ion, bool resizable=false) | |
virtual | ~ToolBar () |
virtual bool | ShownByDefault () const |
Whether the toolbar should be shown by default. Default implementation returns true. More... | |
virtual bool | HideAfterReset () const |
Default implementation returns false. More... | |
virtual DockID | DefaultDockID () const |
Which dock the toolbar defaults into. Default implementation chooses the top dock. More... | |
bool | AcceptsFocus () const override |
bool | AcceptsFocusFromKeyboard () 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 | GetIndex () const |
Get a value used for computing cascading positions of undocked bars. More... | |
void | SetIndex (int index) |
Set a value used for computing cascading positions of undocked bars. More... | |
TranslatableString | GetTitle () |
TranslatableString | GetLabel () |
Identifier | GetSection () |
ToolDock * | GetDock () |
void | SetPreferredNeighbors (Identifier left, Identifier top={}) |
void | SetLabel (const TranslatableString &label) |
virtual void | SetDocked (ToolDock *dock, bool pushed) |
std::pair< Identifier, Identifier > | PreferredNeighbors () const noexcept |
Defaults to (NoBarID, NoBarId) More... | |
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 () |
Public Member Functions inherited from wxPanelWrapper | |
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 () |
Public Member Functions inherited from wxTabTraversalWrapper< wxPanel > | |
wxTabTraversalWrapper (Args &&... args) | |
wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete | |
wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete | |
wxTabTraversalWrapper & | operator= (const wxTabTraversalWrapper &)=delete |
wxTabTraversalWrapper & | operator= (wxTabTraversalWrapper &&)=delete |
Static Public Member Functions | |
static Identifier | ID () |
static TimeToolBar & | Get (AudacityProject &project) |
static const TimeToolBar & | Get (const AudacityProject &project) |
Static Public Member Functions inherited from ToolBar | |
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 () |
Private Member Functions | |
void | SetResizingLimits () |
wxSize | ComputeSizing (int digitH) |
void | OnFormatsChanged (ProjectNumericFormatsEvent) |
void | OnUpdate (wxCommandEvent &evt) |
void | OnSize (wxSizeEvent &evt) |
void | OnIdle (wxIdleEvent &evt) |
Private Attributes | |
NumericTextCtrl * | mAudioTime |
float | mDigitRatio |
bool | mSettingInitialSize = true |
Observer::Subscription | mFormatChangedToFitValueSubscription |
Observer::Subscription | mFormatsSubscription |
Static Private Attributes | |
static const int | minDigitH = 17 |
static const int | maxDigitH = 100 |
Additional Inherited Members | |
Public Types inherited from ToolBar | |
enum | DockID { TopDockID = 1 , BotDockID = 2 } |
Identifies one of the docking areas for toolbars. More... | |
using | Holder = wxWindowPtr< ToolBar > |
Protected Member Functions inherited from ToolBar | |
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) |
Protected Member Functions inherited from PrefsListener | |
virtual void | UpdateSelectedPrefs (int id) |
PrefsListener () | |
virtual | ~PrefsListener () |
virtual void | UpdatePrefs ()=0 |
Static Protected Member Functions inherited from ToolBar | |
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 Protected Member Functions inherited from PrefsListener | |
static void | Broadcast (int id=0) |
Call this static function to notify all PrefsListener objects. More... | |
Protected Attributes inherited from ToolBar | |
AudacityProject & | mProject |
TranslatableString | mLabel |
Identifier | mSection |
int | mIndex {0} |
Definition at line 23 of file TimeToolBar.h.
TimeToolBar::TimeToolBar | ( | AudacityProject & | project | ) |
Definition at line 58 of file TimeToolBar.cpp.
References ProjectNumericFormats::Get(), mFormatsSubscription, OnFormatsChanged(), project, and Observer::Publisher< Message, NotifyAll >::Subscribe().
|
virtual |
Definition at line 66 of file TimeToolBar.cpp.
|
private |
Definition at line 391 of file TimeToolBar.cpp.
References NumericTextCtrl::ComputeSizing(), mAudioTime, and mDigitRatio.
Referenced by OnSize(), and SetResizingLimits().
|
overridevirtual |
Which dock the toolbar defaults into. Default implementation chooses the top dock.
Reimplemented from ToolBar.
Definition at line 70 of file TimeToolBar.cpp.
References ToolBar::BotDockID.
|
inlineoverridevirtual |
|
static |
Definition at line 75 of file TimeToolBar.cpp.
References ToolManager::Get(), ID(), and project.
Referenced by Get().
|
static |
Definition at line 81 of file TimeToolBar.cpp.
References Get(), and project.
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 166 of file TimeToolBar.cpp.
References toolbarGap, and toolbarSingle.
|
inlineoverridevirtual |
Resizable toolbars should implement these.
Reimplemented from ToolBar.
Definition at line 41 of file TimeToolBar.h.
Referenced by SetToDefaultSize().
|
inlineoverridevirtual |
|
static |
|
private |
Definition at line 277 of file TimeToolBar.cpp.
References ProjectNumericFormatsEvent::ChangedAudioTimeFormat, ProjectNumericFormats::Get(), ToolBar::mProject, SetAudioTimeFormat(), settings(), and ProjectNumericFormatsEvent::type.
Referenced by TimeToolBar().
|
private |
Definition at line 372 of file TimeToolBar.cpp.
References AudioIO::Get(), ProjectAudioIO::Get(), ViewInfo::Get(), PlayRegion::GetStart(), mAudioTime, ToolBar::mProject, ViewInfo::playRegion, and NumericTextCtrl::SetValue().
|
private |
Definition at line 326 of file TimeToolBar.cpp.
References ComputeSizing(), NumericTextCtrl::GetDigitSize(), NumericTextCtrl::GetDimensions(), ToolBar::GetSizer(), mAudioTime, mDigitRatio, minDigitH, and NumericTextCtrl::SetDigitSize().
Referenced by Populate().
|
private |
Definition at line 291 of file TimeToolBar.cpp.
References ProjectNumericFormats::Get(), ToolBar::mProject, mSettingInitialSize, ToolBar::ReCreateButtons(), SetResizingLimits(), and ToolBar::Updated().
Referenced by Populate(), SetAudioTimeFormat(), and UpdatePrefs().
|
overridevirtual |
Implements ToolBar.
Definition at line 86 of file TimeToolBar.cpp.
References ToolBar::Add(), AudioPositionID, BasicUI::CallAfter(), anonymous_namespace{ExportPCM.cpp}::format, Identifier::GET(), ProjectNumericFormats::Get(), NumericTextCtrl::GetDigitSize(), NumericConverter::GetFormatName(), mAudioTime, mDigitRatio, mFormatChangedToFitValueSubscription, ToolBar::mProject, mSettingInitialSize, NumericConverterType_TIME(), OnSize(), OnUpdate(), FormatterContext::ProjectContext(), safenew, SetAudioTimeFormat(), NumericTextCtrl::SetName(), NumericTextCtrl::SetReadOnly(), Observer::Publisher< Message, NotifyAll >::Subscribe(), toolbarSpacing, and XO().
|
inlineoverridevirtual |
|
inlineoverride |
Definition at line 37 of file TimeToolBar.h.
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 220 of file TimeToolBar.cpp.
References ToolBar::Updated().
void TimeToolBar::SetAudioTimeFormat | ( | const NumericFormatID & | format | ) |
Definition at line 207 of file TimeToolBar.cpp.
References anonymous_namespace{ExportPCM.cpp}::format, mAudioTime, OnUpdate(), and NumericTextCtrl::SetFormatName().
Referenced by OnFormatsChanged(), Populate(), and SetToDefaultSize().
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 182 of file TimeToolBar.cpp.
References mSettingInitialSize, ToolBar::SetDocked(), SetResizingLimits(), and ToolBar::Updated().
|
private |
Definition at line 229 of file TimeToolBar.cpp.
References ComputeSizing(), ToolBar::GetSizer(), ToolBar::IsDocked(), mAudioTime, maxDigitH, minDigitH, outer, and toolbarSingle.
Referenced by OnUpdate(), and SetDocked().
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 149 of file TimeToolBar.cpp.
References GetInitialWidth(), NumericConverterFormats::HoursMinsSecondsFormat(), Internal, SetAudioTimeFormat(), and ToolBar::Updated().
|
overridevirtual |
Implements PrefsListener.
Definition at line 134 of file TimeToolBar.cpp.
References Identifier::GET(), NumericConverter::GetFormatName(), mAudioTime, OnUpdate(), ToolBar::SetLabel(), ToolBar::UpdatePrefs(), and XO().
|
private |
Definition at line 57 of file TimeToolBar.h.
Referenced by ComputeSizing(), OnIdle(), OnSize(), Populate(), SetAudioTimeFormat(), SetResizingLimits(), and UpdatePrefs().
|
staticprivate |
Definition at line 62 of file TimeToolBar.h.
Referenced by SetResizingLimits().
|
private |
Definition at line 58 of file TimeToolBar.h.
Referenced by ComputeSizing(), OnSize(), and Populate().
|
private |
Definition at line 64 of file TimeToolBar.h.
Referenced by Populate().
|
private |
Definition at line 65 of file TimeToolBar.h.
Referenced by TimeToolBar().
|
staticprivate |
Definition at line 61 of file TimeToolBar.h.
Referenced by OnSize(), and SetResizingLimits().
|
private |
Definition at line 59 of file TimeToolBar.h.
Referenced by OnUpdate(), Populate(), and SetDocked().