- Fixed bug with ignoring blank lines in multiline wxGrid cell labels
 - Added wxTextAttr::Merge() (Marcin Simonides)
 - Added wxTB_NO_TOOLTIPS style (Igor Korot)
+- Added wxGenericDirCtrl::CollapsePath() (Christian Buhtz)
 
 wxMSW:
 
 
 
 Tries to expand as much of the given path as possible, so that the filename or directory is visible in the tree control.
 
+\membersection{wxGenericDirCtrl::CollapsePath}\label{wxgenericdirctrlcollapsepath}
+
+\func{bool}{CollapsePath}{\param{const wxString\& }{path}}
+
+Collapse the given path.
+
 \membersection{wxGenericDirCtrl::GetDefaultPath}\label{wxgenericdirctrlgetdefaultpath}
 
 \constfunc{wxString}{GetDefaultPath}{\void}
 
 
     // Try to expand as much of the given path as possible.
     virtual bool ExpandPath(const wxString& path);
+    // collapse the path
+    virtual bool CollapsePath(const wxString& path);
 
     // Accessors
 
 
     return true;
 }
 
+
+bool wxGenericDirCtrl::CollapsePath(const wxString& path)
+{
+    bool done           = false;
+    wxTreeItemId id     = FindChild(m_rootId, path, done);
+    wxTreeItemId lastId = id; // The last non-zero id
+
+    while ( id.IsOk() && !done )
+    {
+        CollapseDir(id);
+
+        id = FindChild(id, path, done);
+
+        if ( id.IsOk() )
+            lastId = id;
+    }
+
+    if ( !lastId.IsOk() )
+        return false;
+
+    m_treeCtrl->SelectItem(lastId);
+    m_treeCtrl->EnsureVisible(lastId);
+
+    return true;
+}
+
+
 wxString wxGenericDirCtrl::GetPath() const
 {
     wxTreeItemId id = m_treeCtrl->GetSelection();