Fixed bug [ 413614 ] native wxDragImage w/o mask is broken

by adding ILC_MASK even when there's no mask.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17339 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-09-22 14:32:23 +00:00
parent 91bbbdf8a6
commit 556469d8ba
2 changed files with 14 additions and 2 deletions

View File

@@ -28,6 +28,14 @@ override \helpref{wxDragImage::DoDrawImage}{wxdragimagedodrawimage} and
Please see {\tt samples/dragimag} for an example. Please see {\tt samples/dragimag} for an example.
%\wxheading{Notes}
%
%Using the native Windows implementation, you must supply an image with a mask, or
%the image will not show when dragged. It is not clear if this is a bug
%in Windows or in the wxDragImage implementation. You can add a mask
%with a call to wxImage::SetMaskColour, passing RGB values not likely
%to be in the image. [CURED by creating the ImageList with ILC_MASK]
\wxheading{Derived from} \wxheading{Derived from}
\helpref{wxObject}{wxobject} \helpref{wxObject}{wxobject}

View File

@@ -129,8 +129,12 @@ bool wxDragImage::Create(const wxBitmap& image, const wxCursor& cursor)
flags = ILC_COLOR32; flags = ILC_COLOR32;
bool mask = (image.GetMask() != 0); 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); m_hImageList = (WXHIMAGELIST) ImageList_Create(image.GetWidth(), image.GetHeight(), flags, 1, 1);