]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/dirctrlg.cpp
Removed redundant m_left etc. variables
[wxWidgets.git] / src / generic / dirctrlg.cpp
index 027add20e7d2c0775102c690dc0a39ac5a4bd0ed..b07deb10864606771db2d856be7000b77366de26 100644 (file)
@@ -441,14 +441,14 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
     m_imageList->Add(wxIcon(icon7_xpm));
     m_imageList->Add(wxIcon(icon8_xpm));
 #elif defined(__WXMSW__)
-    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_CLOSED_FOLDER"), wxBITMAP_TYPE_RESOURCE));
-    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_OPEN_FOLDER"), wxBITMAP_TYPE_RESOURCE));
-    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_FILE"), wxBITMAP_TYPE_RESOURCE));
-    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_COMPUTER"), wxBITMAP_TYPE_RESOURCE));
-    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_DRIVE"), wxBITMAP_TYPE_RESOURCE));
-    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_CDROM"), wxBITMAP_TYPE_RESOURCE));
-    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_FLOPPY"), wxBITMAP_TYPE_RESOURCE));
-    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_REMOVEABLE"), wxBITMAP_TYPE_RESOURCE));
+    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_CLOSED_FOLDER"), wxBITMAP_TYPE_ICO_RESOURCE));
+    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_OPEN_FOLDER"), wxBITMAP_TYPE_ICO_RESOURCE));
+    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_FILE"), wxBITMAP_TYPE_ICO_RESOURCE));
+    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_COMPUTER"), wxBITMAP_TYPE_ICO_RESOURCE));
+    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_DRIVE"), wxBITMAP_TYPE_ICO_RESOURCE));
+    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_CDROM"), wxBITMAP_TYPE_ICO_RESOURCE));
+    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_FLOPPY"), wxBITMAP_TYPE_ICO_RESOURCE));
+    m_imageList->Add(wxIcon(wxT("wxICON_SMALL_REMOVEABLE"), wxBITMAP_TYPE_ICO_RESOURCE));
 #else
 #error "Sorry, we don't have icons available for this platforms."
 #endif
@@ -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 );