]> Creatis software - crea.git/blob - lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / wxCDMLibraryDescriptionPanel.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  * wxCDMLibraryDescriptionPanel.cpp
30  *
31  *  Created on: Nov 27, 2012
32  *      Author: Daniel Felipe Gonzalez Obando
33  */
34
35 #include "wxCDMLibraryDescriptionPanel.h"
36
37 #include "creaDevManagerIds.h"
38 #include "images/LIcon64.xpm"
39
40 BEGIN_EVENT_TABLE(wxCDMLibraryDescriptionPanel, wxPanel)
41 EVT_MENU(ID_BUTTON_CREATE_FOLDER, wxCDMLibraryDescriptionPanel::OnBtnCreateFolder)
42 EVT_MENU(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMLibraryDescriptionPanel::OnBtnEditCMakeLists)
43 END_EVENT_TABLE()
44
45 wxCDMLibraryDescriptionPanel::wxCDMLibraryDescriptionPanel(
46     wxWindow* parent,
47     modelCDMLibrary* library,
48     wxWindowID id,
49     const wxString& caption,
50     const wxPoint& pos,
51     const wxSize& size,
52     long style
53 )
54 {
55   wxCDMLibraryDescriptionPanel::Create(parent, library, id, caption, pos, size, style);
56 }
57
58 wxCDMLibraryDescriptionPanel::~wxCDMLibraryDescriptionPanel()
59 {
60 }
61
62 bool wxCDMLibraryDescriptionPanel::Create(
63     wxWindow* parent,
64     modelCDMLibrary* library,
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->library = library;
74   CreateControls();
75   return TRUE;
76 }
77
78 void wxCDMLibraryDescriptionPanel::CreateControls()
79 {
80   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
81
82   //Welcome
83   sizer->Add(new wxStaticText(this, -1, _("Library")),0, wxALIGN_CENTER, 0);
84
85   //Image
86   sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(LIcon64)),0, wxALIGN_CENTER, 0);
87
88   //Project Name
89   sizer->Add(new wxStaticText(this, -1, crea::std2wx(this->library->GetNameLibrary())),0, wxALIGN_CENTER, 0);
90
91   //Actions
92   wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions"));
93   wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL);
94   sizer -> Add(actionsBoxInnerSizer, 1, wxEXPAND | wxALL, 20);
95
96   actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_FOLDER, _T("Create Folder")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20);
97   actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20);
98
99   //Assign sizer
100   actionsBoxInnerSizer->SetSizeHints(this);
101
102   SetSizer(sizer);
103   sizer->SetSizeHints(this);
104 }
105
106 void wxCDMLibraryDescriptionPanel::OnBtnCreateFolder(wxCommandEvent& event)
107 {
108   //TODO: implement method
109   std::cerr << "Event OnBtnCreateFolder not implemented" << std::endl;
110   event.Skip();
111 }
112
113 void wxCDMLibraryDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
114 {
115   //TODO: implement method
116   std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl;
117   event.Skip();
118 }