]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed bug preventing dir enumeration from working on WinCE
authorJulian Smart <julian@anthemion.co.uk>
Sat, 2 Apr 2005 17:38:14 +0000 (17:38 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sat, 2 Apr 2005 17:38:14 +0000 (17:38 +0000)
Prevented crash on WinCE by removing hidden root style
(a bug in Windows causes crash in child traversal/data retrieval)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/dirctrlg.cpp

index d792d8e4d20a72f1d8210e944c5b9c3d1975a809..33941724771f36876db5d05e3e7eef657710fc61 100644 (file)
@@ -524,7 +524,13 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
 
     Init();
 
-    long treeStyle = wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT;
+    long treeStyle = wxTR_HAS_BUTTONS;
+
+    // On Windows CE, if you hide the root, you get a crash when
+    // attempting to access data for children of the root item.
+#ifndef __WXWINCE__
+    treeStyle |= wxTR_HIDE_ROOT;
+#endif
 
 #ifdef __WXGTK20__
     treeStyle |= wxTR_NO_LINES;
@@ -771,7 +777,7 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId)
 
     wxString dirName(data->m_path);
 
-#if defined(__WINDOWS__) || defined(__DOS__) || defined(__OS2__)
+#if (defined(__WINDOWS__) && !defined(__WXWINCE__)) || defined(__DOS__) || defined(__OS2__)
     // Check if this is a root directory and if so,
     // whether the drive is avaiable.
     if (!wxIsDriveAvailable(dirName))