From fe384096fa2b54d67d1ec4e86434bf9f1e338b9d Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 1 Jun 2005 00:11:02 +0000 Subject: [PATCH] Try IDC_HAND first and then load "WXCURSOR_HAND" if it fails git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/cursor.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index 41120c1fc3..c0e03b7add 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -311,10 +311,15 @@ wxCursor::wxCursor(int idCursor) { false, _T("WXCURSOR_RIGHT_ARROW") }, // wxCURSOR_RIGHT_ARROW { false, _T("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, _T("WXCURSOR_CROSS") }, // WXCURSOR_CROSS - { false, _T("WXCURSOR_HAND") }, // wxCURSOR_HAND + + // See special handling below for wxCURSOR_HAND +// { false, _T("WXCURSOR_HAND") }, // wxCURSOR_HAND + { true, IDC_HAND }, // wxCURSOR_HAND + { true, IDC_IBEAM }, // WXCURSOR_IBEAM { true, IDC_ARROW }, // WXCURSOR_LEFT_BUTTON { false, _T("WXCURSOR_MAGNIFIER") }, // wxCURSOR_MAGNIFIER @@ -347,18 +352,25 @@ wxCursor::wxCursor(int idCursor) _T("invalid cursor id in wxCursor() ctor") ); const StdCursor& stdCursor = stdCursors[idCursor]; + bool deleteLater = !stdCursor.isStd; HCURSOR hcursor = ::LoadCursor(stdCursor.isStd ? NULL : wxGetInstance(), stdCursor.name); + // IDC_HAND may not be available on some versions of Windows. + if ( !hcursor && idCursor == wxCURSOR_HAND) + { + hcursor = ::LoadCursor(wxGetInstance(), _T("WXCURSOR_HAND")); + deleteLater = true; + } + if ( !hcursor ) { wxLogLastError(_T("LoadCursor")); } else { - m_refData = new wxCursorRefData(hcursor, - !stdCursor.isStd /* delete it later */); + m_refData = new wxCursorRefData(hcursor, deleteLater); } } -- 2.45.2