if ( event.LeftDown() )
SetFocus();
- event.SetEventObject( GetParent() );
- if ( GetParent()->GetEventHandler()->ProcessEvent( event) )
+ // Pretend that the event happened in wxListCtrl itself.
+ wxMouseEvent me(event);
+ me.SetEventObject( GetParent() );
+ me.SetId(GetParent()->GetId());
+ if ( GetParent()->GetEventHandler()->ProcessEvent( me ))
return;
if (event.GetEventType() == wxEVT_MOUSEWHEEL)
// propagate the key event upwards
wxKeyEvent ke(event);
ke.SetEventObject( parent );
+ ke.SetId(GetParent()->GetId());
if (parent->GetEventHandler()->ProcessEvent( ke ))
return;
// propagate the key event upwards
wxKeyEvent ke(event);
+ ke.SetEventObject( parent );
+ ke.SetId(GetParent()->GetId());
if (parent->GetEventHandler()->ProcessEvent( ke ))
return;
// propagate the char event upwards
wxKeyEvent ke(event);
ke.SetEventObject( parent );
+ ke.SetId(GetParent()->GetId());
if (parent->GetEventHandler()->ProcessEvent( ke ))
return;
RefreshLines(id, GetItemCount() - 1);
}
-void wxListMainWindow::InsertColumn( long col, const wxListItem &item )
+long wxListMainWindow::InsertColumn( long col, const wxListItem &item )
{
+ long idx = -1;
+
m_dirty = true;
if ( InReportView() )
{
node = m_columns.Item( col );
m_columns.Insert( node, column );
m_aColWidths.Insert( colWidthInfo, col );
+ idx = col;
}
else
{
+ idx = m_aColWidths.GetCount();
m_columns.Append( column );
m_aColWidths.Add( colWidthInfo );
}
// invalidate it as it has to be recalculated
m_headerWidth = 0;
}
+ return idx;
}
int wxListMainWindow::GetItemWidthWithImage(wxListItem * item)
{
wxCHECK_MSG( InReportView(), -1, wxT("can't add column in non report mode") );
- m_mainWin->InsertColumn( col, item );
+ long idx = m_mainWin->InsertColumn( col, item );
// NOTE: if wxLC_NO_HEADER was given, then we are in report view mode but
// still have m_headerWin==NULL
if (m_headerWin)
m_headerWin->Refresh();
- return 0;
+ return idx;
}
bool wxGenericListCtrl::ScrollList( int dx, int dy )