]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/dirctrlg.cpp
cleaned up the checkbox creation code (~70 lines of code became 3)
[wxWidgets.git] / src / generic / dirctrlg.cpp
index 417ad1069fdf6e6490a86786fc77cc02c16ac046..6d7b7c2158381ccc847b38c71cfb6c75754a8751 100644 (file)
@@ -407,7 +407,7 @@ static int LINKAGEMODE wxDirCtrlStringCompareFunction(const void *first, const v
 {
     wxString *strFirst = (wxString *)first;
     wxString *strSecond = (wxString *)second;
-    
+
     return strFirst->CmpNoCase(*strSecond);
 }
 
@@ -454,7 +454,7 @@ bool wxDirItemData::HasSubDirs() const
     return dir.HasSubDirs();
 }
 
-bool wxDirItemData::HasFiles(const wxString& spec) const
+bool wxDirItemData::HasFiles(const wxString& WXUNUSED(spec)) const
 {
     if (m_path.IsEmpty())
         return FALSE;
@@ -505,7 +505,12 @@ bool wxGenericDirCtrl::Create(wxWindow *parent,
 
     Init();
 
-    long treeStyle = wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS | wxTR_HIDE_ROOT;
+    long treeStyle = wxTR_HAS_BUTTONS ; // | wxTR_EDIT_LABELS ;
+
+#ifndef __WXMSW__
+    treeStyle |= wxTR_HIDE_ROOT;
+#endif
+
     if ((style & wxDIRCTRL_3D_INTERNAL) == 0)
         treeStyle |= wxNO_BORDER;
 
@@ -578,8 +583,11 @@ void wxGenericDirCtrl::Init()
 void wxGenericDirCtrl::ShowHidden( bool show )
 {
     m_showHidden = show;
-    
-    // reparse FIXME 
+
+    wxString path = GetPath();
+    m_treeCtrl->Collapse(m_treeCtrl->GetRootItem());
+    m_treeCtrl->Expand(m_treeCtrl->GetRootItem());
+    SetPath(path);
 }
 
 void wxGenericDirCtrl::AddSection(const wxString& path, const wxString& name, int imageId)
@@ -1176,6 +1184,14 @@ void wxGenericDirCtrl::DoResize()
         wxSize filterSz ;
         if (m_filterListCtrl)
         {
+#ifdef __WXMSW__
+            // For some reason, this is required in order for the
+            // correct control height to always be returned, rather
+            // than the drop-down list height which is sometimes returned.
+            wxSize oldSize = m_filterListCtrl->GetSize();
+            m_filterListCtrl->SetSize(-1, -1, oldSize.x+10, -1, wxSIZE_USE_EXISTING);
+            m_filterListCtrl->SetSize(-1, -1, oldSize.x, -1, wxSIZE_USE_EXISTING);
+#endif
             filterSz = m_filterListCtrl->GetSize();
             sz.y -= (filterSz.y + verticalSpacing);
         }