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 create must be included in the lib's folder CMakeLists file by using the "
99 "\"ADD_SUBDIRECTORY([libraryName])\" command. You can open this file by clicking on the \"Edit Lib's CMakeLists File\" "
100 "button below or in the Library Manager the \"Edit CMakeLists file\" button and include the desired libraries at the end "
106 v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
108 wxButton* editCMakeLibBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Edit Lib's CMakeLists File"));
109 editCMakeLibBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibHelpDialog::OnEditCMakeMouseEnter,NULL,this);
110 editCMakeLibBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibHelpDialog::OnEditCMakeMouseExit,NULL,this);
111 v_sizer1->Add(editCMakeLibBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
113 v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10);
115 v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30);
121 void wxCDMLibHelpDialog::OnFinish(wxCommandEvent& event)
123 this->EndDialog(wxID_CANCEL);
126 void wxCDMLibHelpDialog::OnEditCMake(wxCommandEvent& event)
129 if(!this->lib->OpenCMakeListsFile(result))
130 wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
132 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
134 if(this->lib->GetCMakeLists() != NULL)
136 newEvent->SetClientData(this->lib->GetCMakeLists());
138 wxPostEvent(this->GetParent(), *newEvent);
143 void wxCDMLibHelpDialog::OnEditCMakeMouseEnter(wxMouseEvent& event)
145 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED);
147 if(this->lib->GetCMakeLists() != NULL)
149 newEvent->SetClientData(this->lib->GetCMakeLists());
151 wxPostEvent(this->GetParent(), *newEvent);
156 void wxCDMLibHelpDialog::OnEditCMakeMouseExit(wxMouseEvent& event)
158 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
160 if(this->lib->GetCMakeLists() != NULL)
162 newEvent->SetClientData(this->lib->GetCMakeLists());
164 wxPostEvent(this->GetParent(), *newEvent);
170 void wxCDMLibHelpDialog::OnDisableHelp(wxCommandEvent& event)
172 wxPostEvent(this->GetParent(), event);