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;
138 if ((r.GetHeight() % 4) < 2) {
143 int padding = r.GetHeight() > 32 ? 22 : 6;
147 right = r.GetRight();
149 bottom = r.GetBottom();
156 dc.SetPen(wxPen(
theTheme.
Colour(clrGrabber), 1, wxPENSTYLE_SOLID));
159 for (y = top + padding; y < bottom - padding; y += 5) {
160 dc.DrawRectangle(left, y, 2, 2);
161 dc.DrawRectangle(right, y, 2, 2);
174 wxRect r = GetRect();
175 mOver = r.Contains(ScreenToClient(wxGetMousePosition()));
191 SendEvent(EVT_GRABBER_CLICKED, event.GetPosition(),
false);
214#if defined(__WXMAC__)
218 if (wxWindow::GetCapture() !=
nullptr)
226 const auto text = GetToolTipText();
228 wxWindow::SetToolTip(text);
243#if defined(__WXMAC__)
247 if (wxWindow::GetCapture() !=
nullptr)
280 if(event.GetKeyCode() == WXK_ESCAPE) {
283 event.ResumePropagation(wxEVENT_PROPAGATE_MAX);
284 SendEvent(EVT_GRABBER_CLICKED, wxPoint{ -1, -1 },
true);
DEFINE_EVENT_TYPE(EVT_FREQWINDOW_RECALC)
static void Light(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