X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aa2d25a57aa4ae113e369ea8e08e5da4888e1b66..cd5e9298159e58f57e05f3b76c9d4a45e1eefe12:/src/generic/dragimgg.cpp?ds=inline diff --git a/src/generic/dragimgg.cpp b/src/generic/dragimgg.cpp index 40c71aba6f..8c1b4ab485 100644 --- a/src/generic/dragimgg.cpp +++ b/src/generic/dragimgg.cpp @@ -28,6 +28,8 @@ #pragma hdrstop #endif +#if wxUSE_DRAGIMAGE + #ifndef WX_PRECOMP #include #include "wx/setup.h" @@ -128,7 +130,7 @@ bool wxGenericDragImage::Create(const wxIcon& image, const wxCursor& cursor) // Create a drag image from a string and optional cursor bool wxGenericDragImage::Create(const wxString& str, const wxCursor& cursor) { - wxFont font(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT)); + wxFont font(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); long w, h; wxScreenDC dc; @@ -162,9 +164,9 @@ bool wxGenericDragImage::Create(const wxString& str, const wxCursor& cursor) #if wxUSE_IMAGE_IN_DRAGIMAGE // Make the bitmap masked - wxImage image(bitmap); + wxImage image = bitmap.ConvertToImage(); image.SetMaskColour(255, 255, 255); - bitmap = image.ConvertToBitmap(); + bitmap = wxBitmap(image); #endif return Create(bitmap, cursor); @@ -248,7 +250,9 @@ bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot, (*backing) = wxBitmap(clientSize.x, clientSize.y); if (!m_fullScreen) + { m_windowDC = new wxClientDC(window); + } else { m_windowDC = new wxScreenDC; @@ -368,7 +372,8 @@ bool wxGenericDragImage::Show() bool wxGenericDragImage::UpdateBackingFromWindow(wxDC& windowDC, wxMemoryDC& destDC, const wxRect& sourceRect, const wxRect& destRect) const { - return destDC.Blit(destRect.x, destRect.y, destRect.width, destRect.height, & windowDC, sourceRect.x, sourceRect.y); + return destDC.Blit(destRect.x, destRect.y, destRect.width, destRect.height, & windowDC, + sourceRect.x, sourceRect.y); } bool wxGenericDragImage::Hide() @@ -498,3 +503,4 @@ wxRect wxGenericDragImage::GetImageRect(const wxPoint& pos) const } } +#endif // wxUSE_DRAGIMAGE