Audacity  2.2.0
ExpandingToolBar Class Referencefinal

A smart ToolBar class that has a "MainPanel" which is always displayed, and an "ExtraPanel" that can be hidden to save space. More...

#include <ExpandingToolBar.h>

Inheritance diagram for ExpandingToolBar:
wxTabTraversalWrapper< Base >

Public Member Functions

 ExpandingToolBar (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
 
virtual ~ExpandingToolBar ()
 
wxPanel * GetMainPanel ()
 
wxPanel * GetExtraPanel ()
 
void SetAutoExpand (bool enabled)
 
bool GetAutoExpand ()
 
void Expand ()
 
void Collapse (bool now=false)
 
bool IsExpanded ()
 
void OnSize (wxSizeEvent &evt)
 
void OnToggle (wxCommandEvent &evt)
 
void OnTimer (wxTimerEvent &evt)
 
void StartMoving ()
 
void UpdateMoving ()
 
void FinishMoving ()
 
bool Layout () override
 
void Fit () override
 
- Public Member Functions inherited from wxTabTraversalWrapper< Base >
template<typename... Args>
 wxTabTraversalWrapper (Args &&...args)
 
 ~wxTabTraversalWrapper ()
 

Protected Member Functions

void RecursivelyPushEventHandlers (wxWindow *win)
 
bool IsCursorInWindow ()
 
void ReparentExtraPanel ()
 
void MoveDrawer (wxSize prevSize)
 
wxBitmap GetToolbarBitmap ()
 
void TryAutoExpand ()
 
void TryAutoCollapse ()
 

Protected Attributes

wxPanel * mMainPanel
 
wxPanel * mExtraPanel
 
ToolBarGrabbermGrabber
 
AButtonmToggleButton
 
bool mIsAutoExpanded
 
bool mIsManualExpanded
 
bool mIsExpanded
 
bool mAutoExpand
 
bool mFirstTime
 
wxSize mMainSize
 
wxSize mExtraSize
 
wxSize mButtonSize
 
wxSize mGrabberSize
 
wxSize mCurrentDrawerSize
 
wxSize mTargetDrawerSize
 
wxSize mCurrentTotalSize
 
WindowHash mWindowHash
 
wxTimer mTimer
 
ToolBarFramemFrameParent
 
ToolBarDialogmDialogParent
 
ToolBarAreamAreaParent
 
std::unique_ptr
< ToolBarArrangement
mSavedArrangement
 
ImageRollPanelmTargetPanel
 
std::unique_ptr< wxDragImage > mDragImage
 
wxWindow * mTopLevelParent
 
wxArrayRect mDropTargets
 
wxRect mDropTarget
 
std::vector< movable_ptr
< ExpandingToolBarEvtHandler > > 
mHandlers
 

Static Protected Attributes

static int msNoAutoExpandStack = 0
 

Friends

class ExpandingToolBarEvtHandler
 

Detailed Description

A smart ToolBar class that has a "MainPanel" which is always displayed, and an "ExtraPanel" that can be hidden to save space.

Can be docked into a ToolBarArea or floated in an ToolBarFrame;

If auto-expanding is off, behavior is very simple: clicking the toggle button expands, clicking it again collapses.

If auto-expanding is on, behavior is a little more complicated. When the mouse movers over a toolbar and it is collapsed, it gets auto-expanded, and it gets auto-collapsed as soon as the mouse leaves. However, if they manually toggle it collapsed while it was auto-expanded, it will stay collapsed until you move the mouse completely away and then back again later. If you manually expand it, it will stay manually expanded until you manually collapse it.

Constructor & Destructor Documentation

ExpandingToolBar::ExpandingToolBar ( wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize 
)
Todo:
check whether this is a memory leak (and check similar code)
ExpandingToolBar::~ExpandingToolBar ( )
virtual

Member Function Documentation

void ExpandingToolBar::Collapse ( bool  now = false)
void ExpandingToolBar::Expand ( )
bool ExpandingToolBar::GetAutoExpand ( )
inline

References mAutoExpand.

wxPanel* ExpandingToolBar::GetExtraPanel ( )
inline

References mExtraPanel.

wxPanel* ExpandingToolBar::GetMainPanel ( )
inline

References mMainPanel.

wxBitmap ExpandingToolBar::GetToolbarBitmap ( )
protected

Referenced by StartMoving().

bool ExpandingToolBar::IsCursorInWindow ( )
protected
bool ExpandingToolBar::IsExpanded ( )
inline

References mIsExpanded.

bool ExpandingToolBar::Layout ( )
override
void ExpandingToolBar::MoveDrawer ( wxSize  prevSize)
protected
void ExpandingToolBar::OnSize ( wxSizeEvent &  evt)
void ExpandingToolBar::OnTimer ( wxTimerEvent &  evt)
void ExpandingToolBar::OnToggle ( wxCommandEvent &  evt)

References Collapse(), Expand(), and mIsExpanded.

void ExpandingToolBar::RecursivelyPushEventHandlers ( wxWindow *  win)
protected

References mHandlers, and mWindowHash.

void ExpandingToolBar::ReparentExtraPanel ( )
protected

References mButtonSize, mExtraPanel, mGrabberSize, and mMainSize.

Referenced by MoveDrawer().

void ExpandingToolBar::SetAutoExpand ( bool  enabled)
inline

References mAutoExpand.

void ExpandingToolBar::TryAutoCollapse ( )
protected
void ExpandingToolBar::TryAutoExpand ( )
protected
void ExpandingToolBar::UpdateMoving ( )

Friends And Related Function Documentation

friend class ExpandingToolBarEvtHandler
friend

Member Data Documentation

ToolBarArea* ExpandingToolBar::mAreaParent
protected
bool ExpandingToolBar::mAutoExpand
protected
wxSize ExpandingToolBar::mButtonSize
protected
wxSize ExpandingToolBar::mCurrentDrawerSize
protected

Referenced by Collapse(), Fit(), MoveDrawer(), and OnTimer().

wxSize ExpandingToolBar::mCurrentTotalSize
protected

Referenced by Fit(), IsCursorInWindow(), and MoveDrawer().

ToolBarDialog* ExpandingToolBar::mDialogParent
protected

Referenced by MoveDrawer(), and OnSize().

std::unique_ptr<wxDragImage> ExpandingToolBar::mDragImage
protected
wxRect ExpandingToolBar::mDropTarget
protected
wxArrayRect ExpandingToolBar::mDropTargets
protected

Referenced by StartMoving(), and UpdateMoving().

wxPanel* ExpandingToolBar::mExtraPanel
protected
wxSize ExpandingToolBar::mExtraSize
protected

Referenced by Fit(), and Layout().

bool ExpandingToolBar::mFirstTime
protected

Referenced by Fit().

ToolBarFrame* ExpandingToolBar::mFrameParent
protected

Referenced by MoveDrawer(), and OnSize().

ToolBarGrabber* ExpandingToolBar::mGrabber
protected

Referenced by IsCursorInWindow(), and Layout().

wxSize ExpandingToolBar::mGrabberSize
protected

Referenced by Fit(), Layout(), and ReparentExtraPanel().

std::vector< movable_ptr< ExpandingToolBarEvtHandler > > ExpandingToolBar::mHandlers
protected
bool ExpandingToolBar::mIsAutoExpanded
protected
bool ExpandingToolBar::mIsExpanded
protected

Referenced by Fit(), IsExpanded(), and OnToggle().

bool ExpandingToolBar::mIsManualExpanded
protected
wxPanel* ExpandingToolBar::mMainPanel
protected

Referenced by GetMainPanel(), and Layout().

wxSize ExpandingToolBar::mMainSize
protected
std::unique_ptr<ToolBarArrangement> ExpandingToolBar::mSavedArrangement
protected
int ExpandingToolBar::msNoAutoExpandStack = 0
staticprotected
wxSize ExpandingToolBar::mTargetDrawerSize
protected

Referenced by Collapse(), Fit(), and OnTimer().

ImageRollPanel* ExpandingToolBar::mTargetPanel
protected

Referenced by StartMoving(), and UpdateMoving().

wxTimer ExpandingToolBar::mTimer
protected

Referenced by FinishMoving(), Fit(), and StartMoving().

AButton* ExpandingToolBar::mToggleButton
protected
wxWindow* ExpandingToolBar::mTopLevelParent
protected

Referenced by FinishMoving(), and StartMoving().

WindowHash ExpandingToolBar::mWindowHash
protected

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