]> Creatis software - crea.git/blob - lib/creaDevManagerLib/wxCDMNewPackageDialog.h
Feature #1711
[crea.git] / lib / creaDevManagerLib / wxCDMNewPackageDialog.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  * wxCDMNewPackageDialog.h
31  *
32  *  Created on: 05/12/2012
33  *      Author: Daniel Felipe Gonzalez Obando
34  */
35
36 #ifndef WXCDMNEWPACKAGEDIALOG_H_
37 #define WXCDMNEWPACKAGEDIALOG_H_
38
39 #include <creaWx.h>
40 #include <wx/dialog.h>
41
42 /**
43  * Dialog to create a new Package in a Crea Project.
44  */
45 class wxCDMNewPackageDialog : public wxDialog
46 {
47   DECLARE_EVENT_TABLE()
48 public:
49   /**
50    * New Package 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 Package".
54    * @param position Dialog position. By default wxDefaultPosition.
55    * @param size Dialog size. By default 500, 400.
56    * @param style Dialog style. By default wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER.
57    */
58   wxCDMNewPackageDialog(
59       wxWindow* parent,
60       wxWindowID id = wxID_ANY,
61       const wxString& caption = wxT("New Package"),
62       const wxPoint& position = wxDefaultPosition,
63       const wxSize& size = wxSize(500,400),
64       long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
65   );
66   /**
67    * Destructor.
68    */
69   ~wxCDMNewPackageDialog();
70   /**
71    * New Package 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 Package".
75    * @param position Dialog position. By default wxDefaultPosition.
76    * @param size Dialog size. By default 500, 400.
77    * @param style Dialog style. By default wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER.
78    */
79   bool Create(
80       wxWindow* parent,
81       wxWindowID id = wxID_ANY,
82       const wxString& caption = wxT("New Package"),
83       const wxPoint& position = wxDefaultPosition,
84       const wxSize& size = wxSize(500,400),
85       long style = wxDEFAULT_DIALOG_STYLE
86   );
87
88   /**
89    * Returns the package name chosen by the user.
90    * @return Package name.
91    */
92   const wxString GetPackageName();
93   /**
94    * Returns the package author name chosen by the user.
95    * @return Package author name.
96    */
97   const wxString GetPackageAuthor();
98   /**
99    * Returns the package author's email chosen by the user.
100    * @return Package author's email.
101    */
102   const wxString GetPackageAuthorEmail();
103   /**
104    * Returns the package description chosen by the user.
105    * @return Package description.
106    */
107   const wxString GetPackageDescription();
108
109 protected:
110   /**
111    * Creates the visual controls of the Dialog.
112    */
113   void CreateControls();
114
115 private:
116   /**
117    * Package name.
118    */
119   wxTextCtrl* packageName;
120   /**
121    * Package author name.
122    */
123   wxTextCtrl* packageAuthor;
124   /**
125    * Package author's email.
126    */
127   wxTextCtrl* packageAuthorEmail;
128   /**
129    * Package description.
130    */
131   wxTextCtrl* packageDescription;
132
133   //handlers
134 protected:
135   /**
136    * Handles when the create package button is pressed.
137    * @param event Unused event.
138    */
139   void OnCreatePackage(wxCommandEvent& event);
140   /**
141    * Handles when the cancel button is pressed.
142    * @param event Unused event.
143    */
144   void OnCancel(wxCommandEvent& event);
145 };
146
147 #endif /* WXCDMNEWPACKAGEDIALOG_H_ */