Tried to prevent scrollbars from scrolling as
per MSW, didn't work. Added DeleteAllItems event and test to listctrl. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -444,11 +444,11 @@ IMPLEMENT_DYNAMIC_CLASS(wxFileCtrl,wxListCtrl);
|
||||
|
||||
BEGIN_EVENT_TABLE(wxFileCtrl,wxListCtrl)
|
||||
EVT_LIST_DELETE_ITEM(-1, wxFileCtrl::OnListDeleteItem)
|
||||
EVT_LIST_DELETE_ALL_ITEMS(-1, wxFileCtrl::OnListDeleteAllItems)
|
||||
EVT_LIST_END_LABEL_EDIT(-1, wxFileCtrl::OnListEndLabelEdit)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
|
||||
wxFileCtrl::wxFileCtrl()
|
||||
{
|
||||
m_dirName = wxT("/");
|
||||
@@ -682,6 +682,23 @@ void wxFileCtrl::OnListDeleteItem( wxListEvent &event )
|
||||
delete fd;
|
||||
}
|
||||
|
||||
void wxFileCtrl::OnListDeleteAllItems( wxListEvent &WXUNUSED(event) )
|
||||
{
|
||||
wxListItem item;
|
||||
item.m_mask = wxLIST_MASK_DATA;
|
||||
|
||||
item.m_itemId = GetNextItem( -1, wxLIST_NEXT_ALL );
|
||||
while ( item.m_itemId != -1 )
|
||||
{
|
||||
GetItem( item );
|
||||
wxFileData *fd = (wxFileData*)item.m_data;
|
||||
delete fd;
|
||||
item.m_data = (void*) NULL;
|
||||
SetItem( item );
|
||||
item.m_itemId = GetNextItem( item.m_itemId, wxLIST_NEXT_ALL );
|
||||
}
|
||||
}
|
||||
|
||||
void wxFileCtrl::OnListEndLabelEdit( wxListEvent &event )
|
||||
{
|
||||
wxFileData *fd = (wxFileData*)event.m_item.m_data;
|
||||
|
Reference in New Issue
Block a user