]> Creatis software - crea.git/blob - lib/creaDevManagerLib/wxCDMNewProjectDialog.h
Feature #1711 CreaDevManager application implementation
[crea.git] / lib / creaDevManagerLib / wxCDMNewProjectDialog.h
1 /*
2 # ---------------------------------------------------------------------
3 #
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
5 #                        pour la Sant�)
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
9 #
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.
16 #
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
21 #  liability. 
22 #
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 # ------------------------------------------------------------------------ 
26  */
27
28
29 /*
30  * wxCDMNewProjectDialog.h
31  *
32  *  Created on: 13/11/2012
33  *      Author: Daniel Felipe Gonzalez Obando
34  */
35
36 #ifndef WXCDMNEWPROJECTDIALOG_H_
37 #define WXCDMNEWPROJECTDIALOG_H_
38
39 #include <creaWx.h>
40 #include <wx/dialog.h>
41
42 /**
43  * Dialog to create a new Crea Project.
44  */
45 class wxCDMNewProjectDialog : public wxDialog
46 {
47   DECLARE_EVENT_TABLE()
48 public:
49   /**
50    * New Project Dialog Constructor.
51    * @param parent Parent window reference.
52    * @param id Dialog ID. By default wxID_ANY.
53    * @param caption Dialog label. By default "New Project".
54    * @param position Dialog position. By default wxDefaultPosition.
55    * @param size Dialog size. By default 700, 400.
56    * @param style Dialog style. By default wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER.
57    */
58   wxCDMNewProjectDialog(
59       wxWindow* parent,
60       wxWindowID id = wxID_ANY,
61       const wxString& caption = wxT("New Project"),
62       const wxPoint& position = wxDefaultPosition,
63       const wxSize& size = wxSize(700,400),
64       long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
65   );
66   /**
67    * Destructor.
68    */
69   ~wxCDMNewProjectDialog();
70   /**
71    * New Project Dialog Creator.
72    * @param parent Parent window reference.
73    * @param id Dialog ID. By default wxID_ANY.
74    * @param caption Dialog label. By default "New Project".
75    * @param position Dialog position. By default wxDefaultPosition.
76    * @param size Dialog size. By default 700, 400.
77    * @param style Dialog style. By default wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER.
78    * @return True if the creation was successful.
79    */
80   bool Create(
81       wxWindow* parent,
82       wxWindowID id = wxID_ANY,
83       const wxString& caption = wxT("New Project"),
84       const wxPoint& position = wxDefaultPosition,
85       const wxSize& size = wxSize(700,400),
86       long style = wxDEFAULT_DIALOG_STYLE
87   );
88
89   /**
90    * Returns the project location chosen by the user.
91    * @return Project creation path.
92    */
93   const wxString GetProjectLocation();
94   /**
95    * Returns the project name chosen by the user.
96    * @return Project name.
97    */
98   const wxString GetProjectName();
99   /**
100    * Returns the default package authors chosen by the user.
101    * @return Default Package authors.
102    */
103   const wxString GetPackageAuthor();
104   /**
105    * Returns the default package description chosen by the user.
106    * @return Default Package description.
107    */
108   const wxString GetPackageDescription();
109
110 protected:
111   /**
112    * Creates the visual controls of the Dialog.
113    */
114   void CreateControls();
115
116 private:
117   /**
118    * Project creation path.
119    */
120   wxStaticText* projectLocation;
121   /**
122    * Project Name.
123    */
124   wxTextCtrl* projectName;
125   /**
126    * Default Package Author.
127    */
128   wxTextCtrl* packageAuthor;
129   /**
130    * Default Package Description.
131    */
132   wxTextCtrl* packageDescription;
133
134   //handlers
135 protected:
136   /**
137    * Handles when the create project button is pressed. If no path or no author was specified, the dialog shows an error.
138    * @param event Unused event.
139    */
140   void OnCreateProject(wxCommandEvent& event);
141   /**
142    * Handles when the cancel button is pressed.
143    * @param event Unused event.
144    */
145   void OnCancel(wxCommandEvent& event);
146   /**
147    * Handles when the choose location is pressed. a Directory dialog is shown and the new project location is chosen.
148    * @param event Unused event.
149    */
150   void OnChooseLocation(wxCommandEvent& event);
151 };
152
153 #endif /* WXCDMNEWPROJECTDIALOG_H_ */