git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60732
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
public:
wxListEvent(wxEventType commandType = wxEVT_NULL, int winid = 0)
: wxNotifyEvent(commandType, winid)
public:
wxListEvent(wxEventType commandType = wxEVT_NULL, int winid = 0)
: wxNotifyEvent(commandType, winid)
- , m_code(0)
- , m_oldItemIndex(0)
- , m_itemIndex(0)
- , m_col(0)
+ , m_code(-1)
+ , m_oldItemIndex(-1)
+ , m_itemIndex(-1)
+ , m_col(-1)
, m_pointDrag()
, m_item()
, m_editCancelled(false)
, m_pointDrag()
, m_item()
, m_editCancelled(false)
wxZeroMemory(lvhti);
#if defined(__WXWINCE__) && !defined(__HANDHELDPC__) && _WIN32_WCE < 400
wxZeroMemory(lvhti);
#if defined(__WXWINCE__) && !defined(__HANDHELDPC__) && _WIN32_WCE < 400
- if(nmhdr->code == GN_CONTEXTMENU) {
- lvhti.pt = ((NMRGINFO*)nmhdr)->ptAction;
- } else
+ if ( nmhdr->code == GN_CONTEXTMENU )
+ {
+ lvhti.pt = ((NMRGINFO*)nmhdr)->ptAction;
+ }
+ else
- ::GetCursorPos(&(lvhti.pt));
- ::ScreenToClient(GetHwnd(),&(lvhti.pt));
- if ( ListView_HitTest(GetHwnd(),&lvhti) != -1 )
+ {
+ ::GetCursorPos(&(lvhti.pt));
+ }
+
+ ::ScreenToClient(GetHwnd(), &lvhti.pt);
+ if ( ListView_HitTest(GetHwnd(), &lvhti) != -1 )
{
if ( lvhti.flags & LVHT_ONITEM )
{
{
if ( lvhti.flags & LVHT_ONITEM )
{
event.SetEventType(eventType);
event.SetEventType(eventType);
+ // fill in the item before passing it to the event handler if we do have a
+ // valid item index and haven't filled it yet (e.g. for LVN_ITEMCHANGED)
+ if ( event.m_itemIndex != -1 && !event.m_item.GetMask() )
+ {
+ wxListItem& item = event.m_item;
+
+ item.SetId(event.m_itemIndex);
+ item.SetMask(wxLIST_MASK_TEXT | wxLIST_MASK_IMAGE | wxLIST_MASK_DATA);
+ GetItem(item);
+ }
+
bool processed = HandleWindowEvent(event);
// post processing
bool processed = HandleWindowEvent(event);
// post processing