X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a756f210019dd5b51331b7181c816d3882146a30..c6e2af4570ee868c93fc504b02f321efe5d5acee:/src/msw/dragimag.cpp diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp index ababd9e7cd..ae349c83fd 100644 --- a/src/msw/dragimag.cpp +++ b/src/msw/dragimag.cpp @@ -55,6 +55,12 @@ #include #endif +// Wine doesn't have this yet +#ifndef ListView_CreateDragImage +#define ListView_CreateDragImage(hwnd, i, lpptUpLeft) \ + (HIMAGELIST)SNDMSG((hwnd), LVM_CREATEDRAGIMAGE, (WPARAM)(int)(i), (LPARAM)(LPPOINT)(lpptUpLeft)) +#endif + // ---------------------------------------------------------------------------- // macros // ---------------------------------------------------------------------------- @@ -123,8 +129,12 @@ bool wxDragImage::Create(const wxBitmap& image, const wxCursor& cursor) flags = ILC_COLOR32; bool mask = (image.GetMask() != 0); - if ( mask ) - flags |= ILC_MASK; + + // Curiously, even if the image doesn't have a mask, + // we still have to use ILC_MASK or the image won't show + // up when dragged. +// if ( mask ) + flags |= ILC_MASK; m_hImageList = (WXHIMAGELIST) ImageList_Create(image.GetWidth(), image.GetHeight(), flags, 1, 1); @@ -222,11 +232,9 @@ bool wxDragImage::Create(const wxString& str, const wxCursor& cursor) dc2.SelectObject(wxNullBitmap); // Make the bitmap masked - wxImage image(bitmap); + wxImage image = bitmap.ConvertToImage(); image.SetMaskColour(255, 255, 255); - bitmap = image.ConvertToBitmap(); - - return Create(bitmap, cursor); + return Create(wxBitmap(image), cursor); } // Create a drag image for the given tree control item