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 * wxCDMLibHelpDialog.cpp
32 * Created on: 11/1/2013
33 * Author: Daniel Felipe Gonzalez Obando
36 #include "wxCDMLibHelpDialog.h"
38 #include "creaDevManagerIds.h"
40 BEGIN_EVENT_TABLE(wxCDMLibHelpDialog, wxDialog)
41 EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMLibHelpDialog::OnFinish)
42 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMLibHelpDialog::OnEditCMake)
43 EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMLibHelpDialog::OnDisableHelp)
46 wxCDMLibHelpDialog::wxCDMLibHelpDialog(
50 const wxString& caption,
51 const wxPoint& position,
56 wxCDMLibHelpDialog::Create(parent, id, caption, position, size, style);
60 wxCDMLibHelpDialog::~wxCDMLibHelpDialog()
64 bool wxCDMLibHelpDialog::Create(
67 const wxString& caption,
68 const wxPoint& position,
73 wxDialog::Create(parent, id, caption, position, size, style);
75 this->CreateControls();
80 void wxCDMLibHelpDialog::CreateControls()
82 wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
85 wxStaticText* title = new wxStaticText(this, wxID_ANY, wxT("Managing your libraries"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);//new wxRichTextCtrl(this,wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxRE_READONLY);
86 v_sizer1->Add(title, 0, wxALIGN_LEFT | wxALL | wxALIGN_CENTER_VERTICAL, 5);
88 wxStaticText* instruction = new wxStaticText(
92 "Libraries contain the core classes of your project, these libraries should be used by black boxes and applications "
93 "from this project to perform the main functions of the project. Functions implementing important tasks such as image "
94 "processing algorithms or point cloud processing algorithms should be developed in the libraries of the project, while "
95 "the black boxes and applications serve as interfaces between the user or other platforms and the libraries functions.\n"
97 "In the library manager you can view a list of the available libraries in the current project, as well as create "
98 "new libraries. Remember that any library you make must be included in the lib's folder CMakeLists file. You can do that "
99 "by clicking on the \"Edit Lib's CMakeLists File\" button bellow or in the Library Manager the \"Edit CMakeLists file\" "
100 "button and include the desired libraries at the end of the file."),
105 v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
107 wxButton* editCMakeLibBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Edit Lib's CMakeLists File"));
108 editCMakeLibBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibHelpDialog::OnEditCMakeMouseEnter,NULL,this);
109 editCMakeLibBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibHelpDialog::OnEditCMakeMouseExit,NULL,this);
110 v_sizer1->Add(editCMakeLibBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
112 v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10);
114 v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30);
120 void wxCDMLibHelpDialog::OnFinish(wxCommandEvent& event)
122 this->EndDialog(wxID_CANCEL);
125 void wxCDMLibHelpDialog::OnEditCMake(wxCommandEvent& event)
128 if(!this->lib->OpenCMakeListsFile(result))
129 wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
131 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
133 if(this->lib->GetCMakeLists() != NULL)
135 int CMId = this->lib->GetCMakeLists()->GetId();
136 newEvent->SetInt(CMId);
138 wxPostEvent(this->GetParent(), *newEvent);
143 void wxCDMLibHelpDialog::OnEditCMakeMouseEnter(wxMouseEvent& event)
145 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
147 if(this->lib->GetCMakeLists() != NULL)
149 int CMId = this->lib->GetCMakeLists()->GetId();
150 newEvent->SetInt(CMId);
152 wxPostEvent(this->GetParent(), *newEvent);
157 void wxCDMLibHelpDialog::OnEditCMakeMouseExit(wxMouseEvent& event)
159 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
161 if(this->lib->GetCMakeLists() != NULL)
163 int CMId = this->lib->GetCMakeLists()->GetId();
164 newEvent->SetInt(CMId);
166 wxPostEvent(this->GetParent(), *newEvent);
172 void wxCDMLibHelpDialog::OnDisableHelp(wxCommandEvent& event)
174 wxPostEvent(this->GetParent(), event);