Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

project manager tree item double click

(1/3) > >>

blueshake:
apply this patch,when you double click the item on manager tree,
if item is folder ,the item will expand or collapse.

--- Code: ---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();
 }

--- End code ---

ollydbg:
This is what I expect for long time.
I will apply and test it!
Thanks!!!

Edit

It works OK!

ollydbg:
I find a bug.
It seems only the second level of the tree can be open and collapse by double click.

See the screen shot blew:



[attachment deleted by admin]

blueshake:
@ollydbg
thank you for your feedback.
here is the new patch.

--- Code: ---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();
 }

--- End code ---

ollydbg:
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:


--- Code: ---else if (ftd && (ftd->GetKind() == FileTreeData::ftdkVirtualGroup || ftd->GetKind() == FileTreeData::ftdkFolder)  || ftd->GetKind() == XXXXXXX)

--- End code ---

 :D

Navigation

[0] Message Index

[#] Next page

Go to full version