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 * wxCDMLibraryDescriptionPanel.cpp
31 * Created on: Nov 27, 2012
32 * Author: Daniel Felipe Gonzalez Obando
35 #include "wxCDMLibraryDescriptionPanel.h"
37 #include "wxCDMMainFrame.h"
39 #include "creaDevManagerIds.h"
40 #include "images/LIcon64.xpm"
42 BEGIN_EVENT_TABLE(wxCDMLibraryDescriptionPanel, wxPanel)
43 EVT_BUTTON(ID_BUTTON_PREV, wxCDMLibraryDescriptionPanel::OnBtnReturn)
44 EVT_BUTTON(ID_BUTTON_CREATE_CLASS, wxCDMLibraryDescriptionPanel::OnBtnCreateClass)
45 EVT_BUTTON(ID_BUTTON_CREATE_FOLDER, wxCDMLibraryDescriptionPanel::OnBtnCreateFolder)
46 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMLibraryDescriptionPanel::OnBtnEditCMakeLists)
47 EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMLibraryDescriptionPanel::OnBtnOpenFolder)
50 wxCDMLibraryDescriptionPanel::wxCDMLibraryDescriptionPanel(
52 modelCDMLibrary* library,
54 const wxString& caption,
60 wxCDMLibraryDescriptionPanel::Create(parent, library, id, caption, pos, size, style);
63 wxCDMLibraryDescriptionPanel::~wxCDMLibraryDescriptionPanel()
67 bool wxCDMLibraryDescriptionPanel::Create(
69 modelCDMLibrary* library,
71 const wxString& caption,
77 wxPanel::Create(parent, id, pos, size, style);
78 this->library = library;
83 void wxCDMLibraryDescriptionPanel::CreateControls()
85 wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
88 wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project"));
89 returnbt->SetToolTip(wxT("Return to the active project description."));
90 sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5);
93 sizer->Add(new wxStaticText(this, -1, _("Library")),0, wxALIGN_CENTER, 0);
96 sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(LIcon64)),0, wxALIGN_CENTER, 0);
99 sizer->Add(new wxStaticText(this, -1, crea::std2wx(this->library->GetNameLibrary())),0, wxALIGN_CENTER, 0);
102 wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxHORIZONTAL, this, wxT("&Actions"));
103 wxPanel* actionsPanel = new wxPanel(this);
104 wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL);
106 wxButton* createClassbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_CLASS, _T("Create Class"));
107 createClassbt->SetToolTip(wxT("Create a new class for this library."));
108 actionsPanelSizer->Add(createClassbt, 0, wxALL, 5);
109 wxButton* createFolderbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_FOLDER, _T("Create Folder"));
110 createFolderbt->SetToolTip(wxT("Create a new folder for this library."));
111 actionsPanelSizer->Add(createFolderbt, 0, wxALL, 5);
112 wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
113 editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt of this library in the default text editor."));
114 actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5);
115 wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Library Folder"));
116 openFolderbt->SetToolTip(wxT("Open the library folder in the file explorer."));
117 actionsPanelSizer->Add(openFolderbt, 0, wxALL, 5);
119 actionsPanel->SetSizer(actionsPanelSizer);
120 actionsPanelSizer->Fit(actionsPanel);
121 actionsBox->Add(actionsPanel, 1, wxEXPAND);
122 sizer -> Add(actionsBox, 0, wxALL | wxEXPAND, 10);
126 sizer->SetSizeHints(this);
129 void wxCDMLibraryDescriptionPanel::OnBtnReturn(wxCommandEvent& event)
131 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
132 newEvent->SetInt(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetId());
134 wxPostEvent(this->GetParent(), *newEvent);
137 void wxCDMLibraryDescriptionPanel::OnBtnCreateClass(wxCommandEvent& event)
139 //TODO: implement method
140 std::cerr << "Event OnBtnCreateClass not implemented" << std::endl;
144 void wxCDMLibraryDescriptionPanel::OnBtnCreateFolder(wxCommandEvent& event)
146 //TODO: implement method
147 std::cerr << "Event OnBtnCreateFolder not implemented" << std::endl;
151 void wxCDMLibraryDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
153 //TODO: implement method
154 std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl;
159 wxCDMLibraryDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
161 //TODO: implement method
162 std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl;