Patch #2026 2007-05-29 22:52
dmoore
double click project in project tree to activate- Download
- 2026-double_click_p.patch (1.8 KB)
Index: src/sdk/projectmanager.cpp
===================================================================
--- src/sdk/projectmanager.cpp (revision 4010)
+++ src/sdk/projectmanager.cpp (working copy)
@@ -166,7 +166,7 @@
EVT_TREE_ITEM_ACTIVATED(ID_ProjectManager, ProjectManager::OnProjectFileActivated)
EVT_TREE_ITEM_RIGHT_CLICK(ID_ProjectManager, ProjectManager::OnTreeItemRightClick)
EVT_COMMAND_RIGHT_CLICK(ID_ProjectManager, ProjectManager::OnRightClick)
-
+ EVT_COMMAND_LEFT_DCLICK(ID_ProjectManager, ProjectManager::OnLeftDClick)
EVT_MENU_RANGE(idOpenWith[0], idOpenWith[MAX_OPEN_WITH_ITEMS - 1], ProjectManager::OnOpenWith)
EVT_MENU(idOpenWithInternal, ProjectManager::OnOpenWith)
EVT_MENU(idNB_TabTop, ProjectManager::OnTabPosition)
@@ -1809,6 +1809,23 @@
m_pTree->PopupMenu(&menu, pt);
}
+void ProjectManager::OnLeftDClick(wxCommandEvent& event)
+{
+ wxTreeItemId sel = m_pTree->GetSelection();
+ FileTreeData* ftd = (FileTreeData*)m_pTree->GetItemData(sel);
+ if (!ftd)
+ return;
+ if(GetActiveProject()==ftd->GetProject())
+ m_pTree->Toggle(sel);
+ else
+ SetProject(ftd->GetProject(), false);
+}
+
+
void ProjectManager::OnTreeItemRightClick(wxTreeEvent& event)
{
#ifdef USE_OPENFILES_TREE
Index: src/include/projectmanager.h
===================================================================
--- src/include/projectmanager.h (revision 4010)
+++ src/include/projectmanager.h (working copy)
@@ -383,6 +383,7 @@
void OnTreeBeginDrag(wxTreeEvent& event);
void OnTreeEndDrag(wxTreeEvent& event);
void OnRightClick(wxCommandEvent& event);
+ void OnLeftDClick(wxCommandEvent& event);
void OnRenameWorkspace(wxCommandEvent& event);
void OnSaveWorkspace(wxCommandEvent& event);
void OnSaveAsWorkspace(wxCommandEvent& event);
History
dmoore 2007-05-30 10:57
I noticed that double click toggles expansion on win32 (not on linux). I'll refine the patch to also toggle with double click once a project has been activated
dmoore 2007-05-30 14:57
refined patch
pauliusz 2007-05-31 22:25
But this is already implemented... Since revision 3984.
Works good for me on Windows XP.
dmoore 2007-06-01 01:18
you're right. I must have been working on an older revision. strangely double clicking doesn't expand nodes in Linux (Ubuntu at least)