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 * wxCDMAppliHelpDialog.cpp
32 * Created on: 11/1/2013
33 * Author: Daniel Felipe Gonzalez Obando
36 #include "wxCDMAppliHelpDialog.h"
38 #include "creaDevManagerIds.h"
41 BEGIN_EVENT_TABLE(wxCDMAppliHelpDialog, wxDialog)
42 EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMAppliHelpDialog::OnFinish)
43 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMAppliHelpDialog::OnEditCMake)
44 EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMAppliHelpDialog::OnDisableHelp)
47 wxCDMAppliHelpDialog::wxCDMAppliHelpDialog(
51 const wxString& caption,
52 const wxPoint& position,
57 wxCDMAppliHelpDialog::Create(parent, id, caption, position, size, style);
61 wxCDMAppliHelpDialog::~wxCDMAppliHelpDialog()
65 bool wxCDMAppliHelpDialog::Create(
68 const wxString& caption,
69 const wxPoint& position,
74 wxDialog::Create(parent, id, caption, position, size, style);
76 this->CreateControls();
81 void wxCDMAppliHelpDialog::CreateControls()
83 wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
86 wxStaticText* title = new wxStaticText(this, wxID_ANY, wxT("Managing your applications"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);//new wxRichTextCtrl(this,wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxRE_READONLY);
87 v_sizer1->Add(title, 0, wxALIGN_LEFT | wxALL | wxALIGN_CENTER_VERTICAL, 5);
89 wxStaticText* instruction = new wxStaticText(
93 "Applications are stand alone programs that use the projects' core functionality (libraries' functions). These "
94 "applications are useful when showing the projects' \"out of the box\" functionalities.\n"
96 "In the application manager you can view a list of the available applications in the current project, as well as create "
97 "new applications. Remember that any application you make must be included in the appli's folder CMakeLists file by using the "
98 "\"ADD_SUBDIRECTORY([applicationName])\" command. You can do that by clicking on the \"Edit Appli's CMakeLists File\" button "
99 "below or in the Application Manager the \"Edit CMakeLists file\" button and include the desired applications at the end of "
101 "For a better understanding of how to use the applications please check the \"myFierceAppli\" application (which is shipped by "
102 "default in every new project) and take a look at how it's included in the project."),
107 v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
109 wxButton* editCMakeAppliBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Edit Appli's CMakeLists File"));
110 editCMakeAppliBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMAppliHelpDialog::OnCMakeListsEnter,NULL,this);
111 editCMakeAppliBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMAppliHelpDialog::OnCMakeListsExit,NULL,this);
112 v_sizer1->Add(editCMakeAppliBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15);
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);
122 void wxCDMAppliHelpDialog::OnFinish(wxCommandEvent& event)
124 this->EndDialog(wxID_CANCEL);
127 void wxCDMAppliHelpDialog::OnEditCMake(wxCommandEvent& event)
130 if(!this->appli->OpenCMakeListsFile(result))
131 wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
133 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
135 if(this->appli->GetCMakeLists() != NULL)
137 newEvent->SetClientData(this->appli->GetCMakeLists());
139 wxPostEvent(this->GetParent(), *newEvent);
144 void wxCDMAppliHelpDialog::OnCMakeListsEnter(wxMouseEvent& event)
146 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED);
148 if(this->appli->GetCMakeLists() != NULL)
150 newEvent->SetClientData(this->appli->GetCMakeLists());
152 wxPostEvent(this->GetParent(), *newEvent);
157 void wxCDMAppliHelpDialog::OnCMakeListsExit(wxMouseEvent& event)
159 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
161 if(this->appli->GetCMakeLists() != NULL)
163 newEvent->SetClientData(this->appli->GetCMakeLists());
165 wxPostEvent(this->GetParent(), *newEvent);
171 void wxCDMAppliHelpDialog::OnDisableHelp(wxCommandEvent& event)
173 wxPostEvent(this->GetParent(), event);