apply this patch,when you double click the item on manager tree,
if item is folder ,the item will expand or collapse.
Index: projectmanager.cpp
===================================================================
--- projectmanager.cpp (revision 5744)
+++ projectmanager.cpp (working copy)
@@ -1761,6 +1761,12 @@
#endif
}
}
+ else if (ftd && ftd->GetKind() == FileTreeData::ftdkVirtualGroup)
+ {
+ #ifdef __WXMSW__
+ m_pTree->IsExpanded(id) ? m_pTree->Collapse(id) : m_pTree->Expand(id);
+ #endif
+ }
else
DoOpenSelectedFile();
}
@ollydbg
thank you for your feedback.
here is the new patch.
Index: projectmanager.cpp
===================================================================
--- projectmanager.cpp (revision 5744)
+++ projectmanager.cpp (working copy)
@@ -1761,6 +1761,12 @@
#endif
}
}
+ else if (ftd && (ftd->GetKind() == FileTreeData::ftdkVirtualGroup || ftd->GetKind() == FileTreeData::ftdkFolder))
+ {
+ #ifdef __WXMSW__
+ m_pTree->IsExpanded(id) ? m_pTree->Collapse(id) : m_pTree->Expand(id);
+ #endif
+ }
else
DoOpenSelectedFile();
}
Ok, I think you should add another option.
It seems the "first tree level" which named "Code::blocks" in my previous image still can't work.
So, it should like:
else if (ftd && (ftd->GetKind() == FileTreeData::ftdkVirtualGroup || ftd->GetKind() == FileTreeData::ftdkFolder) || ftd->GetKind() == XXXXXXX)
:D
ok , by this patch, everytingn work now.
Index: projectmanager.cpp
===================================================================
--- projectmanager.cpp (revision 5744)
+++ projectmanager.cpp (working copy)
@@ -1754,13 +1754,25 @@
if (ftd->GetProject() != m_pActiveProject)
{
SetProject(ftd->GetProject(), false);
- // prevent item expand state toggle when project is activated
- #ifdef __WXMSW__
- // toggle it one time so that it is toggled back by wx
- m_pTree->IsExpanded(id) ? m_pTree->Collapse(id) : m_pTree->Expand(id);
- #endif
}
+ // prevent item expand state toggle when project is activated
+ #ifdef __WXMSW__
+ // toggle it one time so that it is toggled back by wx
+ m_pTree->IsExpanded(id) ? m_pTree->Collapse(id) : m_pTree->Expand(id);
+ #endif
}
+ else if (ftd && (ftd->GetKind() == FileTreeData::ftdkVirtualGroup || ftd->GetKind() == FileTreeData::ftdkFolder))
+ {
+ #ifdef __WXMSW__
+ m_pTree->IsExpanded(id) ? m_pTree->Collapse(id) : m_pTree->Expand(id);
+ #endif
+ }
+ else if (!ftd && m_pWorkspace)
+ {
+ #ifdef __WXMSW__
+ m_pTree->IsExpanded(m_TreeRoot) ? m_pTree->Collapse(m_TreeRoot) : m_pTree->Expand(m_TreeRoot);
+ #endif
+ }
else
DoOpenSelectedFile();
}
It works.... with some modifications....
Index: src/sdk/projectmanager.cpp
===================================================================
--- src/sdk/projectmanager.cpp (revision 5742)
+++ src/sdk/projectmanager.cpp (working copy)
@@ -1754,12 +1754,18 @@
if (ftd->GetProject() != m_pActiveProject)
{
SetProject(ftd->GetProject(), false);
- // prevent item expand state toggle when project is activated
- #ifdef __WXMSW__
- // toggle it one time so that it is toggled back by wx
- m_pTree->IsExpanded(id) ? m_pTree->Collapse(id) : m_pTree->Expand(id);
- #endif
}
+ // prevent item expand state toggle when project is activated
+ // toggle it one time so that it is toggled back by wx
+ m_pTree->IsExpanded(id) ? m_pTree->Collapse(id) : m_pTree->Expand(id);
+ }
+ else if (ftd && (ftd->GetKind() == FileTreeData::ftdkVirtualGroup || ftd->GetKind() == FileTreeData::ftdkFolder))
+ {
+ m_pTree->IsExpanded(id) ? m_pTree->Collapse(id) : m_pTree->Expand(id);
+ }
+ else if (!ftd && m_pWorkspace)
+ {
+ m_pTree->IsExpanded(m_TreeRoot) ? m_pTree->Collapse(m_TreeRoot) : m_pTree->Expand(m_TreeRoot);
}
else
DoOpenSelectedFile();
Best regards
p.s. blueshake, please call svn diff from the root of the project, so the patches are easier to apply
p.s.s. guards should be place only if the wx docs say that the used API is platform specific... in the above code non-win32 users won't be able to test your work