From c3f482c546e3a82587a1a20b18929a9d360ba9f3 Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Wed, 18 Sep 2002 19:57:53 +0000 Subject: [PATCH] Fix wxListEvent::GetData git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/listctrl.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 524a9413f4..93a644aa27 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -1720,7 +1720,30 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) NM_LISTVIEW *nmLV = (NM_LISTVIEW *)nmhdr; // this is true for almost all events - event.m_item.m_data = nmLV->lParam; + switch( nmLV->hdr.code ) + { + case LVN_BEGINDRAG: + case LVN_BEGINRDRAG: + case LVN_COLUMNCLICK: +#ifdef LVN_HOTTRACK + case LVN_HOTTRACK: +#endif + case LVN_ITEMCHANGED: + case LVN_ITEMCHANGING: + { + wxListItemInternalData *internaldata = + (wxListItemInternalData *) nmLV->lParam; + + // from PSDK: "This member is undefined for notification + // messages that do not use it." + // Now, which notifications do not use it? + if (nmLV->iItem != -1 && internaldata) + event.m_item.m_data = internaldata->lParam; + } + default: + // fall through + ; + } switch ( nmhdr->code ) {