X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/536b70ac680647cd72b71c21102869f750b73cab..f7f50f493baa177e8ae07d12641095baee55d4f8:/src/univ/themes/win32.cpp?ds=sidebyside diff --git a/src/univ/themes/win32.cpp b/src/univ/themes/win32.cpp index ba02e22faf..4f02fc9394 100644 --- a/src/univ/themes/win32.cpp +++ b/src/univ/themes/win32.cpp @@ -148,7 +148,8 @@ public: virtual void DrawBackground(wxDC& dc, const wxColour& col, const wxRect& rect, - int flags = 0); + int flags = 0, + wxWindow *window = NULL); virtual void DrawLabel(wxDC& dc, const wxString& label, const wxRect& rect, @@ -354,7 +355,7 @@ public: virtual wxSize GetToolBarButtonSize(wxCoord *separator) const { if ( separator ) *separator = 5; return wxSize(16, 15); } virtual wxSize GetToolBarMargin() const - { return wxSize(6, 6); } + { return wxSize(4, 4); } virtual wxRect GetTextTotalArea(const wxTextCtrl *text, const wxRect& rect) const; @@ -404,7 +405,8 @@ protected: // DrawButtonBorder() helper void DoDrawBackground(wxDC& dc, const wxColour& col, - const wxRect& rect); + const wxRect& rect, + wxWindow *window = NULL ); // DrawBorder() helpers: all of them shift and clip the DC after drawing // the border @@ -1864,8 +1866,12 @@ wxRect wxWin32Renderer::GetBorderDimensions(wxBorder border) const break; default: + { + // char *crash = NULL; + // *crash = 0; wxFAIL_MSG(_T("unknown border type")); // fall through + } case wxBORDER_DEFAULT: case wxBORDER_NONE: @@ -3199,7 +3205,8 @@ void wxWin32Renderer::GetComboBitmaps(wxBitmap *bmpNormal, void wxWin32Renderer::DoDrawBackground(wxDC& dc, const wxColour& col, - const wxRect& rect) + const wxRect& rect, + wxWindow *window ) { wxBrush brush(col, wxSOLID); dc.SetBrush(brush); @@ -3210,11 +3217,12 @@ void wxWin32Renderer::DoDrawBackground(wxDC& dc, void wxWin32Renderer::DrawBackground(wxDC& dc, const wxColour& col, const wxRect& rect, - int flags) + int flags, + wxWindow *window ) { // just fill it with the given or default bg colour wxColour colBg = col.Ok() ? col : wxSCHEME_COLOUR(m_scheme, CONTROL); - DoDrawBackground(dc, colBg, rect); + DoDrawBackground(dc, colBg, rect, window ); } // ---------------------------------------------------------------------------- @@ -4141,6 +4149,8 @@ bool wxWin32ScrollBarInputHandler::HandleMouseMove(wxInputConsumer *control, // if we're scrolling the scrollbar because the arrow or the shaft was // pressed, check that the mouse stays on the same scrollbar element +#if 0 + // Always let thumb jump back if we leave the scrollbar if ( event.Moving() ) { ht = m_renderer->HitTestScrollbar(scrollbar, event.GetPosition()); @@ -4149,6 +4159,21 @@ bool wxWin32ScrollBarInputHandler::HandleMouseMove(wxInputConsumer *control, { ht = wxHT_NOWHERE; } +#else + // Jump back only if we get far away from it + wxPoint pos = event.GetPosition(); + if (scrollbar->HasFlag( wxVERTICAL )) + { + if (pos.x > -40 && pos.x < scrollbar->GetSize().x+40) + pos.x = 5; + } + else + { + if (pos.y > -40 && pos.y < scrollbar->GetSize().y+40) + pos.y = 5; + } + ht = m_renderer->HitTestScrollbar(scrollbar, pos ); +#endif // if we're dragging the thumb and the mouse stays in the scrollbar, it // is still ok - we only want to catch the case when the mouse leaves