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 * wxCDMProjectDescriptionPanel.cpp
31 * Created on: Nov 27, 2012
32 * Author: Daniel Felipe Gonzalez Obando
35 #include "wxCDMProjectDescriptionPanel.h"
37 #include "creaDevManagerIds.h"
38 #include "images/PrIcon.xpm"
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)
48 wxCDMProjectDescriptionPanel::wxCDMProjectDescriptionPanel(
50 modelCDMProject* project,
52 const wxString& caption,
58 wxCDMProjectDescriptionPanel::Create(parent, project, id, caption, pos, size, style);
61 wxCDMProjectDescriptionPanel::~wxCDMProjectDescriptionPanel()
65 bool wxCDMProjectDescriptionPanel::Create(
67 modelCDMProject* project,
69 const wxString& caption,
75 wxPanel::Create(parent, id, pos, size, style);
76 this->project = project;
81 void wxCDMProjectDescriptionPanel::CreateControls()
83 wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
86 sizer->Add(new wxStaticText(this, -1, _("Project")),0, wxALIGN_CENTER, 0);
89 sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(PrIcon)),0, wxALIGN_CENTER, 0);
92 sizer->Add(new wxStaticText(this, -1, crea::std2wx(this->project->GetName())),0, wxALIGN_CENTER, 0);
95 wxStaticBox* propertiesBox = new wxStaticBox(this, -1, _T("&Properties"));
96 wxStaticBoxSizer* propertiesBoxInnerSizer = new wxStaticBoxSizer(propertiesBox, wxVERTICAL);
98 wxFlexGridSizer* flexGridSizer = new wxFlexGridSizer(4, 2, 9, 15);
100 wxStaticText *pVersion = new wxStaticText(this, -1, wxT("Version"));
101 wxStaticText *pVersionDate = new wxStaticText(this, -1, wxT("Version Date"));
102 wxStaticText *pSourceLocation = new wxStaticText(this, -1, wxT("Source Location"));
103 wxStaticText *pBuildLocation = new wxStaticText(this, -1, wxT("Build Location"));
105 wxTextCtrl *pVersiontc = new wxTextCtrl(this, -1, crea::std2wx(this->project->GetVersion()));
106 wxTextCtrl *pVersionDatetc = new wxTextCtrl(this, -1, crea::std2wx(this->project->GetVersionDate()));
107 wxTextCtrl *pSourceLocationtc = new wxTextCtrl(this, -1, crea::std2wx(this->project->GetPath()));
108 wxTextCtrl *pBuildLocationtc = new wxTextCtrl(this, -1, crea::std2wx(this->project->GetBuildPath()));
110 flexGridSizer->Add(pVersion, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
111 flexGridSizer->Add(pVersiontc, 1, wxEXPAND);
112 flexGridSizer->Add(pVersionDate, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
113 flexGridSizer->Add(pVersionDatetc, 1, wxEXPAND);
114 flexGridSizer->Add(pSourceLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
115 flexGridSizer->Add(pSourceLocationtc, 1, wxEXPAND);
116 flexGridSizer->Add(pBuildLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
117 flexGridSizer->Add(pBuildLocationtc, 1, wxEXPAND);
119 propertiesBoxInnerSizer -> Add(flexGridSizer, 0, wxEXPAND);
120 sizer -> Add(propertiesBoxInnerSizer, 1, wxEXPAND | wxALL, 20);
123 wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions"));
124 wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL);
125 sizer -> Add(actionsBoxInnerSizer, 1, wxEXPAND | wxALL, 20);
127 actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_PACKAGE, _T("Create Package")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20);
128 actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_BLACKBOX, _T("Create Black Box")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20);
129 actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_LIBRARY, _T("Create Library")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20);
130 actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_APPLICATION, _T("Create Application")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20);
132 actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20);
135 actionsBoxInnerSizer->SetSizeHints(this);
138 sizer->SetSizeHints(this);
141 void wxCDMProjectDescriptionPanel::OnBtnCreatePackage(wxCommandEvent& event)
143 //TODO: implement method
144 std::cerr << "Event OnBtnCreatePackage not implemented" << std::endl;
148 void wxCDMProjectDescriptionPanel::OnBtnCreateBlackBox(wxCommandEvent& event)
150 //TODO: implement method
151 std::cerr << "Event OnBtnCreatePackage not implemented" << std::endl;
155 void wxCDMProjectDescriptionPanel::OnBtnCreateLibrary(wxCommandEvent& event)
157 //TODO: implement method
158 std::cerr << "Event OnBtnCreatePackage not implemented" << std::endl;
162 void wxCDMProjectDescriptionPanel::OnBtnCreateApplication(wxCommandEvent& event)
164 //TODO: implement method
165 std::cerr << "Event OnBtnCreatePackage not implemented" << std::endl;
169 void wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
171 //TODO: implement method
172 std::cerr << "Event OnBtnCreatePackage not implemented" << std::endl;