Code::Blocks  SVN r11506
projectmanagerui.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
3  * http://www.gnu.org/licenses/gpl-3.0.html
4  *
5  * $Revision: 11339 $
6  * $Id: projectmanagerui.h 11339 2018-03-20 08:39:38Z fuscated $
7  * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/src/projectmanagerui.h $
8  */
9 
10 #include "projectmanager.h"
11 
12 class cbProject;
13 class cbAuiNotebook;
15 class wxAuiNotebookEvent;
16 
18 {
19  public:
22 
24 
28  cbTreeCtrl* GetTree(){ return m_pTree; }
29 
31 
32  void RebuildTree();
33  void FreezeTree();
34  void UnfreezeTree(bool force = false);
35 
36 
37  void UpdateActiveProject(cbProject* oldProject, cbProject* newProject, bool refresh);
38  void RemoveProject(cbProject* project);
39  void BeginLoadingWorkspace();
40  void CloseWorkspace();
41  void FinishLoadingProject(cbProject* project, bool newAddition, cb_unused FilesGroupsAndMasks* fgam);
42  void FinishLoadingWorkspace(cbProject* activeProject, const wxString &workspaceTitle);
43 
44  void ShowFileInTree(ProjectFile &projectFile);
45 
46  void CreateMenu(wxMenuBar* menuBar);
47 
48  bool QueryCloseAllProjects();
49  bool QueryCloseProject(cbProject* project, bool dontsavefiles);
50  bool QueryCloseWorkspace();
51 
52  int AskForBuildTargetIndex(cbProject* project);
56 
57  private:
58  void InitPane();
59  void BuildTree();
60  void SwitchToProjectsPage();
61  void ShowMenu(wxTreeItemId id, const wxPoint& pt);
62  void CreateMenuTreeProps(wxMenu* menu, bool popup);
63 
64  void DoOpenFile(ProjectFile* pf, const wxString& filename);
65  void DoOpenSelectedFile();
67  void OpenFilesRecursively(wxTreeItemId& sel_id);
68  private:
69 
71  void OnTabPosition(wxCommandEvent& event);
73  void OnExecParameters(wxCommandEvent& event);
74  void OnTreeItemRightClick(wxTreeEvent& event);
75  void OnTreeBeginDrag(wxTreeEvent& event);
76  void OnTreeEndDrag(wxTreeEvent& event);
77  void OnRightClick(wxCommandEvent& event);
78  void OnRenameWorkspace(wxCommandEvent& event);
79  void OnSaveWorkspace(wxCommandEvent& event);
80  void OnSaveAsWorkspace(wxCommandEvent& event);
81  void OnCloseWorkspace(wxCommandEvent& event);
86  void OnRenameFile(wxCommandEvent& event);
87  void OnSaveProject(wxCommandEvent& event);
88  void OnCloseProject(wxCommandEvent& event);
89  void OnSaveFile(wxCommandEvent& event);
90  void OnCloseFile(wxCommandEvent& event);
91  void OnOpenFile(wxCommandEvent& event);
92  void OnOpenFolderFiles(wxCommandEvent& event);
93  void OnOpenWith(wxCommandEvent& event);
94  void OnProperties(wxCommandEvent& event);
95  void OnFileOptions(wxCommandEvent &event);
96  void OnNotes(wxCommandEvent& event);
97  void OnGotoFile(wxCommandEvent& event);
98  void OnViewCategorize(wxCommandEvent& event);
99  void OnViewUseFolders(wxCommandEvent& event);
101  void OnViewFileMasks(wxCommandEvent& event);
102  void OnFindFile(wxCommandEvent& event);
104  void OnBeginEditNode(wxTreeEvent& event);
105  void OnEndEditNode(wxTreeEvent& event);
106  void OnAddVirtualFolder(wxCommandEvent& event);
109  void OnUpdateUI(wxUpdateUIEvent& event);
110  void OnIdle(wxIdleEvent& event);
111  void OnKeyDown(wxTreeEvent& event);
112 
113 
120  void MoveProjectUp(cbProject* project, bool warpAround = false);
127  void MoveProjectDown(cbProject* project, bool warpAround = false);
128 
135  void BuildProjectTree(cbProject* project, cbTreeCtrl* tree, const wxTreeItemId& root,
136  int ptvs, FilesGroupsAndMasks* fgam);
137 
138  private:
145  wxArrayTreeItemIds m_DraggingSelection;
148 
149  private:
150  DECLARE_EVENT_TABLE()
151 };
152 
155 {
156  public:
157  cbAuiNotebook* GetNotebook() override { return nullptr; }
158  cbTreeCtrl* GetTree() override { return nullptr; }
159  void RebuildTree() override {}
160  void FreezeTree() override {}
161  void UnfreezeTree(cb_unused bool force = false) override {}
162  wxTreeItemId GetTreeSelection() override { return wxTreeItemId(); }
163 
164  void ShowFileInTree(cb_unused ProjectFile &projectFile) override {}
165 
166  void UpdateActiveProject(cb_unused cbProject *oldProject, cb_unused cbProject *newProject,
167  cb_unused bool refresh) override
168  {
169  }
170 
171  void RemoveProject(cb_unused cbProject *project) override {}
172  void BeginLoadingWorkspace() override {}
173  void CloseWorkspace() override {}
174  void FinishLoadingProject(cb_unused cbProject *project, cb_unused bool newAddition,
175  cb_unused FilesGroupsAndMasks* fileGroups) override
176  {
177  }
178  void FinishLoadingWorkspace(cb_unused cbProject *activeProject,
179  cb_unused const wxString &workspaceTitle) override
180  {
181  }
182  bool QueryCloseAllProjects() override { return true; }
183  bool QueryCloseProject(cb_unused cbProject *proj,
184  cb_unused bool dontsavefiles = false) override
185  {
186  return true;
187  }
188  bool QueryCloseWorkspace() override { return true; }
189 
190  int AskForBuildTargetIndex(cb_unused cbProject* project = nullptr) override { return -1; }
191  wxArrayInt AskForMultiBuildTargetIndex(cb_unused cbProject* project = nullptr) override
192  {
193  return wxArrayInt();
194  }
195  void ConfigureProjectDependencies(cb_unused cbProject* base = nullptr) override {}
196  void SwitchToProjectsPage() override {}
197 };
void FinishLoadingWorkspace(cbProject *activeProject, const wxString &workspaceTitle)
void OnViewFileMasks(wxCommandEvent &event)
void MoveProjectDown(cbProject *project, bool warpAround=false)
Move a project down in the project manager tree.
void RemoveFilesRecursively(wxTreeItemId &sel_id)
bool QueryCloseWorkspace()
Asks user to save the workspace, projects and files (Yes/No/cancel).
wxTreeItemId m_TreeRoot
bool QueryCloseAllProjects()
Checks whether all projects are saved.
void ShowFileInTree(ProjectFile &projectFile)
void OnSaveProject(wxCommandEvent &event)
void OnOpenWith(wxCommandEvent &event)
void OnAddFilesToProjectRecursively(wxCommandEvent &event)
void RemoveProject(cb_unused cbProject *project) override
wxImageList * m_pImages
void SwitchToProjectsPage() override
Switches the management's notebook to the Projects tab.
void OnRenameVirtualFolder(wxCommandEvent &event)
void OnViewCategorize(wxCommandEvent &event)
void MoveProjectUp(cbProject *project, bool warpAround=false)
Move a project up in the project manager tree.
bool QueryCloseProject(cb_unused cbProject *proj, cb_unused bool dontsavefiles=false) override
void UnfreezeTree(bool force=false)
Le the tree control be updated again.
void RemoveProject(cbProject *project)
void OnIdle(wxIdleEvent &event)
void CreateMenuTreeProps(wxMenu *menu, bool popup)
wxTreeItemId m_RightClickItem
wxArrayInt AskForMultiBuildTargetIndex(cbProject *project)
Utility function.
int AskForBuildTargetIndex(cb_unused cbProject *project=nullptr) override
bool m_isCheckingForExternallyModifiedProjects
wxArrayInt AskForMultiBuildTargetIndex(cb_unused cbProject *project=nullptr) override
cbAuiNotebook * GetNotebook() override
void RebuildTree() override
Rebuild the project manager's tree.
void OnSetActiveProject(wxCommandEvent &event)
void UpdateActiveProject(cbProject *oldProject, cbProject *newProject, bool refresh)
void OnTreeEndDrag(wxTreeEvent &event)
void OnCloseFile(wxCommandEvent &event)
void FinishLoadingProject(cb_unused cbProject *project, cb_unused bool newAddition, cb_unused FilesGroupsAndMasks *fileGroups) override
void OnNotes(wxCommandEvent &event)
void OnTabPosition(wxCommandEvent &event)
void OnFileOptions(wxCommandEvent &event)
Represents a file in a Code::Blocks project.
Definition: projectfile.h:39
void SwitchToProjectsPage()
Switches the management's notebook to the Projects tab.
cbTreeCtrl * GetTree() override
Retrieve a pointer to the project manager's tree (GUI).
void OnSaveFile(wxCommandEvent &event)
void OnCloseWorkspace(wxCommandEvent &event)
void OnBeginEditNode(wxTreeEvent &event)
cbAuiNotebook * m_pNotebook
void BuildProjectTree(cbProject *project, cbTreeCtrl *tree, const wxTreeItemId &root, int ptvs, FilesGroupsAndMasks *fgam)
(Re)build the project tree.
void OnRightClick(wxCommandEvent &event)
cbAuiNotebook * GetNotebook()
void BeginLoadingWorkspace() override
Represents a Code::Blocks project.
Definition: cbproject.h:96
void OnTabContextMenu(wxAuiNotebookEvent &event)
void UnfreezeTree(cb_unused bool force=false) override
void OnViewHideFolderName(wxCommandEvent &event)
void DoOpenFile(ProjectFile *pf, const wxString &filename)
void UpdateActiveProject(cb_unused cbProject *oldProject, cb_unused cbProject *newProject, cb_unused bool refresh) override
wxArrayTreeItemIds m_DraggingSelection
void OpenFilesRecursively(wxTreeItemId &sel_id)
void OnViewUseFolders(wxCommandEvent &event)
bool QueryCloseAllProjects() override
Checks whether all projects are saved.
void ConfigureProjectDependencies(cbProject *base)
Displays a dialog to setup project dependencies.
void OnFindFile(wxCommandEvent &event)
void CreateMenu(wxMenuBar *menuBar)
void CloseWorkspace() override
void RebuildTree()
Rebuild the project manager's tree.
void OnRenameFile(wxCommandEvent &event)
void OnProjectFileActivated(wxTreeEvent &event)
void ConfigureProjectDependencies(cb_unused cbProject *base=nullptr) override
void OnProperties(wxCommandEvent &event)
void CheckForExternallyModifiedProjects()
void OnExecParameters(wxCommandEvent &event)
cbTreeCtrl * m_pTree
void OnRenameWorkspace(wxCommandEvent &event)
int AskForBuildTargetIndex(cbProject *project)
Utility function.
void OnOpenFile(wxCommandEvent &event)
void OnGotoFile(wxCommandEvent &event)
void FreezeTree()
Stop the tree control from updating.
void ShowFileInTree(cb_unused ProjectFile &projectFile) override
void OnSaveAsWorkspace(wxCommandEvent &event)
wxArray< int > wxArrayInt
void OnOpenFolderFiles(wxCommandEvent &event)
bool QueryCloseProject(cbProject *project, bool dontsavefiles)
Checks whether project is saved.
void ShowMenu(wxTreeItemId id, const wxPoint &pt)
void OnAddFileToProject(wxCommandEvent &event)
A notebook class This class is derived from wxAuiNotebook, to enhance its abilities.
Definition: cbauibook.h:30
wxTreeItemId GetTreeSelection() override
Get the selection of the project manager&#39;s tree (GUI).
void OnCloseProject(wxCommandEvent &event)
void OnRemoveFileFromProject(wxCommandEvent &event)
void OnEndEditNode(wxTreeEvent &event)
void OnDeleteVirtualFolder(wxCommandEvent &event)
void OnKeyDown(wxTreeEvent &event)
void OnSaveWorkspace(wxCommandEvent &event)
void FreezeTree() override
Stop the tree control from updating.
void OnTreeItemRightClick(wxTreeEvent &event)
void FinishLoadingProject(cbProject *project, bool newAddition, cb_unused FilesGroupsAndMasks *fgam)
void FinishLoadingWorkspace(cb_unused cbProject *activeProject, cb_unused const wxString &workspaceTitle) override
cbTreeCtrl * GetTree()
Retrieve a pointer to the project manager&#39;s tree (GUI).
void OnUpdateUI(wxUpdateUIEvent &event)
bool QueryCloseWorkspace() override
Asks user to save the workspace, projects and files (Yes/No/cancel).
wxTreeItemId GetTreeSelection()
Get the selection of the project manager&#39;s tree (GUI).
void OnAddVirtualFolder(wxCommandEvent &event)
void OnTreeBeginDrag(wxTreeEvent &event)
Almost empty implementation used in batch mode.
wxArrayString ListNodes(wxTreeItemId node) const