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();
129 * Recently opened projects menu
151 * Floating panel manager
153 wxAuiManager auiManager;
155 * Tree control for an open project
157 wxCDMProjectsTreeCtrl* tree_Projects;
159 * Tree item for the selected item in the tree.
161 wxTreeItemId actualTreeItem;
163 * Description panel for a selected project item
165 wxPanel* panel_Properties;
167 * Main actions for an open project
169 wxPanel* panel_ProjectActions;
173 * Application model. It holds the open project model.
186 * Starts when the menu bar is opened.
187 * @param event The event object that triggers the handler.
189 void OnMenuBarOpen(wxMenuEvent& event);
193 * New project handler. Launches a new project dialog and creates a project model if the project is correctly created.
194 * @param event The event object that triggers the handler.
196 void OnMenuNewProject(wxCommandEvent& event);
198 * Open project handler. Launches a directory dialog and creates a project model if the project is correctly opened.
199 * @param event The event object that triggers the handler.
201 void OnMenuOpenProject(wxCommandEvent& event);
203 * Open recent project handler. Creates a project model if the project is correctly opened given its path.
204 * @param event The event object that triggers the handler.
206 void OnMenuOpenRecent(wxCommandEvent& event);
208 * Close project handler. Remove the project from the model and restarts the user interface.
209 * @param event The event object that triggers the handler.
211 void OnMenuCloseProject(wxCommandEvent& event);
213 * Unimplemented optional method handler. It should export the project structure in XML format.
214 * @param event The event object that triggers the handler.
216 void OnMenuExportHierarchy(wxCommandEvent& event);
218 * Exit handler. It closes any open project and quits the application.
219 * @param event The event object that triggers the handler.
221 void OnMenuExit(wxCommandEvent& event);
225 * Refresh project handler. Refreshes the project structure.
226 * @param event The event object that triggers the handler.
228 void OnMenuRefreshProject(wxCommandEvent& event);
230 * Open the settings dialog.
231 * @param event The event object that triggers the handler.
233 void OnMenuSettings(wxCommandEvent& event);
237 * Launches the BBTK Graphical Editor, also known as BBEditor.
238 * @param event The event object that triggers the handler.
240 void OnMenuBBTKGraphicalEditor(wxCommandEvent& event);
242 * Launches the Minitools application alse known as creaTools
243 * @param event The event object that triggers the handler.
245 void OnMenuMiniTools(wxCommandEvent& event);
247 * Launches the system default code editor.
251 * @param event The event object that triggers the handler.
253 void OnMenuCodeEditor(wxCommandEvent& event);
255 * Launches the system command line interpreter (CLI).
256 * Linux: gnome-terminal
259 * @param event The event object that triggers the handler.
261 void OnMenuCommandLine(wxCommandEvent& event);
265 * Enables/Disables the help option.
266 * @param event The event object that triggers the handler.
268 void OnMenuToggleHelp(wxCommandEvent& event);
270 * Open the road map for crea projects.
271 * @param event The event object that triggers the handler.
273 void OnMenuShowProjectMap(wxCommandEvent& event);
275 * Open the default web browser and redirects to the CreaTools Documentation page.
276 * @param event The event object that triggers the handler.
278 void OnMenuHelp(wxCommandEvent& event);
280 * Open the default web browser and redirects to the Crea Bug Tracking page.
281 * @param event The event object that triggers the handler.
283 void OnMenuReportBug(wxCommandEvent& event);
285 * Shows the about dialog of creaDevManager
286 * @param event The event object that triggers the handler.
288 void OnMenuAboutCreaDevManager(wxCommandEvent& event);
290 * Open the default web browser and redirects to the Creatis page.
291 * @param event The event object that triggers the handler.
293 void OnMenuAboutCreatis(wxCommandEvent& event);
297 * Handles the propertiesPanel change when there is a change in the selection on the Project Tree.
298 * @param event The event object that triggers the handler.
300 void OnTreeSelectionChanged(wxTreeEvent& event);
304 *Handles the propertiesPanel change when the event wxEVT_DISPLAY_CHANGED is triggered.
305 * @param event The event object that triggers the handler.
307 void OnChangeView(wxCommandEvent& event);
311 * Handles the change of the style of an element in the tree when buttons are hovered.
312 * @param event The event object that triggers the handler.
314 void OnElementSelected(wxCommandEvent& event);
316 * Handles the change of the style of an element in the tree when buttons finish hover.
317 * @param event The event object that triggers the handler.
319 void OnElementDeselected(wxCommandEvent& event);
321 //Enable/Disable help
323 * Handles the change of the state of the help option when it's triggered by another class.
324 * @param event The event object that triggers the handler.
326 void OnDisableHelp(wxCommandEvent& event);