Audacity  2.2.0
ToolsToolBar Class Referencefinal

A kind of ToolBar with Tools on it. More...

#include <ToolsToolBar.h>

Inheritance diagram for ToolsToolBar:
ToolBar wxTabTraversalWrapper< Base >

Public Member Functions

 ToolsToolBar ()
virtual ~ToolsToolBar ()
void UpdatePrefs () override
void OnTool (wxCommandEvent &evt)
void SetCurrentTool (int tool)
int GetCurrentTool () const
bool IsDown (int tool) const
int GetDownTool ()
void Populate () override
void Repaint (wxDC *WXUNUSED(dc)) override
void EnableDisableButtons () override
- Public Member Functions inherited from ToolBar
 ToolBar (int type, const wxString &label, const wxString &section, bool resizable=false)
virtual ~ToolBar ()
bool AcceptsFocus () const override
virtual void Create (wxWindow *parent)
virtual void ReCreateButtons ()
int GetType ()
wxString GetTitle ()
wxString GetLabel ()
wxString GetSection ()
ToolDockGetDock ()
void SetLabel (const wxString &label)
void SetDock (ToolDock *dock)
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 ()
- Public Member Functions inherited from wxTabTraversalWrapper< Base >
template<typename... Args>
 wxTabTraversalWrapper (Args &&...args)
 ~wxTabTraversalWrapper ()

Private Member Functions

void RegenerateTooltips () override
wxImage * MakeToolImage (wxImage *tool, wxImage *mask, int style)
AButtonMakeTool (teBmps eTool, int id, const wxChar *label)

Private Attributes

AButtonmTool [numTools]
wxGridSizer * mToolSizer
int mCurrentTool

Additional Inherited Members

- Public Types inherited from ToolBar
using Holder = Destroy_ptr< ToolBar >
- Static Public Member Functions inherited from ToolBar
static AButtonMakeButton (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 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 (AButton &button, const std::vector< wxString > &commands)
- Protected Member Functions inherited from ToolBar
void SetButton (bool down, AButton *button)
void MakeMacRecoloredImage (teBmps eBmpOut, teBmps eBmpIn)
void MakeRecoloredImage (teBmps eBmpOut, teBmps eBmpIn)
void MakeButtonBackgroundsLarge ()
void MakeButtonBackgroundsSmall ()
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 Repaint (wxDC *dc)=0
void OnErase (wxEraseEvent &event)
void OnPaint (wxPaintEvent &event)
void OnMouseEvents (wxMouseEvent &event)
- Protected Attributes inherited from ToolBar
wxString mLabel
wxString mSection
int mType

Detailed Description

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 that is managed by a global ToolBarStub called gToolsToolBarStub.

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.

See Also
Themability of Audacity

Constructor & Destructor Documentation

ToolsToolBar::ToolsToolBar ( )
ToolsToolBar::~ToolsToolBar ( )

Member Function Documentation

void ToolsToolBar::EnableDisableButtons ( )

Implements ToolBar.

int ToolsToolBar::GetCurrentTool ( ) const

Gets the currently active tool In Multi-mode this might not return the multi-tool itself since the active tool may be changed by what you hover over.

References mCurrentTool.

Referenced by Track::HitTest().

int ToolsToolBar::GetDownTool ( )
bool ToolsToolBar::IsDown ( int  tool) const
AButton * ToolsToolBar::MakeTool ( teBmps  eTool,
int  id,
const wxChar *  label 
wxImage* ToolsToolBar::MakeToolImage ( wxImage *  tool,
wxImage *  mask,
int  style 
void ToolsToolBar::OnTool ( wxCommandEvent &  evt)
void ToolsToolBar::RegenerateTooltips ( )
void ToolsToolBar::Repaint ( wxDC *  WXUNUSEDdc)
void ToolsToolBar::SetCurrentTool ( int  tool)

Sets the currently active tool

tool- The index of the tool to be used.

References gPrefs, IsDown(), mCurrentTool, mTool, multiTool, AButton::PopUp(), AButton::PushDown(), and RefreshCursorForAllProjects().

Referenced by AudacityProject::OnNextTool(), AudacityProject::OnPrevTool(), and AudacityProject::SetTool().

void ToolsToolBar::UpdatePrefs ( )

Reimplemented from ToolBar.

References RegenerateTooltips(), and ToolBar::UpdatePrefs().

Member Data Documentation

int ToolsToolBar::mCurrentTool
AButton* ToolsToolBar::mTool[numTools]
wxGridSizer* ToolsToolBar::mToolSizer

Referenced by MakeTool(), and Populate().

The documentation for this class was generated from the following files: