]> git.saurik.com Git - wxWidgets.git/commitdiff
Generic dirctrl corrections
authorJulian Smart <julian@anthemion.co.uk>
Thu, 27 Jul 2000 16:34:51 +0000 (16:34 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 27 Jul 2000 16:34:51 +0000 (16:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7878 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/dirctrlg.h
src/generic/dirctrlg.cpp

index 2b05993fe53f50599db0bbc8c444abe1cd402b77..427983e15e58e5e62bfe228ee8d36ab26c04258e 100644 (file)
@@ -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 );
index 027add20e7d2c0775102c690dc0a39ac5a4bd0ed..c9edc46e30dfd35279e10b026c7a44b99e8cccc2 100644 (file)
@@ -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 );