deleted (as per wxMSW). Also include the client data
(long value) in the event.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43342
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void MyListCtrl::OnDeleteItem(wxListEvent& event)
{
LogEvent(event, _T("OnDeleteItem"));
void MyListCtrl::OnDeleteItem(wxListEvent& event)
{
LogEvent(event, _T("OnDeleteItem"));
+ wxLogMessage( wxT("Number of items when delete event is sent: %d"), GetItemCount() );
}
void MyListCtrl::OnDeleteAllItems(wxListEvent& event)
}
void MyListCtrl::OnDeleteAllItems(wxListEvent& event)
// send out a wxListEvent
void SendNotify( size_t line,
// send out a wxListEvent
void SendNotify( size_t line,
const wxPoint& point = wxDefaultPosition );
// override base class virtual to reset m_lineHeight when the font changes
const wxPoint& point = wxDefaultPosition );
// override base class virtual to reset m_lineHeight when the font changes
{
wxListEvent le( command, GetParent()->GetId() );
le.SetEventObject( GetParent() );
{
wxListEvent le( command, GetParent()->GetId() );
le.SetEventObject( GetParent() );
le.m_itemIndex = line;
// set only for events which have position
le.m_itemIndex = line;
// set only for events which have position
// program has it anyhow and if we did it would result in accessing all
// the lines, even those which are not visible now and this is precisely
// what we're trying to avoid
// program has it anyhow and if we did it would result in accessing all
// the lines, even those which are not visible now and this is precisely
// what we're trying to avoid
- if ( !IsVirtual() && (command != wxEVT_COMMAND_LIST_DELETE_ITEM) )
{
if ( line != (size_t)-1 )
{
{
if ( line != (size_t)-1 )
{
if ( m_current != index || m_current == count - 1 )
m_current--;
}
if ( m_current != index || m_current == count - 1 )
m_current--;
}
- // mark the Column Max Width cache as dirty if the items in the line
- // we're deleting contain the Max Column Width
+ // mark the Column Max Width cache as dirty if the items in the line
+ // we're deleting contain the Max Column Width
wxListLineData * const line = GetLine(index);
wxListItemDataList::compatibility_iterator n;
wxListItemData *itemData;
wxListLineData * const line = GetLine(index);
wxListItemDataList::compatibility_iterator n;
wxListItemData *itemData;
ResetVisibleLinesRange();
}
ResetVisibleLinesRange();
}
+ SendNotify( index, wxEVT_COMMAND_LIST_DELETE_ITEM, wxDefaultPosition );
+
if ( IsVirtual() )
{
m_countVirt--;
if ( IsVirtual() )
{
m_countVirt--;
// we need to refresh the (vert) scrollbar as the number of items changed
m_dirty = true;
// we need to refresh the (vert) scrollbar as the number of items changed
m_dirty = true;
- SendNotify( index, wxEVT_COMMAND_LIST_DELETE_ITEM );
-