X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..96c9640205933ad0673d5af2c96af0816c50160c:/src/msw/cursor.cpp diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index fbcf62dd75..bb932667b1 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -105,8 +105,7 @@ public: virtual void OnExit() { - delete gs_globalCursor; - gs_globalCursor = NULL; + wxDELETE(gs_globalCursor); } }; @@ -237,12 +236,12 @@ wxCursor::wxCursor(const wxString& filename, switch ( kind ) { case wxBITMAP_TYPE_CUR_RESOURCE: - hcursor = ::LoadCursor(wxGetInstance(), filename.fn_str()); + hcursor = ::LoadCursor(wxGetInstance(), filename.t_str()); break; #ifndef __WXWINCE__ case wxBITMAP_TYPE_CUR: - hcursor = ::LoadCursorFromFile(filename.fn_str()); + hcursor = ::LoadCursorFromFile(filename.t_str()); break; #endif @@ -294,15 +293,8 @@ void wxCursor::InitFromStock(wxStockCursor idCursor) { false, wxT("WXCURSOR_RIGHT_ARROW") }, // wxCURSOR_RIGHT_ARROW { false, wxT("WXCURSOR_BULLSEYE") }, // wxCURSOR_BULLSEYE { true, IDC_ARROW }, // WXCURSOR_CHAR - - // Displays as an I-beam on XP, so use a cursor file -// { true, IDC_CROSS }, // WXCURSOR_CROSS - { false, wxT("WXCURSOR_CROSS") }, // WXCURSOR_CROSS - - // See special handling below for wxCURSOR_HAND -// { false, wxT("WXCURSOR_HAND") }, // wxCURSOR_HAND + { true, IDC_CROSS }, // WXCURSOR_CROSS { true, IDC_HAND }, // wxCURSOR_HAND - { true, IDC_IBEAM }, // WXCURSOR_IBEAM { true, IDC_ARROW }, // WXCURSOR_LEFT_BUTTON { false, wxT("WXCURSOR_MAGNIFIER") }, // wxCURSOR_MAGNIFIER @@ -349,6 +341,15 @@ void wxCursor::InitFromStock(wxStockCursor idCursor) if ( !hcursor ) { + if ( !stdCursor.isStd ) + { + // it may be not obvious to the programmer why did loading fail, + // try to help by pointing to the by far the most probable reason + wxFAIL_MSG(wxT("Loading a cursor defined by wxWidgets failed, ") + wxT("did you include include/wx/msw/wx.rc file from ") + wxT("your resource file?")); + } + wxLogLastError(wxT("LoadCursor")); } else @@ -383,7 +384,7 @@ const wxCursor *wxGetGlobalCursor() void wxSetCursor(const wxCursor& cursor) { - if ( cursor.Ok() ) + if ( cursor.IsOk() ) { ::SetCursor(GetHcursorOf(cursor));