#pragma hdrstop
#endif
-#if wxUSE_DRAGIMAG
+#if wxUSE_DRAGIMAGE
#if defined(__WIN95__)
#include <commctrl.h>
#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
// ----------------------------------------------------------------------------
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);
// Create a drag image from a string and optional cursor
bool wxDragImage::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;
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
#endif
// __WIN95__
-#endif // wxUSE_DRAGIMAG
+#endif // wxUSE_DRAGIMAGE