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)
94#define GrabberEventHandler(func) \
95 (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(GrabberEventFunction, &func)
97#define EVT_GRABBER(id, fn) \
98 DECLARE_EVENT_TABLE_ENTRY(EVT_GRABBER_CLICKED, id, wxID_ANY, \
99 (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) \
100 wxStaticCastEvent(GrabberEventFunction, & fn), (wxObject *) NULL),
104#define grabberWidth 10
106class AUDACITY_DLL_API
Grabber final :
public wxWindow
122 void PushButton(
bool state);
123 void SetAsSpacer(
bool bIsSpacer );
130 void OnLeftDown(wxMouseEvent & event);
131 void OnLeftUp(wxMouseEvent & event);
132 void OnEnter(wxMouseEvent & event);
133 void OnLeave(wxMouseEvent & event);
134 void OnErase(wxEraseEvent & event);
135 void OnPaint(wxPaintEvent & event);
136 void OnKeyDown(wxKeyEvent & event);
140 void DrawGrabber(wxDC & dc);
141 void SendEvent(wxEventType type,
const wxPoint & pos,
bool escaping);
150 DECLARE_EVENT_TABLE()
159 const wxBitmap&
label,
160 const wxPoint& pos = wxDefaultPosition,
161 const wxSize&
size = wxDefaultSize,
163 const wxString&
name = wxStaticBitmapNameStr) :
165 wxStaticBitmap(parent,
174 static_cast<void>(event);
176 DECLARE_EVENT_TABLE()
DECLARE_EXPORTED_EVENT_TYPE(AUDACITY_DLL_API, wxEVT_APP_COMMAND_RECEIVED, -1)
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, Identifier barId={}, 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.
const Identifier mIdentifier
bool AcceptsFocusFromKeyboard() const override
An explicitly nonlocalized string, not meant for the user to see.
Holds a msgid for the translation catalog; may also bind format arguments.