![]() |
Audacity 3.2.0
|
A kind of ToolBar with Tools on it. More...
#include <ToolsToolBar.h>
Public Member Functions | |
ToolsToolBar (AudacityProject &project) | |
virtual | ~ToolsToolBar () |
void | UpdatePrefs () override |
void | OnTool (wxCommandEvent &evt) |
void | OnToolChanged (wxCommandEvent &evt) |
void | DoToolChanged () |
void | Populate () override |
void | Repaint (wxDC *WXUNUSED(dc)) override |
void | EnableDisableButtons () override |
![]() | |
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 () |
![]() | |
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 Identifier | ID () |
static ToolsToolBar & | Get (AudacityProject &project) |
static const ToolsToolBar & | Get (const AudacityProject &project) |
![]() | |
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 Types | |
enum | { numTools = 4 } |
Private Member Functions | |
void | Create (wxWindow *parent) override |
void | RegenerateTooltips () override |
wxImage * | MakeToolImage (wxImage *tool, wxImage *mask, int style) |
Static Private Member Functions | |
static AButton * | MakeTool (ToolsToolBar *pBar, teBmps eTool, int id, const TranslatableString &label) |
Private Attributes | |
AButton * | mTool [numTools] |
wxGridSizer * | mToolSizer |
int | mCurrentTool |
Additional Inherited Members | |
![]() | |
enum | DockID { TopDockID = 1 , BotDockID = 2 } |
Identifies one of the docking areas for toolbars. More... | |
using | Holder = wxWindowPtr< 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) |
![]() | |
virtual void | UpdateSelectedPrefs (int id) |
PrefsListener () | |
virtual | ~PrefsListener () |
virtual void | UpdatePrefs ()=0 |
![]() | |
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... | |
![]() | |
AudacityProject & | mProject |
TranslatableString | mLabel |
Identifier | mSection |
int | mIndex {0} |
A kind of ToolBar with Tools on it.
This class, which is a child of Toolbar, creates the window containing the tool selection (ibeam, envelope, move, zoom). The window can be embedded within a normal project window, or within a ToolBarFrame.
All of the controls in this window were custom-written for Audacity - they are not native controls on any platform - however, it is intended that the images could be easily replaced to allow "skinning" or just customization to match the look and feel of each platform.
Definition at line 35 of file ToolsToolBar.h.
|
private |
ToolsToolBar::ToolsToolBar | ( | AudacityProject & | project | ) |
Definition at line 78 of file ToolsToolBar.cpp.
References ToolCodes::drawTool, ToolCodes::envelopeTool, ToolCodes::firstTool, gPrefs, mCurrentTool, ToolCodes::multiTool, OnToolChanged(), ToolCodes::selectTool, and wxT().
|
virtual |
Definition at line 100 of file ToolsToolBar.cpp.
References ToolCodes::numTools, and numTools.
|
overrideprivatevirtual |
Reimplemented from ToolBar.
Definition at line 250 of file ToolsToolBar.cpp.
References ToolBar::Create(), and UpdatePrefs().
void ToolsToolBar::DoToolChanged | ( | ) |
Definition at line 234 of file ToolsToolBar.cpp.
References ToolCodes::firstTool, FileConfig::Flush(), ProjectSettings::Get(), gPrefs, mCurrentTool, ToolBar::mProject, mTool, ToolCodes::multiTool, numTools, AButton::PopUp(), AButton::PushDown(), and wxT().
Referenced by OnToolChanged(), and Populate().
|
inlineoverridevirtual |
|
static |
Definition at line 107 of file ToolsToolBar.cpp.
References ToolManager::Get(), and ID().
Referenced by Get(), and anonymous_namespace{ToolsToolBar.cpp}::SetTool().
|
static |
Definition at line 113 of file ToolsToolBar.cpp.
References Get().
|
static |
|
staticprivate |
Definition at line 175 of file ToolsToolBar.cpp.
References FirstToolID, ThemeBase::ImageSize(), label, ToolBar::MakeButton(), mToolSizer, AButton::SetLabel(), and theTheme.
Referenced by Populate().
void ToolsToolBar::OnTool | ( | wxCommandEvent & | evt | ) |
Definition at line 213 of file ToolsToolBar.cpp.
References ToolCodes::firstTool, FirstToolID, ProjectSettings::Get(), ToolBar::mProject, mTool, and ProjectSettings::SetTool().
void ToolsToolBar::OnToolChanged | ( | wxCommandEvent & | evt | ) |
Definition at line 225 of file ToolsToolBar.cpp.
References ProjectSettings::ChangedTool, DoToolChanged(), ProjectWindow::Get(), ToolBar::mProject, and ProjectWindow::RedrawProject().
Referenced by ToolsToolBar().
|
overridevirtual |
Implements ToolBar.
Definition at line 194 of file ToolsToolBar.cpp.
References ToolBar::Add(), ThemeBase::Colour(), DoToolChanged(), ToolCodes::drawTool, ToolCodes::envelopeTool, ToolBar::MakeButtonBackgroundsSmall(), MakeTool(), mTool, mToolSizer, ToolCodes::multiTool, RegenerateTooltips(), safenew, ToolCodes::selectTool, theTheme, and XO().
|
overrideprivatevirtual |
Implements ToolBar.
Definition at line 118 of file ToolsToolBar.cpp.
References ToolCodes::drawTool, entry, ToolCodes::envelopeTool, ToolBar::mProject, mTool, ToolCodes::multiTool, ToolCodes::selectTool, ToolBar::SetButtonToolTip(), wxT(), and XO().
Referenced by Populate(), and UpdatePrefs().
|
inlineoverride |
Definition at line 53 of file ToolsToolBar.h.
|
overridevirtual |
Reimplemented from ToolBar.
Definition at line 169 of file ToolsToolBar.cpp.
References RegenerateTooltips(), and ToolBar::UpdatePrefs().
Referenced by Create().
|
private |
Definition at line 66 of file ToolsToolBar.h.
Referenced by DoToolChanged(), and ToolsToolBar().
Definition at line 64 of file ToolsToolBar.h.
Referenced by DoToolChanged(), OnTool(), Populate(), and RegenerateTooltips().
|
private |
Definition at line 65 of file ToolsToolBar.h.
Referenced by MakeTool(), and Populate().