Audacity 3.2.0
|
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>
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 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 |
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 |
ToolBarGrabber * | mGrabber |
AButton * | mToggleButton |
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 |
ToolBarFrame * | mFrameParent |
ToolBarDialog * | mDialogParent |
ToolBarArea * | mAreaParent |
std::unique_ptr< ToolBarArrangement > | mSavedArrangement |
wxPanel * | mTargetPanel |
std::unique_ptr< wxDragImage > | mDragImage |
wxWindow * | mTopLevelParent |
std::vector< wxRect > | mDropTargets |
wxRect | mDropTarget |
std::vector< std::unique_ptr< ExpandingToolBarEvtHandler > > | mHandlers |
Static Protected Attributes | |
static int | msNoAutoExpandStack = 0 |
Friends | |
class | ExpandingToolBarEvtHandler |
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.
Definition at line 45 of file ExpandingToolBar.h.
ExpandingToolBar::ExpandingToolBar | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize |
||
) |
Definition at line 114 of file ExpandingToolBar.cpp.
|
virtual |
Definition at line 164 of file ExpandingToolBar.cpp.
void ExpandingToolBar::Collapse | ( | bool | now = false | ) |
Definition at line 230 of file ExpandingToolBar.cpp.
References Fit(), mCurrentDrawerSize, mIsAutoExpanded, mIsManualExpanded, MoveDrawer(), mTargetDrawerSize, mToggleButton, and AButton::PopUp().
Referenced by OnToggle().
void ExpandingToolBar::Expand | ( | ) |
Definition at line 216 of file ExpandingToolBar.cpp.
References Fit(), mIsAutoExpanded, mIsManualExpanded, mToggleButton, and AButton::PushDown().
Referenced by OnToggle().
void ExpandingToolBar::FinishMoving | ( | ) |
Definition at line 620 of file ExpandingToolBar.cpp.
References ToolBarArea::CollapseAll(), kDummyRect, kMyTimerInterval, mAreaParent, mDragImage, mDropTarget, ToolBarArea::MoveChild(), mSavedArrangement, msNoAutoExpandStack, mTimer, mTopLevelParent, ToolBarArea::RestoreArrangement(), and ToolBarArea::SetCapturedChild().
Referenced by ToolBarArea::OnMouse().
|
override |
Definition at line 351 of file ExpandingToolBar.cpp.
References kMyTimerInterval, mButtonSize, mCurrentDrawerSize, mCurrentTotalSize, mExtraSize, mFirstTime, mGrabberSize, mIsAutoExpanded, mIsExpanded, mIsManualExpanded, mMainSize, mTargetDrawerSize, and mTimer.
Referenced by Collapse(), Expand(), TryAutoCollapse(), and TryAutoExpand().
|
inline |
|
inline |
|
inline |
|
protected |
Definition at line 493 of file ExpandingToolBar.cpp.
References size.
Referenced by StartMoving().
|
protected |
Definition at line 391 of file ExpandingToolBar.cpp.
References mCurrentTotalSize, and mGrabber.
Referenced by OnTimer().
|
inline |
|
override |
Definition at line 321 of file ExpandingToolBar.cpp.
References kToggleButtonHeight, mButtonSize, mExtraPanel, mExtraSize, mGrabber, mGrabberSize, mMainPanel, mMainSize, and mToggleButton.
|
protected |
Definition at line 425 of file ExpandingToolBar.cpp.
References mAreaParent, mButtonSize, mCurrentDrawerSize, mCurrentTotalSize, mDialogParent, mExtraPanel, mFrameParent, mMainSize, and ReparentExtraPanel().
Referenced by Collapse(), and OnTimer().
void ExpandingToolBar::OnSize | ( | wxSizeEvent & | evt | ) |
Definition at line 168 of file ExpandingToolBar.cpp.
References ToolBarArea::AddChild(), mAreaParent, mDialogParent, mFrameParent, ToolBarDialog::SetChild(), and ToolBarFrame::SetChild().
void ExpandingToolBar::OnTimer | ( | wxTimerEvent & | evt | ) |
Definition at line 469 of file ExpandingToolBar.cpp.
References IsCursorInWindow(), mAutoExpand, mCurrentDrawerSize, MoveDrawer(), msNoAutoExpandStack, mTargetDrawerSize, TryAutoCollapse(), and TryAutoExpand().
void ExpandingToolBar::OnToggle | ( | wxCommandEvent & | evt | ) |
Definition at line 208 of file ExpandingToolBar.cpp.
References Collapse(), Expand(), and mIsExpanded.
|
protected |
Definition at line 308 of file ExpandingToolBar.cpp.
References mHandlers, mWindowHash, and RecursivelyPushEventHandlers().
Referenced by RecursivelyPushEventHandlers().
|
protected |
Definition at line 407 of file ExpandingToolBar.cpp.
References mButtonSize, mExtraPanel, mGrabberSize, and mMainSize.
Referenced by MoveDrawer().
|
inline |
Definition at line 59 of file ExpandingToolBar.h.
References mAutoExpand.
void ExpandingToolBar::StartMoving | ( | ) |
Definition at line 505 of file ExpandingToolBar.cpp.
References ToolBarArea::CollapseAll(), ToolBarArea::GetDropTargets(), GetToolbarBitmap(), kDummyRect, mAreaParent, mDragImage, mDropTarget, mDropTargets, mSavedArrangement, msNoAutoExpandStack, mTargetPanel, mTimer, mTopLevelParent, ToolBarArea::RemoveChild(), safenew, ToolBarArea::SaveArrangement(), ToolBarArea::SetCapturedChild(), and wxPanelWrapper::wxPanelWrapper().
Referenced by ToolBarGrabber::OnMouse().
|
protected |
Definition at line 260 of file ExpandingToolBar.cpp.
References Fit(), mIsAutoExpanded, mIsManualExpanded, mToggleButton, and AButton::PopUp().
Referenced by OnTimer().
|
protected |
Definition at line 250 of file ExpandingToolBar.cpp.
References Fit(), mAutoExpand, mIsAutoExpanded, mIsManualExpanded, msNoAutoExpandStack, mToggleButton, and AButton::PushDown().
Referenced by OnTimer(), and ExpandingToolBarEvtHandler::ProcessEvent().
void ExpandingToolBar::UpdateMoving | ( | ) |
Definition at line 565 of file ExpandingToolBar.cpp.
References kDummyRect, mAreaParent, mDragImage, mDropTarget, mDropTargets, mSavedArrangement, and mTargetPanel.
Referenced by ToolBarArea::OnMouse().
|
friend |
Definition at line 120 of file ExpandingToolBar.h.
|
protected |
Definition at line 108 of file ExpandingToolBar.h.
Referenced by FinishMoving(), MoveDrawer(), OnSize(), StartMoving(), and UpdateMoving().
|
protected |
Definition at line 95 of file ExpandingToolBar.h.
Referenced by GetAutoExpand(), OnTimer(), SetAutoExpand(), and TryAutoExpand().
|
protected |
Definition at line 99 of file ExpandingToolBar.h.
Referenced by Fit(), Layout(), MoveDrawer(), and ReparentExtraPanel().
|
protected |
Definition at line 101 of file ExpandingToolBar.h.
Referenced by Collapse(), Fit(), MoveDrawer(), and OnTimer().
|
protected |
Definition at line 103 of file ExpandingToolBar.h.
Referenced by Fit(), IsCursorInWindow(), and MoveDrawer().
|
protected |
Definition at line 107 of file ExpandingToolBar.h.
Referenced by MoveDrawer(), and OnSize().
|
protected |
Definition at line 111 of file ExpandingToolBar.h.
Referenced by FinishMoving(), StartMoving(), and UpdateMoving().
|
protected |
Definition at line 114 of file ExpandingToolBar.h.
Referenced by FinishMoving(), StartMoving(), and UpdateMoving().
|
protected |
Definition at line 113 of file ExpandingToolBar.h.
Referenced by StartMoving(), and UpdateMoving().
|
protected |
Definition at line 89 of file ExpandingToolBar.h.
Referenced by GetExtraPanel(), Layout(), MoveDrawer(), and ReparentExtraPanel().
|
protected |
Definition at line 98 of file ExpandingToolBar.h.
|
protected |
Definition at line 96 of file ExpandingToolBar.h.
Referenced by Fit().
|
protected |
Definition at line 106 of file ExpandingToolBar.h.
Referenced by MoveDrawer(), and OnSize().
|
protected |
Definition at line 90 of file ExpandingToolBar.h.
Referenced by IsCursorInWindow(), and Layout().
|
protected |
Definition at line 100 of file ExpandingToolBar.h.
Referenced by Fit(), Layout(), and ReparentExtraPanel().
|
protected |
Definition at line 121 of file ExpandingToolBar.h.
Referenced by RecursivelyPushEventHandlers().
|
protected |
Definition at line 92 of file ExpandingToolBar.h.
Referenced by Collapse(), Expand(), Fit(), TryAutoCollapse(), and TryAutoExpand().
|
protected |
Definition at line 94 of file ExpandingToolBar.h.
Referenced by Fit(), IsExpanded(), and OnToggle().
|
protected |
Definition at line 93 of file ExpandingToolBar.h.
Referenced by Collapse(), Expand(), Fit(), TryAutoCollapse(), and TryAutoExpand().
|
protected |
Definition at line 88 of file ExpandingToolBar.h.
Referenced by GetMainPanel(), and Layout().
|
protected |
Definition at line 97 of file ExpandingToolBar.h.
Referenced by Fit(), Layout(), MoveDrawer(), and ReparentExtraPanel().
|
protected |
Definition at line 109 of file ExpandingToolBar.h.
Referenced by FinishMoving(), StartMoving(), and UpdateMoving().
|
staticprotected |
Definition at line 116 of file ExpandingToolBar.h.
Referenced by FinishMoving(), OnTimer(), StartMoving(), and TryAutoExpand().
|
protected |
Definition at line 102 of file ExpandingToolBar.h.
Referenced by Collapse(), Fit(), and OnTimer().
|
protected |
Definition at line 110 of file ExpandingToolBar.h.
Referenced by StartMoving(), and UpdateMoving().
|
protected |
Definition at line 105 of file ExpandingToolBar.h.
Referenced by FinishMoving(), Fit(), and StartMoving().
|
protected |
Definition at line 91 of file ExpandingToolBar.h.
Referenced by Collapse(), Expand(), Layout(), TryAutoCollapse(), and TryAutoExpand().
|
protected |
Definition at line 112 of file ExpandingToolBar.h.
Referenced by FinishMoving(), and StartMoving().
|
protected |
Definition at line 104 of file ExpandingToolBar.h.
Referenced by RecursivelyPushEventHandlers().