X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aa2d25a57aa4ae113e369ea8e08e5da4888e1b66..2e1e7f9dfcdea7eb8aa2a03e4a61829bc1a691cc:/src/msw/dragimag.cpp diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp index bff7fab265..ababd9e7cd 100644 --- a/src/msw/dragimag.cpp +++ b/src/msw/dragimag.cpp @@ -23,12 +23,13 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/msw/private.h" #ifdef __BORLANDC__ #pragma hdrstop #endif +#if wxUSE_DRAGIMAGE + #if defined(__WIN95__) #ifndef WX_PRECOMP @@ -41,6 +42,7 @@ #include "wx/settings.h" #endif +#include "wx/msw/private.h" #include "wx/log.h" #include "wx/intl.h" #include "wx/frame.h" @@ -49,7 +51,7 @@ #include "wx/msw/dragimag.h" #include "wx/msw/private.h" -#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__)) +#if defined(__WIN95__) && !((defined(__GNUWIN32_OLD__) || defined(__TWIN32__)) && !defined(__CYGWIN10__)) #include #endif @@ -190,7 +192,7 @@ bool wxDragImage::Create(const wxIcon& image, const wxCursor& cursor) // 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; @@ -258,7 +260,6 @@ bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullS m_boundingRect = * rect; bool ret = (ImageList_BeginDrag(GetHimageList(), 0, hotspot.x, hotspot.y) != 0); - //bool ret = (ImageList_BeginDrag(GetHimageList(), 0, 0, 0) != 0); if (!ret) { @@ -284,6 +285,9 @@ bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullS // See if we can find the cursor hotspot wxPoint curHotSpot(hotspot); + // Although it seems to produce the right position, when the hotspot goeos + // negative it has strange effects on the image. + // How do we stop the cursor jumping right and below of where it should be? #if 0 ICONINFO iconInfo; if (::GetIconInfo((HICON) (HCURSOR) m_cursor.GetHCURSOR(), & iconInfo) != 0) @@ -292,9 +296,9 @@ bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullS curHotSpot.y -= iconInfo.yHotspot; } #endif - wxString msg; - msg.Printf("Hotspot = %d, %d", curHotSpot.x, curHotSpot.y); - wxLogDebug(msg); + //wxString msg; + //msg.Printf("Hotspot = %d, %d", curHotSpot.x, curHotSpot.y); + //wxLogDebug(msg); // First add the cursor to the image list HCURSOR hCursor = (HCURSOR) m_cursor.GetHCURSOR(); @@ -431,3 +435,4 @@ bool wxDragImage::Hide() #endif // __WIN95__ +#endif // wxUSE_DRAGIMAGE