Audacity  2.2.0
ToolBar Class Referenceabstract

Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed. More...

#include <ToolBar.h>

Inheritance diagram for ToolBar:
wxTabTraversalWrapper< Base > ControlToolBar DeviceToolBar EditToolBar MeterToolBar MixerToolBar ScrubbingToolBar SelectionBar SpectralSelectionBar ToolsToolBar TranscriptionToolBar

Public Types

using Holder = Destroy_ptr< ToolBar >
 

Public Member Functions

 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 EnableDisableButtons ()=0
 
virtual void ReCreateButtons ()
 
virtual void UpdatePrefs ()
 
virtual void RegenerateTooltips ()=0
 
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 this. More...
 
virtual int GetMinToolbarWidth ()
 
virtual wxSize GetDockedSize ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< Base >
template<typename... Args>
 wxTabTraversalWrapper (Args &&...args)
 
 ~wxTabTraversalWrapper ()
 

Static Public Member Functions

static AButtonMakeButton (wxWindow *parent, teBmps eUp, teBmps eDown, teBmps eHilite, 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 eStandardUp, teBmps eStandardDown, teBmps eDisabled, wxSize size)
 
static void SetButtonToolTip (AButton &button, const std::vector< wxString > &commands)
 

Protected Member Functions

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 Populate ()=0
 
virtual void Repaint (wxDC *dc)=0
 
void OnErase (wxEraseEvent &event)
 
void OnPaint (wxPaintEvent &event)
 
void OnMouseEvents (wxMouseEvent &event)
 

Protected Attributes

wxString mLabel
 
wxString mSection
 
int mType
 

Private Member Functions

void Init (wxWindow *parent, int type, const wxString &title, const wxString &label)
 

Private Attributes

wxWindow * mParent
 
GrabbermGrabber
 
ToolBarResizermResizer
 
wxBoxSizer * mHSizer
 
wxSizerItem * mSpacer
 
bool mVisible
 
bool mResizable
 
bool mPositioned
 

Friends

class ToolBarResizer
 

Detailed Description

Works with ToolManager and ToolDock to provide a dockable window in which buttons can be placed.

Member Typedef Documentation

Constructor & Destructor Documentation

ToolBar::ToolBar ( int  type,
const wxString &  label,
const wxString &  section,
bool  resizable = false 
)

References label.

ToolBar::~ToolBar ( )
virtual

Member Function Documentation

bool ToolBar::AcceptsFocus ( ) const
inlineoverride
void ToolBar::Add ( wxWindow *  window,
int  proportion = 0,
int  flag = wxALIGN_TOP,
int  border = 0,
wxObject *  userData = NULL 
)
protected
void ToolBar::Add ( wxSizer *  sizer,
int  proportion = 0,
int  flag = 0,
int  border = 0,
wxObject *  userData = NULL 
)
protected

References mHSizer.

void ToolBar::Add ( int  width,
int  height,
int  proportion = 0,
int  flag = 0,
int  border = 0,
wxObject *  userData = NULL 
)
protected

References mHSizer.

void ToolBar::AddSpacer ( int  size = 14)
protected

References mHSizer.

Referenced by EditToolBar::AddSeparator().

void ToolBar::AddStretchSpacer ( int  prop = 1)
protected

References mHSizer.

void ToolBar::Detach ( wxWindow *  window)
protected
void ToolBar::Detach ( wxSizer *  sizer)
protected

References mHSizer.

bool ToolBar::Expose ( bool  show = true)
virtual
virtual wxSize ToolBar::GetDockedSize ( )
inlinevirtual

Reimplemented in MeterToolBar.

Referenced by ToolDock::Dock().

virtual int ToolBar::GetInitialWidth ( )
inlinevirtual

Resizable toolbars should implement this.

Reimplemented in MeterToolBar, and DeviceToolBar.

Referenced by GetMinToolbarWidth(), and ReCreateButtons().

wxString ToolBar::GetLabel ( )

References mLabel.

Referenced by Create(), and GetTitle().

virtual int ToolBar::GetMinToolbarWidth ( )
inlinevirtual

Reimplemented in MeterToolBar, and DeviceToolBar.

References GetInitialWidth().

Referenced by ReCreateButtons().

int ToolBar::GetResizeGrabberWidth ( )
protected

Returns the width in pixels of the resizer element.

References RWIDTH.

Referenced by DeviceToolBar::RepositionCombos().

wxString ToolBar::GetSection ( )
wxString ToolBar::GetTitle ( )

References _(), and GetLabel().

Referenced by Create(), SetDocked(), and UpdatePrefs().

int ToolBar::GetType ( )

References mType.

Referenced by ToolManager::ReadConfig(), and ToolDock::VisitLayout().

void ToolBar::Init ( wxWindow *  parent,
int  type,
const wxString &  title,
const wxString &  label 
)
private
bool ToolBar::IsPositioned ( )
inline

References mPositioned.

Referenced by Expose(), and ToolManager::WriteConfig().

bool ToolBar::IsResizable ( ) const
bool ToolBar::IsVisible ( ) const
void ToolBar::MakeAlternateImages ( AButton button,
int  idx,
teBmps  eUp,
teBmps  eDown,
teBmps  eHilite,
teBmps  eStandardUp,
teBmps  eStandardDown,
teBmps  eDisabled,
wxSize  size 
)
static
AButton * ToolBar::MakeButton ( wxWindow *  parent,
teBmps  eUp,
teBmps  eDown,
teBmps  eHilite,
teBmps  eStandardUp,
teBmps  eStandardDown,
teBmps  eDisabled,
wxWindowID  id,
wxPoint  placement,
bool  processdownevents,
wxSize  size 
)
static

Makes a button and its four different state bitmaps

Parameters
parentParent window for the button.
eUpBackground for when button is Up.
eDownBackground for when button is Down.
eHiliteBackground for when button is Hilit.
eStandardUpForeground when enabled, up.
eStandardDownForegrounde when enabled, down.
eDisabledForeground when disabled.
idWindows Id.
placementPlacement position
processdowneventstrue iff button handles down events.
sizeSize of the background.

References ThemeBase::Image(), OverlayImage(), safenew, and theTheme.

Referenced by ScrubbingToolBar::AddButton(), EditToolBar::AddButton(), TranscriptionToolBar::AddButton(), ControlToolBar::MakeButton(), ToolsToolBar::MakeTool(), SelectionBar::Populate(), and AdornedRulerPanel::ReCreateButtons().

void ToolBar::MakeButtonBackgroundsLarge ( )
protected
void ToolBar::MakeMacRecoloredImage ( teBmps  eBmpOut,
teBmps  eBmpIn 
)
protected
void ToolBar::MakeRecoloredImage ( teBmps  eBmpOut,
teBmps  eBmpIn 
)
protected
void ToolBar::OnErase ( wxEraseEvent &  event)
protected
void ToolBar::OnMouseEvents ( wxMouseEvent &  event)
protected
void ToolBar::OnPaint ( wxPaintEvent &  event)
protected
virtual void ToolBar::Populate ( )
protectedpure virtual
virtual void ToolBar::Repaint ( wxDC *  dc)
protectedpure virtual

Implemented in ControlToolBar.

Referenced by OnPaint().

void ToolBar::SetButton ( bool  down,
AButton button 
)
protected
void ToolBar::SetDock ( ToolDock dock)
void ToolBar::SetPositioned ( )
inline

References mPositioned.

Referenced by Expose(), and ToolManager::UndockBar().

void ToolBar::SetVisible ( bool  bVisible)

References mVisible.

Referenced by Expose().

Friends And Related Function Documentation

friend class ToolBarResizer
friend

Referenced by ReCreateButtons().

Member Data Documentation

Grabber* ToolBar::mGrabber
private
wxBoxSizer* ToolBar::mHSizer
private
wxString ToolBar::mLabel
protected

Referenced by GetLabel(), and SetLabel().

wxWindow* ToolBar::mParent
private

Referenced by Create().

bool ToolBar::mPositioned
private

Referenced by IsPositioned(), and SetPositioned().

bool ToolBar::mResizable
private

Referenced by IsResizable().

ToolBarResizer* ToolBar::mResizer
private
wxString ToolBar::mSection
protected

Referenced by GetSection().

wxSizerItem* ToolBar::mSpacer
private
int ToolBar::mType
protected
bool ToolBar::mVisible
private

Referenced by Create(), Expose(), IsVisible(), and SetVisible().


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