diff --git a/include/wx/dc.h b/include/wx/dc.h index 6dcf24c1c3..2131ca91a1 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -1478,7 +1478,7 @@ class WXDLLIMPEXP_CORE wxDCTextBgModeChanger public: wxDCTextBgModeChanger(wxDC& dc) : m_dc(dc), m_modeOld(wxBRUSHSTYLE_INVALID) { } - wxDCTextBgModeChanger(wxDC& dc, int mode) : m_dc(dc) + wxDCTextBgModeChanger(wxDC& dc, int mode) : m_dc(dc), m_modeOld(wxBRUSHSTYLE_INVALID) { Set(mode); } diff --git a/samples/render/render.cpp b/samples/render/render.cpp index dd1a4bc6df..f6589271f6 100644 --- a/samples/render/render.cpp +++ b/samples/render/render.cpp @@ -219,9 +219,9 @@ private: wxRendererNative& renderer = m_useGeneric ? wxRendererNative::GetGeneric() : wxRendererNative::Get(); - int x1 = 10, // text offset - x2 = 300, // drawing offset - y = 10; + int x1 = FromDIP(10), // text offset + x2 = FromDIP(300), // drawing offset + y = FromDIP(10); const int lineHeight = dc.GetCharHeight(); dc.DrawText("Demonstration of various wxRenderer functions:", x1, y); @@ -247,7 +247,7 @@ private: y += lineHeight*3; const wxCoord heightHdr = renderer.GetHeaderButtonHeight(this); - const wxCoord widthHdr = 120; + const wxCoord width = 15*GetCharWidth(); const wxHeaderSortIconType hdrSortIcon = m_useIcon ? wxHDR_SORT_ICON_UP @@ -266,13 +266,13 @@ private: // implementation. dc.DrawText("DrawHeaderButton() (default)", x1, y); wxRendererNative::GetDefault().DrawHeaderButton(this, dc, - wxRect(x2, y, widthHdr, heightHdr), m_flags, + wxRect(x2, y, width, heightHdr), m_flags, hdrSortIcon, &hdrParams); y += lineHeight + heightHdr; dc.DrawText("DrawHeaderButton() (overridden)", x1, y); renderer.DrawHeaderButton(this, dc, - wxRect(x2, y, widthHdr, heightHdr), m_flags, + wxRect(x2, y, width, heightHdr), m_flags, hdrSortIcon, &hdrParams); y += lineHeight + heightHdr; @@ -307,7 +307,7 @@ private: #ifdef wxHAS_DRAW_TITLE_BAR_BITMAP dc.DrawText("DrawTitleBarBitmap()", x1, y); - wxRect rBtn(x2, y, 21, 21); + wxRect rBtn(x2, y, FromDIP(21), FromDIP(21)); renderer.DrawTitleBarBitmap(this, dc, rBtn, wxTITLEBAR_BUTTON_HELP, m_flags); rBtn.x += 2*rBtn.width; @@ -327,21 +327,21 @@ private: #endif // wxHAS_DRAW_TITLE_BAR_BITMAP // The meanings of those are reversed for the vertical gauge below. - const wxCoord heightGauge = 24; - const wxCoord widthGauge = 180; + const wxCoord heightGauge = FromDIP(24); + const wxCoord widthGauge = 30*GetCharWidth(); dc.DrawText("DrawGauge()", x1, y); renderer.DrawGauge(this, dc, wxRect(x2, y, widthGauge, heightGauge), 25, 100, m_flags); renderer.DrawGauge(this, dc, - wxRect(x2 + widthGauge + 30, y + heightGauge - widthGauge, + wxRect(x2 + widthGauge + FromDIP(30), y + heightGauge - widthGauge, heightGauge, widthGauge), 25, 100, m_flags | wxCONTROL_SPECIAL); y += lineHeight + heightGauge; - const wxCoord heightListItem = 48; - const wxCoord widthListItem = 260; + const wxCoord heightListItem = FromDIP(48); + const wxCoord widthListItem = 30*GetCharWidth(); dc.DrawText("DrawItemSelectionRect()", x1, y); renderer.DrawItemSelectionRect(this, dc, @@ -352,10 +352,10 @@ private: y += heightListItem; - dc.DrawText("DrawChoice()", x1, y + 20); - renderer.DrawChoice(this, dc, wxRect(x2, y, 80, 50), m_flags); - y += 50; - + y += lineHeight; + dc.DrawText("DrawChoice()", x1, y); + renderer.DrawChoice(this, dc, + wxRect(x2, y, width, 1.5*GetCharHeight()), m_flags); } int m_flags; diff --git a/src/msw/renderer.cpp b/src/msw/renderer.cpp index 6cfdb37fab..df0259409d 100644 --- a/src/msw/renderer.cpp +++ b/src/msw/renderer.cpp @@ -1011,7 +1011,7 @@ wxRendererXP::DrawItemSelectionRect(wxWindow *win, const wxRect& rect, int flags) { - wxUxThemeHandle hTheme(win, L"EXPLORER::LISTVIEW"); + wxUxThemeHandle hTheme(win, L"EXPLORER::LISTVIEW;LISTVIEW"); const int itemState = GetListItemState(flags); @@ -1038,7 +1038,7 @@ void wxRendererXP::DrawItemText(wxWindow* win, int flags, wxEllipsizeMode ellipsizeMode) { - wxUxThemeHandle hTheme(win, L"EXPLORER::LISTVIEW"); + wxUxThemeHandle hTheme(win, L"EXPLORER::LISTVIEW;LISTVIEW"); const int itemState = GetListItemState(flags);