X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e6f1ad222c5c1597a896dd29e69e1c7aa6459be4..93dfff5ae6ff29195c441e3cd3b4637656e1f76f:/src/msw/dc.cpp diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index fa53cd8b6e..f424405768 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -46,6 +46,9 @@ #include #if wxUSE_COMMON_DIALOGS +#if wxUSE_NORLANDER_HEADERS + #include +#endif #include #endif @@ -591,6 +594,9 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask ) HDC cdc = GetHdc(); HDC memdc = ::CreateCompatibleDC( cdc ); HBITMAP hbitmap = (HBITMAP) bmp.GetHBITMAP( ); + + wxASSERT_MSG( hbitmap, _T("bitmap is ok but HBITMAP is NULL?") ); + ::SelectObject( memdc, hbitmap ); ::BitBlt( cdc, x, y, bmp.GetWidth(), bmp.GetHeight(), memdc, 0, 0, SRCCOPY); ::DeleteDC( memdc ); @@ -638,6 +644,10 @@ void wxDC::DoDrawText(const wxString& text, long x, long y) if (m_textBackgroundColour.Ok()) (void)SetBkColor(GetHdc(), old_background); + // background colour is used only for DrawText, otherwise + // always TRANSPARENT, RR + SetBkMode(GetHdc(), TRANSPARENT); + CalcBoundingBox(x, y); long w, h; @@ -821,10 +831,15 @@ void wxDC::SetBackgroundMode(int mode) { m_backgroundMode = mode; + // SetBackgroundColour now only refers to text background + // and m_backgroundMode is used there + +/* if (m_backgroundMode == wxTRANSPARENT) ::SetBkMode(GetHdc(), TRANSPARENT); else - ::SetBkMode(GetHdc(), OPAQUE); + ::SetBkMode(GetHdc(), OPAQUE); +*/ } void wxDC::SetLogicalFunction(int function)