Two fixes for wxListCtrl under XP.
1) Do not use lParam for LVN_HOTTRACK since this doesn't have valid data. 2) Check for item validity in HDN_GETDISPINFOW notification and return TRUE to stop further processing of this strange message. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17592 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1655,6 +1655,10 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
|||||||
// work around is to simply catch both versions and hope that it
|
// work around is to simply catch both versions and hope that it
|
||||||
// works (why should this message exist in ANSI and Unicode is
|
// works (why should this message exist in ANSI and Unicode is
|
||||||
// beyond me as it doesn't deal with strings at all...)
|
// beyond me as it doesn't deal with strings at all...)
|
||||||
|
|
||||||
|
// Tip from www.deja.com: can use CCM_SETUNICODE to set
|
||||||
|
// Unicode or ANSI mode. We might consider doing that for
|
||||||
|
// consistency in ANSI mode.
|
||||||
case HDN_BEGINTRACKA:
|
case HDN_BEGINTRACKA:
|
||||||
case HDN_BEGINTRACKW:
|
case HDN_BEGINTRACKW:
|
||||||
eventType = wxEVT_COMMAND_LIST_COL_BEGIN_DRAG;
|
eventType = wxEVT_COMMAND_LIST_COL_BEGIN_DRAG;
|
||||||
@@ -1713,7 +1717,65 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#if 0
|
||||||
|
case HDN_ITEMCHANGINGW:
|
||||||
|
{
|
||||||
|
return wxControl::MSWOnNotify(idCtrl, lParam, result);
|
||||||
|
}
|
||||||
|
case HDN_ITEMCHANGEDA:
|
||||||
|
{
|
||||||
|
return wxControl::MSWOnNotify(idCtrl, lParam, result);
|
||||||
|
}
|
||||||
|
case HDN_ITEMCHANGEDW:
|
||||||
|
{
|
||||||
|
return wxControl::MSWOnNotify(idCtrl, lParam, result);
|
||||||
|
}
|
||||||
|
case HDN_ITEMCLICKA:
|
||||||
|
{
|
||||||
|
return wxControl::MSWOnNotify(idCtrl, lParam, result);
|
||||||
|
}
|
||||||
|
case HDN_ITEMCLICKW:
|
||||||
|
{
|
||||||
|
return wxControl::MSWOnNotify(idCtrl, lParam, result);
|
||||||
|
}
|
||||||
|
case HDN_ITEMDBLCLICKA:
|
||||||
|
{
|
||||||
|
return wxControl::MSWOnNotify(idCtrl, lParam, result);
|
||||||
|
}
|
||||||
|
case HDN_ITEMDBLCLICKW:
|
||||||
|
{
|
||||||
|
return wxControl::MSWOnNotify(idCtrl, lParam, result);
|
||||||
|
}
|
||||||
|
case HDN_DIVIDERDBLCLICKA:
|
||||||
|
{
|
||||||
|
return wxControl::MSWOnNotify(idCtrl, lParam, result);
|
||||||
|
}
|
||||||
|
case HDN_DIVIDERDBLCLICKW:
|
||||||
|
{
|
||||||
|
return wxControl::MSWOnNotify(idCtrl, lParam, result);
|
||||||
|
}
|
||||||
|
case HDN_GETDISPINFOA:
|
||||||
|
{
|
||||||
|
return wxControl::MSWOnNotify(idCtrl, lParam, result);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
case HDN_GETDISPINFOW:
|
||||||
|
{
|
||||||
|
LPNMHDDISPINFOW info = (LPNMHDDISPINFOW) lParam;
|
||||||
|
// This is a fix for a strange bug under XP.
|
||||||
|
// Normally, info->iItem is a valid index, but
|
||||||
|
// sometimes this is a silly (large) number
|
||||||
|
// and when we return FALSE via wxControl::MSWOnNotify
|
||||||
|
// to indicate that it hasn't yet been processed,
|
||||||
|
// there's a GPF in Windows.
|
||||||
|
// By returning TRUE here, we avoid further processing
|
||||||
|
// of this strange message.
|
||||||
|
if (info->iItem > GetColumnCount())
|
||||||
|
return TRUE;
|
||||||
|
else
|
||||||
|
return wxControl::MSWOnNotify(idCtrl, lParam, result);
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return wxControl::MSWOnNotify(idCtrl, lParam, result);
|
return wxControl::MSWOnNotify(idCtrl, lParam, result);
|
||||||
}
|
}
|
||||||
@@ -1735,7 +1797,9 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
|||||||
case LVN_BEGINRDRAG:
|
case LVN_BEGINRDRAG:
|
||||||
case LVN_COLUMNCLICK:
|
case LVN_COLUMNCLICK:
|
||||||
#ifdef LVN_HOTTRACK
|
#ifdef LVN_HOTTRACK
|
||||||
case LVN_HOTTRACK:
|
// Under XP, this does _not_ give us a valid lParam,
|
||||||
|
// so we get a crash.
|
||||||
|
// case LVN_HOTTRACK:
|
||||||
#endif
|
#endif
|
||||||
case LVN_ITEMCHANGED:
|
case LVN_ITEMCHANGED:
|
||||||
case LVN_ITEMCHANGING:
|
case LVN_ITEMCHANGING:
|
||||||
|
Reference in New Issue
Block a user