X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e624f5ba66250b2139b1ab504cdf2d4794165d6d..139c5871c91e087972789526ac7e85a5f4e94ece:/src/generic/dirctrlg.cpp diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index c1bda3cbd6..8bac497a2f 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -79,7 +79,7 @@ #endif #include #include - +extern bool wxIsDriveAvailable(const wxString& dirName); #endif // __WXPM__ #if defined(__WXMAC__) @@ -459,10 +459,14 @@ bool wxGenericDirCtrl::Create(wxWindow *parent, if ((style & wxDIRCTRL_3D_INTERNAL) == 0) treeStyle |= wxNO_BORDER; + else + treeStyle |= wxBORDER_SUNKEN; long filterStyle = 0; if ((style & wxDIRCTRL_3D_INTERNAL) == 0) filterStyle |= wxNO_BORDER; + else + filterStyle |= wxBORDER_SUNKEN; m_treeCtrl = new wxTreeCtrl(this, wxID_TREECTRL, pos, size, treeStyle); @@ -530,7 +534,7 @@ void wxGenericDirCtrl::AddSection(const wxString& path, const wxString& name, in wxDirItemData *dir_item = new wxDirItemData(path,name,TRUE); wxTreeItemId id = m_treeCtrl->AppendItem( m_rootId, name, imageId, -1, dir_item); - + m_treeCtrl->SetItemHasChildren(id); } @@ -540,7 +544,7 @@ void wxGenericDirCtrl::SetupSections() wxArrayInt icons; size_t n, count = wxGetAvailableDrives(paths, names, icons); - + for (n = 0; n < count; n++) { AddSection(paths[n], names[n], icons[n]); @@ -614,7 +618,9 @@ void wxGenericDirCtrl::OnExpandItem(wxTreeEvent &event) // VS: this is needed because the event handler is called from wxTreeCtrl // ctor when wxTR_HIDE_ROOT was specified - if (m_rootId == 0) + + if (!m_rootId.IsOk()) + m_rootId = m_treeCtrl->GetRootItem(); ExpandDir(parentId);