]> Creatis software - crea.git/blob - lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / wxCDMProjectDescriptionPanel.cpp
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  * wxCDMProjectDescriptionPanel.cpp
30  *
31  *  Created on: Nov 27, 2012
32  *      Author: Daniel Felipe Gonzalez Obando
33  */
34
35 #include "wxCDMProjectDescriptionPanel.h"
36
37 #include "creaDevManagerIds.h"
38 #include "images/Cicon64.xpm"
39
40 BEGIN_EVENT_TABLE(wxCDMProjectDescriptionPanel, wxPanel)
41 EVT_MENU(ID_BUTTON_CREATE_PACKAGE, wxCDMProjectDescriptionPanel::OnBtnCreatePackage)
42 EVT_MENU(ID_BUTTON_CREATE_BLACKBOX, wxCDMProjectDescriptionPanel::OnBtnCreateBlackBox)
43 EVT_MENU(ID_BUTTON_CREATE_LIBRARY, wxCDMProjectDescriptionPanel::OnBtnCreateLibrary)
44 EVT_MENU(ID_BUTTON_CREATE_APPLICATION, wxCDMProjectDescriptionPanel::OnBtnCreateApplication)
45 EVT_MENU(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists)
46 END_EVENT_TABLE()
47
48 wxCDMProjectDescriptionPanel::wxCDMProjectDescriptionPanel(
49     wxWindow* parent,
50     modelCDMProject* project,
51     wxWindowID id,
52     const wxString& caption,
53     const wxPoint& pos,
54     const wxSize& size,
55     long style
56 )
57 {
58   wxCDMProjectDescriptionPanel::Create(parent, project, id, caption, pos, size, style);
59 }
60
61 wxCDMProjectDescriptionPanel::~wxCDMProjectDescriptionPanel()
62 {
63 }
64
65 bool wxCDMProjectDescriptionPanel::Create(
66     wxWindow* parent,
67     modelCDMProject* project,
68     wxWindowID id,
69     const wxString& caption,
70     const wxPoint& pos,
71     const wxSize& size,
72     long style
73 )
74 {
75   wxPanel::Create(parent, id, pos, size, style);
76   this->project = project;
77   CreateControls();
78   return TRUE;
79 }
80
81 void wxCDMProjectDescriptionPanel::CreateControls()
82 {
83   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
84
85   //Welcome
86   sizer->Add(new wxStaticText(this, -1, _("Project")),0, wxALIGN_CENTER, 0);
87
88   //Image
89   sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(Cicon)),0, wxALIGN_CENTER, 0);
90
91   //Project Name
92   sizer->Add(new wxStaticText(this, -1, crea::std2wx(this->project->GetName())),0, wxALIGN_CENTER, 0);
93
94   //Project Properties
95   wxStaticBox* propertiesBox = new wxStaticBox(this, -1, _T("&Properties"));
96   wxStaticBoxSizer* propertiesBoxInnerSizer = new wxStaticBoxSizer(propertiesBox, wxHORIZONTAL);
97   sizer -> Add(propertiesBoxInnerSizer, 1, wxEXPAND | wxALL, 20);
98
99   wxFlexGridSizer* flexGridSizer = new wxFlexGridSizer(4, 2, 9, 15);
100   propertiesBoxInnerSizer -> Add(flexGridSizer, 1, wxEXPAND | wxALL);
101
102   wxStaticText *pVersion = new wxStaticText(this, -1, wxT("Version"));
103   wxStaticText *pVersionDate = new wxStaticText(this, -1, wxT("Version Date"));
104   wxStaticText *pSourceLocation = new wxStaticText(this, -1, wxT("Source Location"));
105   wxStaticText *pBuildLocation = new wxStaticText(this, -1, wxT("Build Location"));
106
107   wxTextCtrl *pVersiontc = new wxTextCtrl(this, -1, crea::std2wx(this->project->GetVersion()));
108   wxTextCtrl *pVersionDatetc = new wxTextCtrl(this, -1, crea::std2wx(this->project->GetVersionDate()));
109   wxTextCtrl *pSourceLocationtc = new wxTextCtrl(this, -1, crea::std2wx(this->project->GetPath()));
110   wxTextCtrl *pBuildLocationtc = new wxTextCtrl(this, -1, crea::std2wx(this->project->GetBuildPath()));
111
112   flexGridSizer->Add(pVersion, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
113   flexGridSizer->Add(pVersiontc, 1, wxEXPAND);
114   flexGridSizer->Add(pVersionDate, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
115   flexGridSizer->Add(pVersionDatetc, 1, wxEXPAND);
116   flexGridSizer->Add(pSourceLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
117   flexGridSizer->Add(pSourceLocationtc, 1, wxEXPAND);
118   flexGridSizer->Add(pBuildLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
119   flexGridSizer->Add(pBuildLocationtc, 1, wxEXPAND);
120
121   flexGridSizer->SetSizeHints(this);
122
123   //Actions
124   wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions"));
125   wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL);
126   sizer -> Add(actionsBoxInnerSizer, 1, wxEXPAND | wxALL, 20);
127
128   actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_PACKAGE, _T("Create Package")), 0, wxRIGHT | wxLEFT, 20);
129   actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_BLACKBOX, _T("Create Black Box")), 0, wxRIGHT | wxLEFT, 20);
130   actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_LIBRARY, _T("Create Library")), 0, wxRIGHT | wxLEFT, 20);
131   actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_APPLICATION, _T("Create Application")), 0, wxRIGHT | wxLEFT, 20);
132
133   actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")), 0, wxRIGHT | wxLEFT, 20);
134
135   //Asign sizer
136   actionsBoxInnerSizer->SetSizeHints(this);
137   sizer->SetSizeHints(this);
138   SetSizer(sizer);
139 }
140
141 void wxCDMProjectDescriptionPanel::OnBtnCreatePackage(wxCommandEvent& event)
142 {
143   //TODO: implement method
144   std::cerr << "Event OnBtnCreatePackage not implemented" << std::endl;
145   event.Skip();
146 }
147
148 void wxCDMProjectDescriptionPanel::OnBtnCreateBlackBox(wxCommandEvent& event)
149 {
150   //TODO: implement method
151   std::cerr << "Event OnBtnCreatePackage not implemented" << std::endl;
152   event.Skip();
153 }
154
155 void wxCDMProjectDescriptionPanel::OnBtnCreateLibrary(wxCommandEvent& event)
156 {
157   //TODO: implement method
158   std::cerr << "Event OnBtnCreatePackage not implemented" << std::endl;
159   event.Skip();
160 }
161
162 void wxCDMProjectDescriptionPanel::OnBtnCreateApplication(wxCommandEvent& event)
163 {
164   //TODO: implement method
165   std::cerr << "Event OnBtnCreatePackage not implemented" << std::endl;
166   event.Skip();
167 }
168
169 void wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
170 {
171   //TODO: implement method
172   std::cerr << "Event OnBtnCreatePackage not implemented" << std::endl;
173   event.Skip();
174 }