27#include <wx/dcclient.h>
41BEGIN_EVENT_TABLE(
Grabber, wxWindow)
59 wxFULL_REPAINT_ON_RESIZE)
71 SetLabel(
_(
"Grabber"));
72 SetName(
_(
"Grabber"));
87 wxWindow *parent = GetParent();
93 e.SetEventObject(parent);
96 parent->GetEventHandler()->AddPendingEvent(e);
102 wxSize siz = GetSize();
103 siz.IncBy( bIsSpacer ? 1:-1, 0 );
119 wxRect r = GetRect();
123 r.SetPosition( wxPoint(0,0) );
124 int y, left, right, top, bottom;
149 if ((r.GetHeight() % 4) < 2) {
155 right = r.GetRight();
157 bottom = r.GetBottom();
167 for (y = top; y < bottom; y += 4) {
179 for (y = top + 1; y <= bottom; y += 4) {
193 wxRect r = GetRect();
194 mOver = r.Contains(ScreenToClient(wxGetMousePosition()));
210 SendEvent(EVT_GRABBER_CLICKED, event.GetPosition(),
false);
233#if defined(__WXMAC__)
237 if (wxWindow::GetCapture() !=
nullptr)
245 const auto text = GetToolTipText();
247 wxWindow::SetToolTip(text);
262#if defined(__WXMAC__)
266 if (wxWindow::GetCapture() !=
nullptr)
299 if(event.GetKeyCode() == WXK_ESCAPE) {
302 event.ResumePropagation(wxEVENT_PROPAGATE_MAX);
303 SendEvent(EVT_GRABBER_CLICKED, wxPoint{ -1, -1 },
true);
DEFINE_EVENT_TYPE(EVT_FREQWINDOW_RECALC)
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
static void Bevel(wxDC &dc, bool up, const wxRect &r)
static void Light(wxDC *dc, bool selected, bool highlight=false)
static void Dark(wxDC *dc, bool selected, bool highlight=false)
static void Medium(wxDC *dc, bool selected)
A widget for bitmaps which ignores the erase event for flicker-free use.
void OnErase(wxEraseEvent &event)
The widget to the left of a ToolBar that allows it to be dragged around to NEW positions.
void SendEvent(wxEventType type, const wxPoint &pos, bool escaping)
void OnLeftUp(wxMouseEvent &event)
void SetAsSpacer(bool bIsSpacer)
void DrawGrabber(wxDC &dc)
void OnLeave(wxMouseEvent &event)
void OnErase(wxEraseEvent &event)
const Identifier mIdentifier
void OnPaint(wxPaintEvent &event)
void OnLeftDown(wxMouseEvent &event)
void OnKeyDown(wxKeyEvent &event)
void OnEnter(wxMouseEvent &event)
void SetToolTip(const TranslatableString &toolTip)
void PushButton(bool state)
An explicitly nonlocalized string, not meant for the user to see.
wxColour & Colour(int iIndex)
Holds a msgid for the translation catalog; may also bind format arguments.
wxString Translation() const
TranslatableString Stripped(unsigned options=MenuCodes) const
non-mutating, constructs another TranslatableString object