X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..623d5f80029803f1394e89732e16e19e82a22e2a:/src/generic/dragimgg.cpp diff --git a/src/generic/dragimgg.cpp b/src/generic/dragimgg.cpp index c931955788..40b92e410b 100644 --- a/src/generic/dragimgg.cpp +++ b/src/generic/dragimgg.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dragimgg.cpp +// Name: src/generic/dragimgg.cpp // Purpose: Generic wxDragImage implementation // Author: Julian Smart // Modified by: @@ -21,31 +21,26 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #if wxUSE_DRAGIMAGE #ifndef WX_PRECOMP -#include -#include "wx/setup.h" -#include "wx/window.h" -#include "wx/frame.h" -#include "wx/dcclient.h" -#include "wx/dcscreen.h" -#include "wx/dcmemory.h" -#include "wx/settings.h" + #include + #include "wx/window.h" + #include "wx/frame.h" + #include "wx/dcclient.h" + #include "wx/dcscreen.h" + #include "wx/dcmemory.h" + #include "wx/settings.h" + #include "wx/intl.h" + #include "wx/log.h" + #include "wx/image.h" #endif -#include "wx/log.h" -#include "wx/intl.h" - #define wxUSE_IMAGE_IN_DRAGIMAGE 1 -#if wxUSE_IMAGE_IN_DRAGIMAGE -#include "wx/image.h" -#endif - #include "wx/generic/dragimgg.h" // ---------------------------------------------------------------------------- @@ -80,6 +75,55 @@ void wxGenericDragImage::Init() m_pBackingBitmap = (wxBitmap*) NULL; } +#if WXWIN_COMPATIBILITY_2_6 +wxGenericDragImage::wxGenericDragImage(const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + Init(); + Create(cursor); +} + +wxGenericDragImage::wxGenericDragImage(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + Init(); + + Create(image, cursor); +} + +wxGenericDragImage::wxGenericDragImage(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + Init(); + + Create(image, cursor); +} + +wxGenericDragImage::wxGenericDragImage(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + Init(); + + Create(str, cursor); +} + +bool wxGenericDragImage::Create(const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + return Create(cursor); +} + +bool wxGenericDragImage::Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + return Create(image, cursor); +} + +bool wxGenericDragImage::Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + return Create(image, cursor); +} + +bool wxGenericDragImage::Create(const wxString& str, const wxCursor& cursor, const wxPoint& WXUNUSED(cursorHotspot)) +{ + return Create(str, cursor); +} +#endif // WXWIN_COMPATIBILITY_2_6 + // Attributes //////////////////////////////////////////////////////////////////////////// @@ -124,7 +168,7 @@ bool wxGenericDragImage::Create(const wxString& str, const wxCursor& cursor) { wxFont font(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); - long w, h; + long w = 0, h = 0; wxScreenDC dc; dc.SetFont(font); dc.GetTextExtent(str, & w, & h); @@ -154,7 +198,7 @@ bool wxGenericDragImage::Create(const wxString& str, const wxCursor& cursor) dc2.SelectObject(wxNullBitmap); -#if wxUSE_IMAGE_IN_DRAGIMAGE +#if wxUSE_IMAGE_IN_DRAGIMAGE && (!defined(__WXMSW__) || wxUSE_WXDIB) // Make the bitmap masked wxImage image = bitmap.ConvertToImage(); image.SetMaskColour(255, 255, 255);