]> Creatis software - crea.git/blob - lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / wxCDMApplicationDescriptionPanel.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  * wxCDMApplicationDescriptionPanel.cpp
30  *
31  *  Created on: Nov 27, 2012
32  *      Author: Daniel Felipe Gonzalez Obando
33  */
34
35 #include "wxCDMApplicationDescriptionPanel.h"
36
37 #include "creaDevManagerIds.h"
38 #include "images/AIcon64.xpm"
39
40 BEGIN_EVENT_TABLE(wxCDMApplicationDescriptionPanel, wxPanel)
41 EVT_MENU(ID_BUTTON_CREATE_FOLDER, wxCDMApplicationDescriptionPanel::OnBtnCreateFolder)
42 EVT_MENU(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMApplicationDescriptionPanel::OnBtnEditCMakeLists)
43 END_EVENT_TABLE()
44
45 wxCDMApplicationDescriptionPanel::wxCDMApplicationDescriptionPanel(
46     wxWindow* parent,
47     modelCDMApplication* application,
48     wxWindowID id,
49     const wxString& caption,
50     const wxPoint& pos,
51     const wxSize& size,
52     long style
53 )
54 {
55   wxCDMApplicationDescriptionPanel::Create(parent, application, id, caption, pos, size, style);
56 }
57
58 wxCDMApplicationDescriptionPanel::~wxCDMApplicationDescriptionPanel()
59 {
60 }
61
62 bool wxCDMApplicationDescriptionPanel::Create(
63     wxWindow* parent,
64     modelCDMApplication* application,
65     wxWindowID id,
66     const wxString& caption,
67     const wxPoint& pos,
68     const wxSize& size,
69     long style
70 )
71 {
72   wxPanel::Create(parent, id, pos, size, style);
73   this->application = application;
74   CreateControls();
75   return TRUE;
76 }
77
78 void wxCDMApplicationDescriptionPanel::CreateControls()
79 {
80   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
81
82   //Welcome
83   sizer->Add(new wxStaticText(this, -1, _("Project")),0, wxALIGN_CENTER, 0);
84
85   //Image
86   sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(AIcon64)),0, wxALIGN_CENTER, 0);
87
88   //Project Name
89   sizer->Add(new wxStaticText(this, -1, crea::std2wx(this->application->GetNameApplication())),0, wxALIGN_CENTER, 0);
90
91   //Project Properties
92   wxStaticBox* propertiesBox = new wxStaticBox(this, -1, _T("&Properties"));
93   wxStaticBoxSizer* propertiesBoxInnerSizer = new wxStaticBoxSizer(propertiesBox, wxVERTICAL);
94
95   wxFlexGridSizer* flexGridSizer = new wxFlexGridSizer(4, 2, 9, 15);
96
97   wxStaticText *pMainFile = new wxStaticText(this, -1, wxT("Main File"));
98
99   wxTextCtrl *pMainFiletc = new wxTextCtrl(this, -1, crea::std2wx(this->application->GetMainFile()));
100
101   flexGridSizer->Add(pMainFile, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
102   flexGridSizer->Add(pMainFiletc, 1, wxEXPAND);
103
104   propertiesBoxInnerSizer -> Add(flexGridSizer, 0, wxEXPAND);
105   sizer -> Add(propertiesBoxInnerSizer, 1, wxEXPAND | wxALL, 20);
106
107   //Actions
108   wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions"));
109   wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL);
110   sizer -> Add(actionsBoxInnerSizer, 1, wxEXPAND | wxALL, 20);
111
112   actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_FOLDER, _T("Create Folder")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20);
113   actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20);
114
115   //Assign sizer
116   actionsBoxInnerSizer->SetSizeHints(this);
117
118   SetSizer(sizer);
119   sizer->SetSizeHints(this);
120 }
121
122 void wxCDMApplicationDescriptionPanel::OnBtnCreateFolder(wxCommandEvent& event)
123 {
124   //TODO: implement method
125   std::cerr << "Event OnBtnCreateFolder not implemented" << std::endl;
126   event.Skip();
127 }
128
129 void wxCDMApplicationDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
130 {
131   //TODO: implement method
132   std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl;
133   event.Skip();
134 }