Audacity 3.2.0
Public Member Functions | Protected Attributes | List of all members
ToolBarGrabber Class Referencefinal

Draws the grabber for an ExpandingToolBar. More...

#include <ExpandingToolBar.h>

Inheritance diagram for ToolBarGrabber:
[legend]
Collaboration diagram for ToolBarGrabber:
[legend]

Public Member Functions

 ToolBarGrabber (wxWindow *parent, wxWindowID id, ExpandingToolBar *ownerToolbar, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
 
void OnPaint (wxPaintEvent &evt)
 
void OnSize (wxSizeEvent &evt)
 
void OnMouse (wxMouseEvent &evt)
 
- 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
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Protected Attributes

int mState
 
ExpandingToolBarmOwnerToolBar
 

Detailed Description

Draws the grabber for an ExpandingToolBar.

Definition at line 124 of file ExpandingToolBar.h.

Constructor & Destructor Documentation

◆ ToolBarGrabber()

ToolBarGrabber::ToolBarGrabber ( wxWindow *  parent,
wxWindowID  id,
ExpandingToolBar ownerToolbar,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize 
)

Definition at line 663 of file ExpandingToolBar.cpp.

667 :
668 wxPanelWrapper(parent, id, pos, size),
669 mOwnerToolBar(ownerToolbar)
670{
671#if 0
672 wxImage grabberImages = theTheme.Image(bmpToolBarGrabber);
673 wxColour magicColor = wxColour(0, 255, 255);
674 ImageArray images = ImageRoll::SplitH(grabberImages, magicColor);
675
676 mImageRoll[0] = ImageRoll(ImageRoll::VerticalRoll,
677 images[0],
678 magicColor);
679 mImageRoll[1] = ImageRoll(ImageRoll::VerticalRoll,
680 images[1],
681 magicColor);
682
683 SetMinSize(mImageRoll[0].GetMinSize());
684 SetMaxSize(mImageRoll[1].GetMaxSize());
685#endif
686 mState = 0;
687}
wxImage(22, 22)
std::vector< wxImage > ImageArray
Definition: ImageRoll.h:25
THEME_API Theme theTheme
Definition: Theme.cpp:82
An ImageRoll is an image that can be expanded to an arbitrary size; it is made up of both fixed piece...
Definition: ImageRoll.h:28
@ VerticalRoll
Definition: ImageRoll.h:34
static ImageArray SplitH(const wxImage &src, wxColour magicColor)
Definition: ImageRoll.cpp:109
wxImage & Image(int iIndex)
ExpandingToolBar * mOwnerToolBar

References ThemeBase::Image(), mState, ImageRoll::SplitH(), theTheme, ImageRoll::VerticalRoll, and wxImage().

Here is the call graph for this function:

Member Function Documentation

◆ OnMouse()

void ToolBarGrabber::OnMouse ( wxMouseEvent &  evt)

Definition at line 689 of file ExpandingToolBar.cpp.

690{
691 int prevState = mState;
692
693 // Handle highlighting the image if the mouse is over it
694
695 if (event.Entering())
696 mState = 1;
697 else if (event.Leaving())
698 mState = 0;
699 else {
700 wxSize clientSize = GetClientSize();
701
702 if (event.m_x >= 0 && event.m_y >= 0 &&
703 event.m_x < clientSize.x && event.m_y < clientSize.y)
704 mState = 1;
705 else
706 mState = 0;
707 }
708
709 if (event.ButtonDown())
711
712 if (mState != prevState)
713 Refresh(false);
714}

References mOwnerToolBar, mState, and ExpandingToolBar::StartMoving().

Here is the call graph for this function:

◆ OnPaint()

void ToolBarGrabber::OnPaint ( wxPaintEvent &  evt)

Definition at line 716 of file ExpandingToolBar.cpp.

717{
718 wxPaintDC dc(this);
719
720 // mImageRoll[mState].Draw(dc, GetClientRect());
721}

◆ OnSize()

void ToolBarGrabber::OnSize ( wxSizeEvent &  evt)

Definition at line 723 of file ExpandingToolBar.cpp.

724{
725 Refresh(false);
726}

Member Data Documentation

◆ mOwnerToolBar

ExpandingToolBar* ToolBarGrabber::mOwnerToolBar
protected

Definition at line 142 of file ExpandingToolBar.h.

Referenced by OnMouse().

◆ mState

int ToolBarGrabber::mState
protected

Definition at line 140 of file ExpandingToolBar.h.

Referenced by OnMouse().


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