X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/155ecd4c4221d3bbc7aa93d472d11948f21d21ab..3d45718de50d193798dee93ce2fe8758f0f0acd6:/src/msw/cursor.cpp diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index 47a2aca746..ec25d16d04 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -34,10 +34,9 @@ #include "wx/settings.h" #include "wx/intl.h" #include "wx/image.h" + #include "wx/module.h" #endif -#include "wx/module.h" - #include "wx/msw/private.h" #include "wx/msw/missing.h" // IDC_HAND @@ -107,7 +106,7 @@ public: virtual void OnExit() { delete gs_globalCursor; - gs_globalCursor = (wxCursor *)NULL; + gs_globalCursor = NULL; } }; @@ -210,46 +209,27 @@ wxCursor::wxCursor(const wxImage& image) HCURSOR hcursor = wxBitmapToHCURSOR( wxBitmap(imageSized), hotSpotX, hotSpotY ); -#if wxUSE_WXDIB if ( !hcursor ) { wxLogWarning(_("Failed to create cursor.")); return; } -#else - HCURSOR hcursor = 0; -#endif m_refData = new wxCursorRefData(hcursor, true /* delete it later */); } -#endif - -wxCursor::wxCursor(const char WXUNUSED(bits)[], - int WXUNUSED(width), - int WXUNUSED(height), - int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY), - const char WXUNUSED(maskBits)[]) -{ -} +#endif // wxUSE_IMAGE // MicroWin doesn't have support needed for the other ctors #ifdef __WXMICROWIN__ -wxCursor::wxCursor(const wxString& WXUNUSED(filename), - long WXUNUSED(kind), - int WXUNUSED(hotSpotX), - int WXUNUSED(hotSpotY)) -{ -} - -wxCursor::wxCursor(int WXUNUSED(cursor_type)) +wxCursor::InitFromStock(wxStockCursor WXUNUSED(cursor_type)) { } #else // !__WXMICROWIN__ wxCursor::wxCursor(const wxString& filename, - long kind, + wxBitmapType kind, int hotSpotX, int hotSpotY) { @@ -257,12 +237,12 @@ wxCursor::wxCursor(const wxString& filename, switch ( kind ) { case wxBITMAP_TYPE_CUR_RESOURCE: - hcursor = ::LoadCursor(wxGetInstance(), filename); + hcursor = ::LoadCursor(wxGetInstance(), filename.fn_str()); break; #ifndef __WXWINCE__ case wxBITMAP_TYPE_CUR: - hcursor = ::LoadCursorFromFile(filename); + hcursor = ::LoadCursorFromFile(filename.fn_str()); break; #endif @@ -285,7 +265,7 @@ wxCursor::wxCursor(const wxString& filename, break; default: - wxFAIL_MSG( _T("unknown cursor resource type") ); + wxLogError( _T("unknown cursor resource type '%d'"), kind ); hcursor = NULL; } @@ -297,7 +277,7 @@ wxCursor::wxCursor(const wxString& filename, } // Cursors by stock number -wxCursor::wxCursor(int idCursor) +void wxCursor::InitFromStock(wxStockCursor idCursor) { // all wxWidgets standard cursors static const struct StdCursor @@ -387,16 +367,6 @@ wxCursor::~wxCursor() // other wxCursor functions // ---------------------------------------------------------------------------- -bool wxCursor::operator==(const wxCursor& cursor) const -{ - if ( !m_refData ) - return !cursor.m_refData; - - return cursor.m_refData && - ((wxCursorRefData *)m_refData)->m_hCursor == - ((wxCursorRefData *)cursor.m_refData)->m_hCursor; -} - wxGDIImageRefData *wxCursor::CreateData() const { return new wxCursorRefData;