+ case LVN_BEGINRDRAG:
+ eventType = wxEVT_COMMAND_LIST_BEGIN_RDRAG;
+ // fall through
+
+ case LVN_BEGINDRAG:
+ if ( eventType == wxEVT_NULL )
+ {
+ eventType = wxEVT_COMMAND_LIST_BEGIN_DRAG;
+ }
+
+ {
+ NM_LISTVIEW *hdr = (NM_LISTVIEW *)lParam;
+ event.m_itemIndex = hdr->iItem;
+ event.m_pointDrag.x = hdr->ptAction.x;
+ event.m_pointDrag.y = hdr->ptAction.y;
+ }
+ break;
+
+ case LVN_BEGINLABELEDIT:
+ {
+ eventType = wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT;
+ LV_DISPINFO *info = (LV_DISPINFO *)lParam;
+ wxConvertFromMSWListItem(this, event.m_item, info->item, (HWND) GetHWND());
+ break;
+ }
+
+ case LVN_COLUMNCLICK:
+ {
+ eventType = wxEVT_COMMAND_LIST_COL_CLICK;
+ NM_LISTVIEW* hdr = (NM_LISTVIEW*)lParam;
+ event.m_itemIndex = -1;
+ event.m_col = hdr->iSubItem;
+ break;
+ }
+ case LVN_DELETEALLITEMS:
+ {
+ eventType = wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS;
+ // NM_LISTVIEW* hdr = (NM_LISTVIEW*)lParam;
+ event.m_itemIndex = -1;
+ break;
+ }
+ case LVN_DELETEITEM:
+ {
+ eventType = wxEVT_COMMAND_LIST_DELETE_ITEM;
+ NM_LISTVIEW* hdr = (NM_LISTVIEW*)lParam;
+ event.m_itemIndex = hdr->iItem;
+ break;
+ }
+ case LVN_ENDLABELEDIT:
+ {
+ eventType = wxEVT_COMMAND_LIST_END_LABEL_EDIT;
+ LV_DISPINFO *info = (LV_DISPINFO *)lParam;
+ wxConvertFromMSWListItem(this, event.m_item, info->item, (HWND) GetHWND());
+ if ( info->item.pszText == NULL || info->item.iItem == -1 )
+ event.m_cancelled = TRUE;
+ break;
+ }
+ case LVN_GETDISPINFO:
+ {
+ // return FALSE;
+ // TODO: some text buffering here, I think
+ // TODO: API for getting Windows to retrieve values
+ // on demand.
+ eventType = wxEVT_COMMAND_LIST_GET_INFO;
+ LV_DISPINFO *info = (LV_DISPINFO *)lParam;
+ wxConvertFromMSWListItem(this, event.m_item, info->item, (HWND) GetHWND());
+ break;
+ }
+ case LVN_INSERTITEM:
+ {
+ eventType = wxEVT_COMMAND_LIST_INSERT_ITEM;
+ NM_LISTVIEW* hdr = (NM_LISTVIEW*)lParam;
+ event.m_itemIndex = hdr->iItem;
+ break;
+ }
+ case LVN_ITEMCHANGED:
+ {
+ // This needs to be sent to wxListCtrl as a rather more
+ // concrete event. For now, just detect a selection
+ // or deselection.
+ NM_LISTVIEW* hdr = (NM_LISTVIEW*)lParam;
+ if ( (hdr->uNewState & LVIS_SELECTED) && !(hdr->uOldState & LVIS_SELECTED) )
+ {
+ eventType = wxEVT_COMMAND_LIST_ITEM_SELECTED;
+ event.m_itemIndex = hdr->iItem;
+ }
+ else if ( !(hdr->uNewState & LVIS_SELECTED) && (hdr->uOldState & LVIS_SELECTED) )
+ {
+ eventType = wxEVT_COMMAND_LIST_ITEM_DESELECTED;
+ event.m_itemIndex = hdr->iItem;
+ }
+ else
+ return FALSE;
+ break;
+ }
+ case LVN_KEYDOWN:
+ {
+ eventType = wxEVT_COMMAND_LIST_KEY_DOWN;
+ LV_KEYDOWN *info = (LV_KEYDOWN *)lParam;
+ event.m_code = wxCharCodeMSWToWX(info->wVKey);
+ break;
+ }
+ case LVN_SETDISPINFO:
+ {
+ eventType = wxEVT_COMMAND_LIST_SET_INFO;
+ LV_DISPINFO *info = (LV_DISPINFO *)lParam;
+ wxConvertFromMSWListItem(this, event.m_item, info->item, (HWND) GetHWND());
+ break;
+ }
+
+ default :
+ return wxControl::MSWOnNotify(idCtrl, lParam, result);