X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e413198572959f013fc2537a3c8cc184c9ac820d..116de9914878c202141f0ea20251a451593a52c9:/src/msw/renderer.cpp?ds=sidebyside diff --git a/src/msw/renderer.cpp b/src/msw/renderer.cpp index ea483718a8..93d06259a0 100644 --- a/src/msw/renderer.cpp +++ b/src/msw/renderer.cpp @@ -48,9 +48,10 @@ #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif +#include "wx/dcgraph.h" #include "gdiplus.h" using namespace Gdiplus; -#endif +#endif // wxUSE_GRAPHICS_CONTEXT // tmschema.h is in Win32 Platform SDK and might not be available with earlier // compilers @@ -128,7 +129,7 @@ public: } else #endif - m_hdc = GetHdcOf(*dc); + m_hdc = GetHdcOf(*((wxMSWDCImpl*)dc->GetImpl())); } ~GraphicsHDC() @@ -138,7 +139,7 @@ public: m_graphics->ReleaseHDC(m_hdc); #endif } - + operator HDC() const { return m_hdc; } private: @@ -192,24 +193,24 @@ public: const wxRect& rect, int flags = 0); - virtual void DrawChoice(wxWindow* win, - wxDC& dc, - const wxRect& rect, + virtual void DrawChoice(wxWindow* win, + wxDC& dc, + const wxRect& rect, int flags=0); - virtual void DrawComboBox(wxWindow* win, - wxDC& dc, - const wxRect& rect, + virtual void DrawComboBox(wxWindow* win, + wxDC& dc, + const wxRect& rect, int flags=0); - virtual void DrawTextCtrl(wxWindow* win, - wxDC& dc, - const wxRect& rect, + virtual void DrawTextCtrl(wxWindow* win, + wxDC& dc, + const wxRect& rect, int flags=0); - virtual void DrawRadioButton(wxWindow* win, - wxDC& dc, - const wxRect& rect, + virtual void DrawRadioButton(wxWindow* win, + wxDC& dc, + const wxRect& rect, int flags=0); virtual wxSize GetCheckBoxSize(wxWindow *win); @@ -320,7 +321,7 @@ wxRendererMSW::DrawComboBoxDropButton(wxWindow * WXUNUSED(win), if ( flags & wxCONTROL_PRESSED ) style |= DFCS_PUSHED | DFCS_FLAT; - ::DrawFrameControl(GraphicsHDC(((wxMSWDCImpl*)dc.GetImpl())), &r, DFC_SCROLL, style); + ::DrawFrameControl(GraphicsHDC(&dc), &r, DFC_SCROLL, style); } void @@ -344,7 +345,7 @@ wxRendererMSW::DrawCheckBox(wxWindow * WXUNUSED(win), if ( flags & wxCONTROL_CURRENT ) style |= DFCS_HOT; - ::DrawFrameControl(GraphicsHDC((wxMSWDCImpl*)dc.GetImpl())), &r, DFC_BUTTON, style); + ::DrawFrameControl(GraphicsHDC(&dc), &r, DFC_BUTTON, style); } void @@ -373,7 +374,7 @@ wxRendererMSW::DrawPushButton(wxWindow * WXUNUSED(win), RECT rc; wxCopyRectToRECT(rect, rc); - ::DrawFrameControl(GraphicsHDC((wxMSWDCImpl*)dc.GetImpl())), &rc, DFC_BUTTON, style); + ::DrawFrameControl(GraphicsHDC(&dc), &rc, DFC_BUTTON, style); } void wxRendererMSW::DrawFocusRect(wxWindow * WXUNUSED(win), @@ -384,7 +385,7 @@ void wxRendererMSW::DrawFocusRect(wxWindow * WXUNUSED(win), RECT rc; wxCopyRectToRECT(rect, rc); - ::DrawFocusRect(GraphicsHDC((wxMSWDCImpl*)dc.GetImpl())), &rc); + ::DrawFocusRect(GraphicsHDC(&dc), &rc); } wxSize wxRendererMSW::GetCheckBoxSize(wxWindow * WXUNUSED(win)) @@ -422,7 +423,7 @@ void wxRendererMSW::DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, in wxColour fill; wxColour bdr; COLORREF cref; - + #if wxUSE_UXTHEME wxUxThemeHandle hTheme(win, L"EDIT"); if (hTheme) @@ -436,10 +437,10 @@ void wxRendererMSW::DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, in etsState = ETS_DISABLED; else etsState = ETS_NORMAL; - + wxUxThemeEngine::Get()->GetThemeColor(hTheme, EP_EDITTEXT, etsState, TMT_BORDERCOLOR, &cref); - bdr = wxRGBToColour(cref); + bdr = wxRGBToColour(cref); } else #endif @@ -447,7 +448,7 @@ void wxRendererMSW::DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, in fill = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); bdr = *wxBLACK; } - + dc.SetPen( bdr ); dc.SetBrush( fill ); dc.DrawRectangle(rect); @@ -458,8 +459,8 @@ void wxRendererMSW::DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, in void wxRendererMSW::DrawComboBox(wxWindow* win, wxDC& dc, const wxRect& rect, int flags) { // Draw the main part of the control same as TextCtrl - DrawTextCtrl(win, dc, rect, flags); - + DrawTextCtrl(win, dc, rect, flags); + // Draw the button inside the border, on the right side wxRect br(rect); br.height -= 2; @@ -477,7 +478,7 @@ void wxRendererMSW::DrawChoice(wxWindow* win, wxDC& dc, DrawComboBox(win, dc, rect, flags); } - + // Draw a themed radio button void wxRendererMSW::DrawRadioButton(wxWindow* win, wxDC& dc, const wxRect& rect, int flags) {