From f9c165b1d621341bce1edd840ac71590c5d37f62 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 27 Jul 2000 16:34:51 +0000 Subject: [PATCH] Generic dirctrl corrections git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7878 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/dirctrlg.h | 4 ++-- src/generic/dirctrlg.cpp | 24 ++++++++++++++++-------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/include/wx/generic/dirctrlg.h b/include/wx/generic/dirctrlg.h index 2b05993fe5..427983e15e 100644 --- a/include/wx/generic/dirctrlg.h +++ b/include/wx/generic/dirctrlg.h @@ -75,7 +75,7 @@ public: const wxString &dir = wxDirDialogDefaultFolderStr, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDIRCTRL_3D_INTERNAL, + long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, const wxString& filter = wxEmptyString, int defaultFilter = 0, const wxString& name = wxTreeCtrlNameStr ) @@ -88,7 +88,7 @@ public: const wxString &dir = wxDirDialogDefaultFolderStr, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDIRCTRL_3D_INTERNAL, + long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, const wxString& filter = wxEmptyString, int defaultFilter = 0, const wxString& name = wxTreeCtrlNameStr ); diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index 027add20e7..c9edc46e30 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -722,6 +722,7 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId) wxDir d; wxString eachFilename; + wxLogNull log; d.Open(dirName); if (d.IsOpened()) @@ -743,6 +744,8 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId) // Now do the filenames -- but only if we're allowed to if ((GetWindowStyle() & wxDIRCTRL_DIR_ONLY) == 0) { + wxLogNull log; + d.Open(dirName); if (d.IsOpened()) @@ -783,14 +786,18 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId) options = wxDIR_DIRS; } - wxDir dir2(path); - wxString str; - // Have to test for wxDIR_DIRS separately in case m_currentFilterStr is non-empty and - // and filters out any directories - if (dir2.GetFirst(& str, m_currentFilterStr, options) || dir2.GetFirst(& str, wxEmptyString, wxDIR_DIRS)) + wxLogNull log; + wxDir dir2; + if (dir2.Open(path)) { - m_treeCtrl->SetItemHasChildren(id); - } + wxString str; + // Have to test for wxDIR_DIRS separately in case m_currentFilterStr is non-empty and + // and filters out any directories + if (dir2.GetFirst(& str, m_currentFilterStr, options) || dir2.GetFirst(& str, wxEmptyString, wxDIR_DIRS)) + { + m_treeCtrl->SetItemHasChildren(id); + } + } } // Add the sorted filenames @@ -982,6 +989,7 @@ void wxGenericDirCtrl::FindChildFiles(wxTreeItemId id, int dirFlags, wxArrayStri wxDir d; wxString eachFilename; + wxLogNull log; d.Open(dirName); if (d.IsOpened()) @@ -1180,7 +1188,7 @@ wxGenericDirDialog::wxGenericDirDialog(wxWindow* parent, const wxString& title, // 1) dir ctrl m_dirCtrl = new wxGenericDirCtrl(this, ID_DIRCTRL, defaultPath, wxPoint(5, 5), - wxSize(300, 200), wxDIRCTRL_DIR_ONLY); + wxSize(300, 200), wxDIRCTRL_DIR_ONLY|wxSUNKEN_BORDER); topsizer->Add( m_dirCtrl, 1, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 10 );