Audacity 3.2.0
|
(not quite a Toolbar) at foot of screen for setting and viewing the selection range. More...
#include <SelectionBar.h>
Public Types | |
enum class | SelectionMode { StartEnd , StartLength , LengthEnd , LengthCenter } |
Public Types inherited from ToolBar | |
enum | DockID { TopDockID = 1 , BotDockID = 2 } |
Identifies one of the docking areas for toolbars. More... | |
using | Holder = wxWindowPtr< ToolBar > |
Public Member Functions | |
SelectionBar (AudacityProject &project) | |
virtual | ~SelectionBar () |
bool | ShownByDefault () const override |
Whether the toolbar should be shown by default. Default implementation returns true. More... | |
DockID | DefaultDockID () const override |
Which dock the toolbar defaults into. Default implementation chooses the top dock. More... | |
void | Create (wxWindow *parent) override |
void | Populate () override |
void | Repaint (wxDC *WXUNUSED(dc)) override |
void | EnableDisableButtons () override |
void | UpdatePrefs () override |
void | SetTimes (double start, double end) |
void | SetSelectionFormat (const NumericFormatID &format) |
void | RegenerateTooltips () 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 SelectionBar & | Get (AudacityProject &project) |
static const SelectionBar & | 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 | |
AButton * | MakeSetupButton () |
void | AddTitle (const TranslatableString &Title, wxSizer *pSizer) |
void | AddTime (int id, wxSizer *pSizer) |
void | AddSelectionSetupButton (wxSizer *pSizer) |
void | SetSelectionMode (SelectionMode mode) |
void | ValuesToControls () |
void | OnUpdate (wxCommandEvent &evt) |
void | OnFocus (wxFocusEvent &event) |
void | OnCaptureKey (wxCommandEvent &event) |
void | OnSize (wxSizeEvent &evt) |
void | OnIdle (wxIdleEvent &evt) |
void | ModifySelection (int driver, bool done=false) |
void | SelectionModeUpdated () |
void | UpdateTimeControlsFormat (const NumericFormatID &format) |
void | FitToTimeControls () |
void | OnFormatsChanged (struct ProjectNumericFormatsEvent) |
Private Attributes | |
double | mRate |
double | mStart |
double | mEnd |
double | mLength |
double | mCenter |
SelectionMode | mSelectionMode {} |
SelectionMode | mLastSelectionMode {} |
std::array< NumericTextCtrl *, 2 > | mTimeControls {} |
AButton * | mSetupButton {} |
Observer::Subscription | mFormatChangedToFitValueSubscription [2] |
wxString | mLastValidText |
const Observer::Subscription | mFormatsSubscription |
Additional Inherited Members | |
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} |
(not quite a Toolbar) at foot of screen for setting and viewing the selection range.
Definition at line 37 of file SelectionBar.h.
|
strong |
Enumerator | |
---|---|
StartEnd | |
StartLength | |
LengthEnd | |
LengthCenter |
Definition at line 40 of file SelectionBar.h.
SelectionBar::SelectionBar | ( | AudacityProject & | project | ) |
Definition at line 129 of file SelectionBar.cpp.
References ProjectRate::Get(), ProjectRate::GetRate(), mRate, mSelectionMode, project, and anonymous_namespace{SelectionBar.cpp}::ReadSelectionMode().
|
virtual |
Definition at line 149 of file SelectionBar.cpp.
|
private |
Definition at line 239 of file SelectionBar.cpp.
References _, MakeSetupButton(), mSelectionMode, mSetupButton, BasicMenu::Handle::Popup(), SelectionModeUpdated(), and SetSelectionMode().
Referenced by Populate().
|
private |
Definition at line 213 of file SelectionBar.cpp.
References FitToTimeControls(), ProjectNumericFormats::Get(), id, mFormatChangedToFitValueSubscription, ModifySelection(), ToolBar::mProject, mTimeControls, NumericConverterType_TIME(), FormatterContext::ProjectContext(), and safenew.
Referenced by Populate().
|
private |
Definition at line 203 of file SelectionBar.cpp.
References ThemeBase::Colour(), safenew, and theTheme.
Referenced by Populate().
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 174 of file SelectionBar.cpp.
References ToolBar::Create(), and UpdatePrefs().
|
overridevirtual |
Which dock the toolbar defaults into. Default implementation chooses the top dock.
Reimplemented from ToolBar.
Definition at line 158 of file SelectionBar.cpp.
References ToolBar::BotDockID.
|
inlineoverridevirtual |
|
private |
Definition at line 642 of file SelectionBar.cpp.
References ToolBar::Updated().
Referenced by AddTime(), and SelectionModeUpdated().
|
static |
Definition at line 163 of file SelectionBar.cpp.
References ToolManager::Get(), ID(), and project.
Referenced by Get(), and ProjectSettings::UpdatePrefs().
|
static |
Definition at line 169 of file SelectionBar.cpp.
References Get(), and project.
|
static |
|
private |
Definition at line 180 of file SelectionBar.cpp.
References AButton::FrameButton, ThemeBase::Image(), safenew, AButton::SetButtonType(), theTheme, wxImage(), and XO().
Referenced by AddSelectionSetupButton().
|
private |
Definition at line 362 of file SelectionBar.cpp.
References details::end(), ProjectSelectionManager::Get(), LengthCenter, LengthEnd, manager, mCenter, mEnd, mLength, ToolBar::mProject, mSelectionMode, mStart, mTimeControls, StartEnd, and StartLength.
Referenced by AddTime().
|
private |
Definition at line 604 of file SelectionBar.cpp.
References BasicUI::FindFocus().
|
private |
Definition at line 599 of file SelectionBar.cpp.
References KeyboardCapture::OnFocus().
|
private |
Definition at line 588 of file SelectionBar.cpp.
References ProjectNumericFormatsEvent::ChangedSelectionFormat, ProjectNumericFormats::Get(), ToolBar::mProject, SetSelectionFormat(), and ProjectNumericFormatsEvent::type.
|
private |
Definition at line 496 of file SelectionBar.cpp.
References ViewInfo::Get(), ToolBar::mProject, ViewInfo::selectedRegion, and SetTimes().
|
private |
Definition at line 353 of file SelectionBar.cpp.
|
private |
Definition at line 454 of file SelectionBar.cpp.
References BasicUI::FindFocus(), anonymous_namespace{ExportPCM.cpp}::format, ProjectNumericFormats::Get(), ToolBar::mProject, mTimeControls, ToolBar::ReCreateButtons(), RegenerateTooltips(), ToolBar::Updated(), UpdateTimeControlsFormat(), and ValuesToControls().
Referenced by SetSelectionFormat(), and UpdatePrefs().
|
overridevirtual |
Implements ToolBar.
Definition at line 284 of file SelectionBar.cpp.
References ToolBar::Add(), AddSelectionSetupButton(), AddTime(), AddTitle(), BasicUI::CallAfter(), ThemeBase::Colour(), ProjectNumericFormats::Get(), ToolBar::mProject, mSelectionMode, mSetupButton, mTimeControls, RegenerateTooltips(), safenew, SetSelectionFormat(), SetSelectionMode(), theTheme, and XO().
|
overridevirtual |
Implements ToolBar.
Definition at line 349 of file SelectionBar.cpp.
Referenced by OnUpdate(), Populate(), and UpdatePrefs().
|
inlineoverride |
Definition at line 62 of file SelectionBar.h.
|
private |
Definition at line 504 of file SelectionBar.cpp.
References FitToTimeControls(), mSelectionMode, and anonymous_namespace{SelectionBar.cpp}::UpdateSelectionMode().
Referenced by AddSelectionSetupButton().
void SelectionBar::SetSelectionFormat | ( | const NumericFormatID & | format | ) |
Definition at line 573 of file SelectionBar.cpp.
References anonymous_namespace{ExportPCM.cpp}::format, mTimeControls, and OnUpdate().
Referenced by OnFormatsChanged(), and Populate().
|
private |
Definition at line 515 of file SelectionBar.cpp.
References anonymous_namespace{SelectionBar.cpp}::ModeNames, mSelectionMode, mTimeControls, UpdateTimeControlsFormat(), ValuesToControls(), and anonymous_namespace{SelectionBar.cpp}::WindowIDs.
Referenced by AddSelectionSetupButton(), and Populate().
void SelectionBar::SetTimes | ( | double | start, |
double | end | ||
) |
Definition at line 558 of file SelectionBar.cpp.
References details::end(), mCenter, mEnd, mLastSelectionMode, mLength, mSelectionMode, mStart, and ValuesToControls().
Referenced by OnIdle().
|
overridevirtual |
Whether the toolbar should be shown by default. Default implementation returns true.
Reimplemented from ToolBar.
Definition at line 153 of file SelectionBar.cpp.
|
overridevirtual |
Implements PrefsListener.
Definition at line 317 of file SelectionBar.cpp.
References gPrefs, Internal, NumericConverterFormats::Lookup(), ToolBar::mProject, mSelectionMode, NumericConverterType_TIME(), OnUpdate(), FormatterContext::ProjectContext(), audacity::BasicSettings::Read(), anonymous_namespace{SelectionBar.cpp}::ReadSelectionMode(), RegenerateTooltips(), ToolBar::SetLabel(), ToolBar::UpdatePrefs(), wxT(), and XO().
Referenced by Create().
|
private |
Definition at line 622 of file SelectionBar.cpp.
References anonymous_namespace{ExportPCM.cpp}::format, NumericConverterFormats::GetBestDurationFormat(), mSelectionMode, mTimeControls, NumericConverterType_DURATION(), and anonymous_namespace{SelectionBar.cpp}::TimeConverterType.
Referenced by OnUpdate(), and SetSelectionMode().
|
private |
Definition at line 537 of file SelectionBar.cpp.
References mCenter, mEnd, mLength, mSelectionMode, mStart, and mTimeControls.
Referenced by OnUpdate(), SetSelectionMode(), and SetTimes().
|
private |
Definition at line 98 of file SelectionBar.h.
Referenced by ModifySelection(), SetTimes(), and ValuesToControls().
|
private |
Definition at line 98 of file SelectionBar.h.
Referenced by ModifySelection(), SetTimes(), and ValuesToControls().
|
private |
Definition at line 106 of file SelectionBar.h.
Referenced by AddTime().
|
private |
Definition at line 109 of file SelectionBar.h.
|
private |
Definition at line 101 of file SelectionBar.h.
Referenced by SetTimes().
|
private |
Definition at line 108 of file SelectionBar.h.
|
private |
Definition at line 98 of file SelectionBar.h.
Referenced by ModifySelection(), SetTimes(), and ValuesToControls().
|
private |
Definition at line 97 of file SelectionBar.h.
Referenced by SelectionBar().
|
private |
Definition at line 100 of file SelectionBar.h.
Referenced by AddSelectionSetupButton(), ModifySelection(), Populate(), SelectionBar(), SelectionModeUpdated(), SetSelectionMode(), SetTimes(), UpdatePrefs(), UpdateTimeControlsFormat(), and ValuesToControls().
|
private |
Definition at line 104 of file SelectionBar.h.
Referenced by AddSelectionSetupButton(), and Populate().
|
private |
Definition at line 98 of file SelectionBar.h.
Referenced by ModifySelection(), SetTimes(), and ValuesToControls().
|
private |
Definition at line 103 of file SelectionBar.h.
Referenced by AddTime(), ModifySelection(), OnUpdate(), Populate(), SetSelectionFormat(), SetSelectionMode(), UpdateTimeControlsFormat(), and ValuesToControls().