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. You can do that "
98 "by clicking on the \"Edit Appli's CMakeLists File\" button bellow or in the Application Manager the \"Edit CMakeLists file\" "
99 "button and include the desired applications at the end of the file.\n"
100 "For a better understanding of how to use the applications please check the \"myFierceAppli\" application (which is shipped by "
101 "default in every new project) and take a look at how it's included in the project."),
106 v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
108 wxButton* editCMakeAppliBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Edit Appli's CMakeLists File"));
109 editCMakeAppliBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMAppliHelpDialog::OnCMakeListsEnter,NULL,this);
110 editCMakeAppliBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMAppliHelpDialog::OnCMakeListsExit,NULL,this);
111 v_sizer1->Add(editCMakeAppliBtn, 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 wxCDMAppliHelpDialog::OnFinish(wxCommandEvent& event)
123 this->EndDialog(wxID_CANCEL);
126 void wxCDMAppliHelpDialog::OnEditCMake(wxCommandEvent& event)
129 if(!this->appli->OpenCMakeListsFile(result))
130 wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
132 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
134 if(this->appli->GetCMakeLists() != NULL)
136 int CMId = this->appli->GetCMakeLists()->GetId();
137 newEvent->SetInt(CMId);
139 wxPostEvent(this->GetParent(), *newEvent);
144 void wxCDMAppliHelpDialog::OnCMakeListsEnter(wxMouseEvent& event)
146 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
148 if(this->appli->GetCMakeLists() != NULL)
150 int CMId = this->appli->GetCMakeLists()->GetId();
151 newEvent->SetInt(CMId);
153 wxPostEvent(this->GetParent(), *newEvent);
158 void wxCDMAppliHelpDialog::OnCMakeListsExit(wxMouseEvent& event)
160 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
162 if(this->appli->GetCMakeLists() != NULL)
164 int CMId = this->appli->GetCMakeLists()->GetId();
165 newEvent->SetInt(CMId);
167 wxPostEvent(this->GetParent(), *newEvent);
173 void wxCDMAppliHelpDialog::OnDisableHelp(wxCommandEvent& event)
175 wxPostEvent(this->GetParent(), event);