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 # ------------------------------------------------------------------------
30 * wxCDMProjectReadyDialog.cpp
32 * Created on: 3/1/2013
33 * Author: Daniel Felipe Gonzalez Obando
36 #include "wxCDMProjectHelpDialog.h"
38 #include "wxCDMProjectDescriptionPanel.h"
40 #include "creaDevManagerIds.h"
42 BEGIN_EVENT_TABLE(wxCDMProjectHelpDialog, wxDialog)
43 EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMProjectHelpDialog::OnFinish)
44 EVT_BUTTON(ID_BUTTON_GOTO_PACKAGE_MANAGER, wxCDMProjectHelpDialog::OnManagePackages)
45 EVT_BUTTON(ID_BUTTON_GOTO_LIB_MANAGER, wxCDMProjectHelpDialog::OnManageLibraries)
46 EVT_BUTTON(ID_BUTTON_GOTO_APPLI_MANAGER, wxCDMProjectHelpDialog::OnManageApplications)
47 EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMProjectHelpDialog::OnDisableHelp)
50 wxCDMProjectHelpDialog::wxCDMProjectHelpDialog(
52 wxCDMProjectDescriptionPanel* projectDescription,
54 const wxString& caption,
55 const wxPoint& position,
60 wxCDMProjectHelpDialog::Create(parent, id, caption, position, size, style);
61 this->projectDescription = projectDescription;
64 wxCDMProjectHelpDialog::~wxCDMProjectHelpDialog()
68 bool wxCDMProjectHelpDialog::Create(
71 const wxString& caption,
72 const wxPoint& position,
77 wxDialog::Create(parent, id, caption, position, size, style);
79 this->CreateControls();
84 void wxCDMProjectHelpDialog::CreateControls()
87 wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
90 wxStaticText* title = new wxStaticText(this, wxID_ANY, wxT("Your project is ready!"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);//new wxRichTextCtrl(this,wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxRE_READONLY);
91 v_sizer1->Add(title, 0, wxALIGN_LEFT | wxALL | wxALIGN_CENTER_VERTICAL, 5);
93 wxStaticText* instruction = new wxStaticText(
97 "A project has four main elements:\n"
98 "- Packages: Host the black boxes you make.\n"
99 "- Libraries: Contain the core functions of your programs, they are called by the black boxes and applications you make.\n"
100 "- Applications: Stand alone programs that use the functions available on your libraries.\n"
101 "- Configuration file: Contains the information of what should or shouldn't be compiled from this project.\n"
103 "To the right of the project you will find a tree with the project structure and it's actual content.\n"
104 "When you create a project it comes with a default package. If you need to work on it or if you want to create more "
105 "packages you can do it by clicking the \"Package Manager\" button bellow. You can also work with Libraries and "
106 "Applications. Just click in the \"Library Manager\" button or \"Application manager\" button to start working "
112 v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
114 v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10);
116 v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30);
119 //v_sizer1->RecalcSizes();
122 void wxCDMProjectHelpDialog::OnFinish(wxCommandEvent& event)
124 this->EndDialog(wxID_CANCEL);
127 void wxCDMProjectHelpDialog::OnManagePackages(wxCommandEvent& event)
129 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
131 newEvent->SetString(wxT("manage_packages"));
132 newEvent->SetInt(this->projectDescription->GetProject()->GetId());
133 wxPostEvent(this->GetParent(), *newEvent);
136 this->EndDialog(wxID_OK);
139 void wxCDMProjectHelpDialog::OnManageLibraries(wxCommandEvent& event)
141 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
143 newEvent->SetString(wxT("manage_libraries"));
144 wxPostEvent(this->GetParent(), *newEvent);
146 wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
148 if(this->projectDescription->GetProject()->GetLib() != NULL)
150 int CMId = this->projectDescription->GetProject()->GetLib()->GetId();
151 newEvent1->SetInt(CMId);
153 wxPostEvent(this->GetParent(), *newEvent1);
158 this->EndDialog(wxID_OK);
161 void wxCDMProjectHelpDialog::OnManageApplications(wxCommandEvent& event)
163 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
165 newEvent->SetString(wxT("manage_applications"));
166 wxPostEvent(this->GetParent(), *newEvent);
168 wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
170 if(this->projectDescription->GetProject()->GetAppli() != NULL)
172 int CMId = this->projectDescription->GetProject()->GetAppli()->GetId();
173 newEvent1->SetInt(CMId);
175 wxPostEvent(this->GetParent(), *newEvent1);
180 this->EndDialog(wxID_OK);
183 void wxCDMProjectHelpDialog::OnAppliMouseEnter(wxMouseEvent& event)
185 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
187 if(this->projectDescription->GetProject()->GetAppli() != NULL)
189 int AppId = this->projectDescription->GetProject()->GetAppli()->GetId();
190 newEvent->SetInt(AppId);
192 wxPostEvent(this->GetParent(), *newEvent);
197 void wxCDMProjectHelpDialog::OnAppliMouseExit(wxMouseEvent& event)
199 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
201 if(this->projectDescription->GetProject()->GetAppli() != NULL)
203 int AppId = this->projectDescription->GetProject()->GetAppli()->GetId();
204 newEvent->SetInt(AppId);
206 wxPostEvent(this->GetParent(), *newEvent);
211 void wxCDMProjectHelpDialog::OnLibMouseEnter(wxMouseEvent& event)
213 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
215 if(this->projectDescription->GetProject()->GetLib() != NULL)
217 int LbId = this->projectDescription->GetProject()->GetLib()->GetId();
218 newEvent->SetInt(LbId);
220 wxPostEvent(this->GetParent(), *newEvent);
225 void wxCDMProjectHelpDialog::OnLibMouseExit(wxMouseEvent& event)
227 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
229 if(this->projectDescription->GetProject()->GetLib() != NULL)
231 int LbId = this->projectDescription->GetProject()->GetLib()->GetId();
232 newEvent->SetInt(LbId);
234 wxPostEvent(this->GetParent(), *newEvent);
239 void wxCDMProjectHelpDialog::OnDisableHelp(wxCommandEvent& event)
241 wxPostEvent(this->GetParent(), event);