X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/29686ebc000a1d95ae56a58b9ff2a5a6f23eed84..50d4763f1710f6e45ac6af7112d1ce9effe93bc4:/src/generic/listctrl.cpp diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index ddd950997a..2b1a22df1e 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -342,12 +342,23 @@ bool wxListHeaderData::IsHit( int x, int y ) const void wxListHeaderData::GetItem( wxListItem& item ) { - item.m_mask = m_mask; - item.m_text = m_text; - item.m_image = m_image; - item.m_format = m_format; - item.m_width = m_width; - item.m_state = m_state; + long mask = item.m_mask; + if ( !mask ) + { + // by default, get everything for backwards compatibility + mask = -1; + } + + if ( mask & wxLIST_MASK_STATE ) + item.m_state = m_state; + if ( mask & wxLIST_MASK_TEXT ) + item.m_text = m_text; + if ( mask & wxLIST_MASK_IMAGE ) + item.m_image = m_image; + if ( mask & wxLIST_MASK_WIDTH ) + item.m_width = m_width; + if ( mask & wxLIST_MASK_FORMAT ) + item.m_format = m_format; } int wxListHeaderData::GetImage() const @@ -2412,12 +2423,7 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event ) int command = event.RightIsDown() ? wxEVT_COMMAND_LIST_BEGIN_RDRAG : wxEVT_COMMAND_LIST_BEGIN_DRAG; - wxListEvent le( command, GetParent()->GetId() ); - le.SetEventObject( GetParent() ); - le.m_item.m_itemId = - le.m_itemIndex = m_lineLastClicked; - le.m_pointDrag = m_dragStart; - GetParent()->GetEventHandler()->ProcessEvent( le ); + SendNotify( m_lineLastClicked, command, m_dragStart ); return; } @@ -2754,18 +2760,6 @@ void wxListMainWindow::OnCharHook( wxKeyEvent &event ) void wxListMainWindow::OnChar( wxKeyEvent &event ) { -#ifdef __WXGTK__ - // Under GTK we get some keys (notably cursor arrows) even while the in - // place editing control is shown. Processing them here results in UI - // problems, e.g. we could change the current item on WXK_DOWN press but - // the edit control would remain on the item above. So we need to either - // cancel in-place editing or ignore any such keys while it's active. To - // avoid aggravating the user by losing his changes just because a cursor - // arrow key was mistakenly pressed, do nothing in this case. - if ( m_textctrlWrapper ) - return; -#endif // __WXGTK__ - wxWindow *parent = GetParent(); // propagate the char event upwards