X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b76d9e767e8a3cfdafd27ae39a5755bed50bfd75..d18a7061666b8b890616c91cd5df422502c3f303:/src/msw/dc.cpp diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index ac9179a376..4f2367b426 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -25,6 +25,7 @@ #endif #ifndef WX_PRECOMP + #include "wx/msw/wrapcdlg.h" #include "wx/image.h" #include "wx/window.h" #include "wx/dc.h" @@ -35,11 +36,11 @@ #include "wx/dcmemory.h" #include "wx/log.h" #include "wx/icon.h" + #include "wx/dcprint.h" + #include "wx/module.h" #endif #include "wx/sysopt.h" -#include "wx/dcprint.h" -#include "wx/module.h" #include "wx/dynlib.h" #ifdef wxHAVE_RAW_BITMAP @@ -48,7 +49,6 @@ #include -#include "wx/msw/wrapcdlg.h" #ifndef __WIN32__ #include #endif @@ -490,7 +490,7 @@ void wxDC::DestroyClippingRegion() // on desktop WIN32 also, since the WIN32 docs imply that the user // clipping region is independent from the paint clipping region. ::SelectClipRgn(GetHdc(), 0); -#else +#else // TODO: this should restore the previous clipping region, // so that OnPaint processing works correctly, and the update // clipping region doesn't get destroyed after the first @@ -498,7 +498,7 @@ void wxDC::DestroyClippingRegion() HRGN rgn = CreateRectRgn(0, 0, 32000, 32000); ::SelectClipRgn(GetHdc(), rgn); ::DeleteObject(rgn); -#endif +#endif } wxDCBase::DestroyClippingRegion(); @@ -1488,7 +1488,7 @@ void wxDC::SetFont(const wxFont& font) else // selected ok { if ( !m_oldFont ) - m_oldFont = (WXHPEN)hfont; + m_oldFont = (WXHFONT)hfont; m_font = font; } @@ -1581,7 +1581,7 @@ void wxDC::SetBrush(const wxBrush& brush) else // selected ok { if ( !m_oldBrush ) - m_oldBrush = (WXHPEN)hbrush; + m_oldBrush = (WXHBRUSH)hbrush; m_brush = brush; } @@ -1745,9 +1745,11 @@ void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, wxLogLastError(_T("GetTextExtentPoint32()")); } +#if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400) // the result computed by GetTextExtentPoint32() may be too small as it // accounts for under/overhang of the first/last character while we want // just the bounding rect for this string so adjust the width as needed + // (using API not available in 2002 SDKs of WinCE) if ( len > 0 ) { ABC width; @@ -1769,6 +1771,7 @@ void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, } //else: GetCharABCWidths() failed, not a TrueType font? } +#endif // !defined(_WIN32_WCE) || (_WIN32_WCE >= 400) TEXTMETRIC tm; ::GetTextMetrics(GetHdc(), &tm); @@ -1804,8 +1807,8 @@ bool wxDC::DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) con { // Win9x and WinNT+ have different limits int version = wxGetOsVersion(); - maxLenText = version == wxWINDOWS_NT ? 65535 : 8192; - maxWidth = version == wxWINDOWS_NT ? INT_MAX : 32767; + maxLenText = version == wxOS_WINDOWS_NT ? 65535 : 8192; + maxWidth = version == wxOS_WINDOWS_NT ? INT_MAX : 32767; } widths.Empty();