wxTreeItemId id = m_treeCtrl->AppendItem( m_rootId, name, imageId, -1, dir_item);
#else
// Unix: sections are displayed as folders
wxTreeItemId id = m_treeCtrl->AppendItem( m_rootId, name, imageId, -1, dir_item);
#else
// Unix: sections are displayed as folders
// Check if this is a root directory and if so,
// whether the drive is avaiable.
if (!wxIsDriveAvailable(dirName))
// Check if this is a root directory and if so,
// whether the drive is avaiable.
if (!wxIsDriveAvailable(dirName))
wxDirItemDataEx *dir_item = new wxDirItemDataEx(path,eachFilename,TRUE);
wxTreeItemId id = m_treeCtrl->AppendItem( parentId, eachFilename, 0, -1, dir_item);
m_treeCtrl->SetItemImage( id, 1, wxTreeItemIcon_Expanded );
wxDirItemDataEx *dir_item = new wxDirItemDataEx(path,eachFilename,TRUE);
wxTreeItemId id = m_treeCtrl->AppendItem( parentId, eachFilename, 0, -1, dir_item);
m_treeCtrl->SetItemImage( id, 1, wxTreeItemIcon_Expanded );
// Has this got any children? If so, make it expandable.
int options = wxDIR_DEFAULT;
if (GetWindowStyle() & wxDIRCTRL_DIR_ONLY) // If only showing dirs, then we specify dirs only here
// Has this got any children? If so, make it expandable.
int options = wxDIR_DEFAULT;
if (GetWindowStyle() & wxDIRCTRL_DIR_ONLY) // If only showing dirs, then we specify dirs only here
// Make sure all separators are as per the current platform
path2.Replace(wxT("\\"), wxString(wxFILE_SEP_PATH));
path2.Replace(wxT("/"), wxString(wxFILE_SEP_PATH));
// Make sure all separators are as per the current platform
path2.Replace(wxT("\\"), wxString(wxFILE_SEP_PATH));
path2.Replace(wxT("/"), wxString(wxFILE_SEP_PATH));
long cookie;
wxTreeItemId childId = m_treeCtrl->GetFirstChild(parentId, cookie);
while (childId.IsOk())
{
wxDirItemDataEx* data = (wxDirItemDataEx*) m_treeCtrl->GetItemData(childId);
long cookie;
wxTreeItemId childId = m_treeCtrl->GetFirstChild(parentId, cookie);
while (childId.IsOk())
{
wxDirItemDataEx* data = (wxDirItemDataEx*) m_treeCtrl->GetItemData(childId);
if (data && data->m_path != "")
{
wxString childPath(data->m_path);
if (childPath.Last() != wxFILE_SEP_PATH)
childPath += wxString(wxFILE_SEP_PATH);
if (data && data->m_path != "")
{
wxString childPath(data->m_path);
if (childPath.Last() != wxFILE_SEP_PATH)
childPath += wxString(wxFILE_SEP_PATH);
if (childPath.Len() <= path2.Len())
{
wxString path3 = path2.Mid(0, childPath.Len());
if (childPath.Len() <= path2.Len())
{
wxString path3 = path2.Mid(0, childPath.Len());
bool done = FALSE;
wxTreeItemId id = FindChild(m_rootId, path, done);
wxTreeItemId lastId = id; // The last non-zero id
bool done = FALSE;
wxTreeItemId id = FindChild(m_rootId, path, done);
wxTreeItemId lastId = id; // The last non-zero id
m_dirCtrl->SetFilterIndex(sel);
// If the filter has changed, the view is out of date, so
m_dirCtrl->SetFilterIndex(sel);
// If the filter has changed, the view is out of date, so