X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/19193a2c85987b595932957e73013e7ea100f0e8..f538710f0b798b21365fd614ba531055b225b115:/src/msw/ownerdrw.cpp diff --git a/src/msw/ownerdrw.cpp b/src/msw/ownerdrw.cpp index 010429a878..37ea1f8b81 100644 --- a/src/msw/ownerdrw.cpp +++ b/src/msw/ownerdrw.cpp @@ -94,13 +94,13 @@ bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth, size_t *pheight) { // Is BMP height larger then text height? size_t adjustedHeight = m_bmpChecked.GetHeight() + - wxSystemSettings::GetSystemMetric(wxSYS_EDGE_Y); + wxSystemSettings::GetMetric(wxSYS_EDGE_Y); if (*pheight < adjustedHeight) *pheight = adjustedHeight; // Does BMP encroach on default check menu position? size_t adjustedWidth = m_bmpChecked.GetWidth() + - (wxSystemSettings::GetSystemMetric(wxSYS_EDGE_X) * 2); + (wxSystemSettings::GetMetric(wxSYS_EDGE_X) * 2); if (ms_nDefaultMarginWidth < adjustedWidth) *pwidth += adjustedWidth - ms_nDefaultMarginWidth; @@ -190,12 +190,30 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc, } HFONT hPrevFont = (HFONT) ::SelectObject(hdc, hfont); - DrawState(hdc, NULL, NULL, + + +#if wxUSE_UNICODE_MSLU + if ( wxGetOsVersion() == wxWIN95 /* using unicows.dll */ ) + { + // VS: There's yet another bug in MSLU: DrawStateW behaves + // like if it was expecting char*, not wchar_t* input. + // We have to use DrawStateA explicitly. + DrawStateA(hdc, NULL, NULL, + (LPARAM)(const char*)m_strName.mb_str(wxConvLocal), + m_strName.length(), + x, rc.y, rc.GetWidth(), rc.GetHeight(), + DST_PREFIXTEXT | + (st & wxODDisabled ? DSS_DISABLED : 0)); + } + else +#else + DrawState(hdc, NULL, NULL, (LPARAM)m_strName.c_str(), m_strName.length(), x, rc.y, rc.GetWidth(), rc.GetHeight(), DST_PREFIXTEXT | (st & wxODDisabled ? DSS_DISABLED : 0)); +#endif - if ( !m_strAccel.empty() ) + if ( !m_strAccel.empty() ) { RECT r; r.top = rc.GetTop();