29#ifndef __AUDACITY_WIDGETS_GRABBER__
30#define __AUDACITY_WIDGETS_GRABBER__
35#include <wx/statbmp.h>
53 const wxPoint& pt = wxDefaultPosition,
54 bool escaping =
false)
55 : wxCommandEvent(type, winid)
90#define GrabberEventHandler(func) \
91 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(GrabberEventFunction, &func)
93#define EVT_GRABBER(id, fn) \
94 DECLARE_EVENT_TABLE_ENTRY(EVT_GRABBER_CLICKED, id, wxID_ANY, \
95 (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) \
96 wxStaticCastEvent(GrabberEventFunction, & fn), (wxObject *) NULL),
100#define grabberWidth 10
102class AUDACITY_DLL_API
Grabber final :
public wxWindow
107 Grabber(wxWindow *parent, wxWindowID
id);
118 void PushButton(
bool state);
119 void SetAsSpacer(
bool bIsSpacer );
126 void OnLeftDown(wxMouseEvent & event);
127 void OnLeftUp(wxMouseEvent & event);
128 void OnEnter(wxMouseEvent & event);
129 void OnLeave(wxMouseEvent & event);
130 void OnErase(wxEraseEvent & event);
131 void OnPaint(wxPaintEvent & event);
132 void OnKeyDown(wxKeyEvent & event);
136 void DrawGrabber(wxDC & dc);
137 void SendEvent(wxEventType type,
const wxPoint & pos,
bool escaping);
145 DECLARE_EVENT_TABLE()
154 const wxBitmap&
label,
155 const wxPoint& pos = wxDefaultPosition,
156 const wxSize&
size = wxDefaultSize,
158 const wxString&
name = wxStaticBitmapNameStr) :
160 wxStaticBitmap(parent,
169 static_cast<void>(event);
171 DECLARE_EVENT_TABLE()
DECLARE_EXPORTED_EVENT_TYPE(AUDACITY_DLL_API, wxEVT_APP_COMMAND_RECEIVED, -1)
const TranslatableString name
void(wxEvtHandler::* GrabberEventFunction)(GrabberEvent &)
A widget for bitmaps which ignores the erase event for flicker-free use.
AStaticBitmap(wxWindow *parent, wxWindowID id, const wxBitmap &label, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxStaticBitmapNameStr)
void OnErase(wxEraseEvent &event)
const wxPoint & GetPosition() const
void SetPosition(const wxPoint &pos)
GrabberEvent(wxEventType type=wxEVT_NULL, wxWindowID winid=0, const wxPoint &pt=wxDefaultPosition, bool escaping=false)
GrabberEvent(const GrabberEvent &event)=default
wxEvent * Clone() const override
The widget to the left of a ToolBar that allows it to be dragged around to NEW positions.
bool AcceptsFocusFromKeyboard() const override
Holds a msgid for the translation catalog; may also bind format arguments.