2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------
29 #ifndef WXCDMMAINFRAME_H_INCLUDED
30 #define WXCDMMAINFRAME_H_INCLUDED
33 #include <wx/aui/aui.h>
34 #include <wx/treectrl.h>
35 #include "wxCDMProjectsTreeCtrl.h"
36 #include "modelCDMMain.h"
40 * This class is the main class of the application. It starts the other classes and windows as well as it holds a reference to the application model.
42 class wxCDMMainFrame:public wxFrame
48 * Constructor receiving common parameter for frame construction.
49 * @param parent The parent window of the wxCDMMainFrame object.
50 * @param id The id of the Frame, by default wxID_ANY.
51 * @param caption Frame caption. Usually shown on the top of the window. It's by default "CREATIS CreaDevManager".
52 * @param pos Position of the application, by default wxDefaultPosition.
53 * @param size Size of the application, by default wxDefaultSize.
54 * @param style Style of the application, by default wxDEFAULT_FRAME_STYLE.
58 wxWindowID id = wxID_ANY,
59 const wxString& caption = wxT("CREATIS CreaDevManager"),
60 const wxPoint& pos = wxDefaultPosition,
61 const wxSize& size = wxDefaultSize,
62 long style = wxDEFAULT_FRAME_STYLE
72 * Actually creates the frame and creates the controls inside the application.
73 * @param parent The parent window of the wxCDMMainFrame object.
74 * @param id The id of the Frame, by default wxID_ANY.
75 * @param caption Frame caption. Usually shown on the top of the window. It's by default "CREATIS CreaDevManager".
76 * @param pos Position of the application, by default wxDefaultPosition.
77 * @param size Size of the application, by default wxDefaultSize.
78 * @param style Style of the application, by default wxDEFAULT_FRAME_STYLE.
79 * @return True if the creation process went well.
83 wxWindowID id = wxID_ANY,
84 const wxString& caption = wxT("CREATIS CreaDevManager"),
85 const wxPoint& pos = wxDefaultPosition,
86 const wxSize& size = wxDefaultSize,
87 long style = wxDEFAULT_FRAME_STYLE
91 * Retreives the application model.
92 * @return Model of the application.
94 modelCDMMain* GetModel() const;
97 * Returns the properties panel. where the selection description is shown.
98 * @return the description panel of the project component chosen by the user.
100 wxPanel* GetPropertiesPanel() const;
103 * Checks if the help is enabled.
104 * @return true if the help is enabled.
109 * Refresh the project structure by comparing the existing model with the corresponding files in the hard drive.
111 void RefreshProject();
116 * Creates the menu bar and binds the corresponding event handler to each menu.
121 * Create the user interface containing a wxCDMMainDescriptionPanel and a wxCDMProjectsTreeCtrl.
123 void CreateControls();
147 * Floating panel manager
149 wxAuiManager auiManager;
151 * Tree control for an open project
153 wxCDMProjectsTreeCtrl* tree_Projects;
155 * Tree item for the selected item in the tree.
157 wxTreeItemId actualTreeItem;
159 * Description panel for a selected project item
161 wxPanel* panel_Properties;
163 * Main actions for an open project
165 wxPanel* panel_ProjectActions;
169 * Application model. It holds the open project model.
182 * New project handler. Launches a new project dialog and creates a project model if the project is correctly created.
183 * @param event The event object that triggers the handler.
185 void OnMenuNewProject(wxCommandEvent& event);
187 * Open project handler. Launches a directory dialog and creates a project model if the project is correctly opened.
188 * @param event The event object that triggers the handler.
190 void OnMenuOpenProject(wxCommandEvent& event);
192 * Close project handler. Remove the project from the model and restarts the user interface.
193 * @param event The event object that triggers the handler.
195 void OnMenuCloseProject(wxCommandEvent& event);
197 * Unimplemented optional method handler. It should export the project structure in XML format.
198 * @param event The event object that triggers the handler.
200 void OnMenuExportHierarchy(wxCommandEvent& event);
202 * Exit handler. It closes any open project and quits the application.
203 * @param event The event object that triggers the handler.
205 void OnMenuExit(wxCommandEvent& event);
209 * Refresh project handler. Refreshes the project structure.
210 * @param event The event object that triggers the handler.
212 void OnMenuRefreshProject(wxCommandEvent& event);
216 * Launches the BBTK Graphical Editor, also known as BBEditor.
217 * @param event The event object that triggers the handler.
219 void OnMenuBBTKGraphicalEditor(wxCommandEvent& event);
221 * Launches the Minitools application alse known as creaTools
222 * @param event The event object that triggers the handler.
224 void OnMenuMiniTools(wxCommandEvent& event);
226 * Launches the system default code editor.
230 * @param event The event object that triggers the handler.
232 void OnMenuCodeEditor(wxCommandEvent& event);
234 * Launches the system command line interpreter (CLI).
235 * Linux: gnome-terminal
238 * @param event The event object that triggers the handler.
240 void OnMenuCommandLine(wxCommandEvent& event);
244 * Enables/Disables the help option.
245 * @param event The event object that triggers the handler.
247 void OnMenuToggleHelp(wxCommandEvent& event);
249 * Open the default web browser and redirects to the CreaTools Documentation page.
250 * @param event The event object that triggers the handler.
252 void OnMenuHelp(wxCommandEvent& event);
254 * Open the default web browser and redirects to the Crea Bug Tracking page.
255 * @param event The event object that triggers the handler.
257 void OnMenuReportBug(wxCommandEvent& event);
259 * Shows the about dialog of creaDevManager
260 * @param event The event object that triggers the handler.
262 void OnMenuAboutCreaDevManager(wxCommandEvent& event);
264 * Open the default web browser and redirects to the Creatis page.
265 * @param event The event object that triggers the handler.
267 void OnMenuAboutCreatis(wxCommandEvent& event);
271 * Handles the propertiesPanel change when there is a change in the selection on the Project Tree.
272 * @param event The event object that triggers the handler.
274 void OnTreeSelectionChanged(wxTreeEvent& event);
278 *Handles the propertiesPanel change when the event wxEVT_DISPLAY_CHANGED is triggered.
279 * @param event The event object that triggers the handler.
281 void OnChangeView(wxCommandEvent& event);
285 * Handles the change of the style of an element in the tree when buttons are hovered.
286 * @param event The event object that triggers the handler.
288 void OnElementSelected(wxCommandEvent& event);
290 * Handles the change of the style of an element in the tree when buttons finish hover.
291 * @param event The event object that triggers the handler.
293 void OnElementDeselected(wxCommandEvent& event);
295 //Enable/Disable help
297 * Handles the change of the state of the help option when it's triggered by another class.
298 * @param event The event object that triggers the handler.
300 void OnDisableHelp(wxCommandEvent& event);