}
// Gets the item rectangle
-bool wxListCtrl::GetItemRect(long item, wxRectangle& rect, int code) const
+bool wxListCtrl::GetItemRect(long item, wxRect& rect, int code) const
{
RECT rect2;
else return FALSE;
}
-bool wxListCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
+bool wxListCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam, WXLPARAM *result)
{
wxListEvent event(wxEVT_NULL, m_windowId);
wxEventType eventType = wxEVT_NULL;
NMHDR *hdr1 = (NMHDR *) lParam;
switch ( hdr1->code )
{
+ case LVN_BEGINRDRAG:
+ eventType = wxEVT_COMMAND_LIST_BEGIN_RDRAG;
+ // fall through
+
case LVN_BEGINDRAG:
- {
- 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;
- }
+ 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;
wxConvertFromMSWListItem(this, event.m_item, info->item, (HWND) GetHWND());
break;
}
- case LVN_BEGINRDRAG:
- {
- eventType = wxEVT_COMMAND_LIST_BEGIN_RDRAG;
- 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_COLUMNCLICK:
{
eventType = wxEVT_COMMAND_LIST_COL_CLICK;
}
default :
- return wxControl::MSWNotify(wParam, lParam);
- break;
+ return wxControl::MSWNotify(wParam, lParam, result);
}
event.SetEventObject( this );
// wxConvertToMSWListItem(this, event.m_item, info->item);
}
- return TRUE;
+ *result = !event.IsAllowed();
+
+ return TRUE;
}
char *wxListCtrl::AddPool(const wxString& str)
// List event
IMPLEMENT_DYNAMIC_CLASS(wxListEvent, wxCommandEvent)
-wxListEvent::wxListEvent(wxEventType commandType, int id):
- wxCommandEvent(commandType, id)
+wxListEvent::wxListEvent(wxEventType commandType, int id)
+ : wxNotifyEvent(commandType, id)
{
m_code = 0;
m_itemIndex = 0;