X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4cda739ce41ce482c8edbeebdd8f7ceb5e3cb371..d53f610c1c224b6a0f58e4009b2bce553b1ff7b9:/src/msw/renderer.cpp diff --git a/src/msw/renderer.cpp b/src/msw/renderer.cpp index 285dfabbd1..c2b4173972 100644 --- a/src/msw/renderer.cpp +++ b/src/msw/renderer.cpp @@ -35,6 +35,7 @@ #include "wx/splitter.h" #include "wx/renderer.h" #include "wx/msw/private.h" +#include "wx/msw/dc.h" #include "wx/msw/uxtheme.h" // tmschema.h is in Win32 Platform SDK and might not be available with earlier @@ -121,6 +122,8 @@ public: const wxRect& rect, int flags = 0); + virtual wxSize GetCheckBoxSize(wxWindow *win); + virtual int GetHeaderButtonHeight(wxWindow *win); private: @@ -227,7 +230,7 @@ wxRendererMSW::DrawComboBoxDropButton(wxWindow * WXUNUSED(win), if ( flags & wxCONTROL_PRESSED ) style |= DFCS_PUSHED | DFCS_FLAT; - ::DrawFrameControl(GetHdcOf(dc), &r, DFC_SCROLL, style); + ::DrawFrameControl(GetHdcOf(*((wxMSWDCImpl*)dc.GetImpl())), &r, DFC_SCROLL, style); } void @@ -251,7 +254,7 @@ wxRendererMSW::DrawCheckBox(wxWindow * WXUNUSED(win), if ( flags & wxCONTROL_CURRENT ) style |= DFCS_HOT; - ::DrawFrameControl(GetHdcOf(dc), &r, DFC_BUTTON, style); + ::DrawFrameControl(GetHdcOf(*((wxMSWDCImpl*)dc.GetImpl())), &r, DFC_BUTTON, style); } void @@ -280,7 +283,7 @@ wxRendererMSW::DrawPushButton(wxWindow * WXUNUSED(win), RECT rc; wxCopyRectToRECT(rect, rc); - ::DrawFrameControl(GetHdcOf(dc), &rc, DFC_BUTTON, style); + ::DrawFrameControl(GetHdcOf(*((wxMSWDCImpl*)dc.GetImpl())), &rc, DFC_BUTTON, style); } void wxRendererMSW::DrawFocusRect(wxWindow * WXUNUSED(win), @@ -291,7 +294,13 @@ void wxRendererMSW::DrawFocusRect(wxWindow * WXUNUSED(win), RECT rc; wxCopyRectToRECT(rect, rc); - ::DrawFocusRect(GetHdcOf(dc), &rc); + ::DrawFocusRect(GetHdcOf(*((wxMSWDCImpl*)dc.GetImpl())), &rc); +} + +wxSize wxRendererMSW::GetCheckBoxSize(wxWindow * WXUNUSED(win)) +{ + return wxSize(::GetSystemMetrics(SM_CXMENUCHECK), + ::GetSystemMetrics(SM_CYMENUCHECK)); } int wxRendererMSW::GetHeaderButtonHeight(wxWindow * WXUNUSED(win)) @@ -363,7 +372,7 @@ wxRendererXP::DrawComboBoxDropButton(wxWindow * win, wxUxThemeEngine::Get()->DrawThemeBackground ( hTheme, - GetHdcOf(dc), + GetHdcOf(*((wxMSWDCImpl*)dc.GetImpl())), CP_DROPDOWNBUTTON, state, &r, @@ -399,7 +408,7 @@ wxRendererXP::DrawHeaderButton(wxWindow *win, wxUxThemeEngine::Get()->DrawThemeBackground ( hTheme, - GetHdcOf(dc), + GetHdcOf(*((wxMSWDCImpl*)dc.GetImpl())), HP_HEADERITEM, state, &r, @@ -435,7 +444,7 @@ wxRendererXP::DrawTreeItemButton(wxWindow *win, wxUxThemeEngine::Get()->DrawThemeBackground ( hTheme, - GetHdcOf(dc), + GetHdcOf(*((wxMSWDCImpl*)dc.GetImpl())), TVP_GLYPH, state, &r, @@ -485,7 +494,7 @@ wxRendererXP::DrawCheckBox(wxWindow *win, wxUxThemeEngine::Get()->DrawThemeBackground ( hTheme, - GetHdcOf(dc), + GetHdcOf(*((wxMSWDCImpl*)dc.GetImpl())), BP_CHECKBOX, state, &r, @@ -524,7 +533,7 @@ wxRendererXP::DrawPushButton(wxWindow * win, wxUxThemeEngine::Get()->DrawThemeBackground ( hTheme, - GetHdcOf(dc), + GetHdcOf(*((wxMSWDCImpl*)dc.GetImpl())), BP_PUSHBUTTON, state, &r, @@ -559,7 +568,7 @@ wxRendererXP::DrawItemSelectionRect(wxWindow *win, dc.SetBrush(brush); dc.SetPen(*wxTRANSPARENT_PEN); dc.DrawRectangle( rect ); - + if ((flags & wxCONTROL_FOCUSED) && (flags & wxCONTROL_CURRENT)) DrawFocusRect( win, dc, rect, flags ); }