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

project manager tree item double click

<< < (3/3)

ollydbg:

--- Quote from: oBFusCATed on August 27, 2009, 03:39:15 pm ---Why do you have those windows guards?
I'll give it a try (on linux) when I get home later today.

--- End quote ---

Both blueshake and I use only Windows OS I think. :D
If it works on Linux. these guards should be deleted.

oBFusCATed:
It works.... with some modifications....


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

--- End code ---

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

Navigation

[0] Message Index

[*] Previous page

Go to full version