#include "wx/cursor.h"
#ifndef WX_PRECOMP
- #include "wx/msw/missing.h" // IDC_HAND
#include "wx/utils.h"
#include "wx/app.h"
#include "wx/bitmap.h"
#endif
#include "wx/msw/private.h"
+#include "wx/msw/missing.h" // IDC_HAND
// define functions missing in MicroWin
#ifdef __WXMICROWIN__
virtual void OnExit()
{
delete gs_globalCursor;
- gs_globalCursor = (wxCursor *)NULL;
+ gs_globalCursor = NULL;
}
};
HCURSOR hcursor = wxBitmapToHCURSOR( wxBitmap(imageSized),
hotSpotX, hotSpotY );
-#if wxUSE_WXDIB
if ( !hcursor )
{
wxLogWarning(_("Failed to create cursor."));
return;
}
-#endif // wxUSE_WXDIB
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)
{
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
break;
default:
- wxFAIL_MSG( _T("unknown cursor resource type") );
+ wxLogError( _T("unknown cursor resource type '%d'"), kind );
hcursor = NULL;
}
}
// Cursors by stock number
-wxCursor::wxCursor(int idCursor)
+void wxCursor::InitFromStock(wxStockCursor idCursor)
{
// all wxWidgets standard cursors
static const struct StdCursor