// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE(wxGenericDirCtrl, wxControl)
EVT_TREE_ITEM_EXPANDING (-1, wxGenericDirCtrl::OnExpandItem)
EVT_TREE_ITEM_COLLAPSED (-1, wxGenericDirCtrl::OnCollapseItem)
BEGIN_EVENT_TABLE(wxGenericDirCtrl, wxControl)
EVT_TREE_ITEM_EXPANDING (-1, wxGenericDirCtrl::OnExpandItem)
EVT_TREE_ITEM_COLLAPSED (-1, wxGenericDirCtrl::OnCollapseItem)
/* Workaround because DeleteChildren has disapeared (why?) and
* CollapseAndReset doesn't work as advertised (deletes parent too) */
child = m_treeCtrl->GetFirstChild(parentId, cookie);
/* Workaround because DeleteChildren has disapeared (why?) and
* CollapseAndReset doesn't work as advertised (deletes parent too) */
child = m_treeCtrl->GetFirstChild(parentId, cookie);
if ((GetWindowStyle() & wxDIRCTRL_SELECT_FIRST) && data->m_isDir)
{
// Find the first file in this directory
if ((GetWindowStyle() & wxDIRCTRL_SELECT_FIRST) && data->m_isDir)
{
// Find the first file in this directory
wxTreeItemId childId = m_treeCtrl->GetFirstChild(lastId, cookie);
bool selectedChild = FALSE;
while (childId.IsOk())
wxTreeItemId childId = m_treeCtrl->GetFirstChild(lastId, cookie);
bool selectedChild = FALSE;
while (childId.IsOk())