]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/dirctrlg.cpp
add -mno-cygwin detection: we should treat cygwin as Windows, not Unix, when it's...
[wxWidgets.git] / src / generic / dirctrlg.cpp
index 1fbd5e997bf1f54365556e1ad91c641963375d6c..5b9bc12d62cb02c5ccefd2052c94a8dfaab949f2 100644 (file)
     #include "wx/sizer.h"
     #include "wx/textdlg.h"
     #include "wx/gdicmn.h"
+    #include "wx/image.h"
+    #include "wx/module.h"
 #endif
 
-#include "wx/module.h"
 #include "wx/filefn.h"
 #include "wx/imaglist.h"
 #include "wx/tokenzr.h"
 #include "wx/dir.h"
 #include "wx/artprov.h"
 #include "wx/mimetype.h"
-#include "wx/image.h"
 
 #if wxUSE_STATLINE
     #include "wx/statline.h"
@@ -121,14 +121,8 @@ size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, wxArrayI
         path.Printf(wxT("%c:\\"), driveBuffer[i]);
         name.Printf(wxT("%c:"), driveBuffer[i]);
 
-#if !defined(__WXWINCE__)
-        wxChar pname[52]; // FIXME: why 52 and not MAX_PATH or whatever?
-        if ( GetVolumeInformation(path, pname, WXSIZEOF(pname),
-                                  NULL, NULL, NULL, NULL, 0) )
-        {
-            name << _T(' ') << pname;
-        }
-#endif // __WXWINCE__
+        // Do not use GetVolumeInformation to further decorate the
+        // name, since it can cause severe delays on network drives.
 
         int imageId;
         int driveType = ::GetDriveType(path);
@@ -550,6 +544,7 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
         return false;
 
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
+    SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
 
     Init();
 
@@ -618,7 +613,7 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
 
     ExpandRoot();
 
-    SetBestSize(size);
+    SetInitialSize(size);
     DoResize();
 
     return true;
@@ -704,8 +699,8 @@ void wxGenericDirCtrl::OnEndEditItem(wxTreeEvent &event)
         return;
 
     if ((event.GetLabel().empty()) ||
-        (event.GetLabel() == _(".")) ||
-        (event.GetLabel() == _("..")) ||
+        (event.GetLabel() == wxT(".")) ||
+        (event.GetLabel() == wxT("..")) ||
         (event.GetLabel().Find(wxT('/')) != wxNOT_FOUND) ||
         (event.GetLabel().Find(wxT('\\')) != wxNOT_FOUND) ||
         (event.GetLabel().Find(wxT('|')) != wxNOT_FOUND))