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
This commit is contained in:
@@ -311,10 +311,15 @@ wxCursor::wxCursor(int idCursor)
|
|||||||
{ false, _T("WXCURSOR_RIGHT_ARROW") }, // wxCURSOR_RIGHT_ARROW
|
{ false, _T("WXCURSOR_RIGHT_ARROW") }, // wxCURSOR_RIGHT_ARROW
|
||||||
{ false, _T("WXCURSOR_BULLSEYE") }, // wxCURSOR_BULLSEYE
|
{ false, _T("WXCURSOR_BULLSEYE") }, // wxCURSOR_BULLSEYE
|
||||||
{ true, IDC_ARROW }, // WXCURSOR_CHAR
|
{ true, IDC_ARROW }, // WXCURSOR_CHAR
|
||||||
|
|
||||||
// Displays as an I-beam on XP, so use a cursor file
|
// Displays as an I-beam on XP, so use a cursor file
|
||||||
// { true, IDC_CROSS }, // WXCURSOR_CROSS
|
// { true, IDC_CROSS }, // WXCURSOR_CROSS
|
||||||
{ false, _T("WXCURSOR_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_IBEAM }, // WXCURSOR_IBEAM
|
||||||
{ true, IDC_ARROW }, // WXCURSOR_LEFT_BUTTON
|
{ true, IDC_ARROW }, // WXCURSOR_LEFT_BUTTON
|
||||||
{ false, _T("WXCURSOR_MAGNIFIER") }, // wxCURSOR_MAGNIFIER
|
{ false, _T("WXCURSOR_MAGNIFIER") }, // wxCURSOR_MAGNIFIER
|
||||||
@@ -347,18 +352,25 @@ wxCursor::wxCursor(int idCursor)
|
|||||||
_T("invalid cursor id in wxCursor() ctor") );
|
_T("invalid cursor id in wxCursor() ctor") );
|
||||||
|
|
||||||
const StdCursor& stdCursor = stdCursors[idCursor];
|
const StdCursor& stdCursor = stdCursors[idCursor];
|
||||||
|
bool deleteLater = !stdCursor.isStd;
|
||||||
|
|
||||||
HCURSOR hcursor = ::LoadCursor(stdCursor.isStd ? NULL : wxGetInstance(),
|
HCURSOR hcursor = ::LoadCursor(stdCursor.isStd ? NULL : wxGetInstance(),
|
||||||
stdCursor.name);
|
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 )
|
if ( !hcursor )
|
||||||
{
|
{
|
||||||
wxLogLastError(_T("LoadCursor"));
|
wxLogLastError(_T("LoadCursor"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_refData = new wxCursorRefData(hcursor,
|
m_refData = new wxCursorRefData(hcursor, deleteLater);
|
||||||
!stdCursor.isStd /* delete it later */);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user