added CollapsePath() (patch 1494638)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1065,6 +1065,33 @@ bool wxGenericDirCtrl::ExpandPath(const wxString& path)
|
||||
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();
|
||||
|
Reference in New Issue
Block a user