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