From 4e0312091408bc9bd77f3f70ade44d207365cdbe Mon Sep 17 00:00:00 2001 From: Daniel Gonzalez Date: Fri, 11 Jan 2013 12:12:19 +0100 Subject: [PATCH] Feature #1711 CreaDevManager application implementation -Fix Project View help dialog text: it now has a reference to the project model -Fix Package View help dialog text: it now has a reference to the package model -Application View help implemented: Still doesn't open CMakeLists files. -Appli View help implemented: Still doesn't open CMakeLists files. -BlackBox View help implemented: Still doesn't open CMakeLists files. -Lib View help implemented: Still doesn't open CMakeLists files. -Library View help implemented: Still doesn't open CMakeLists files. -package manager help doesn't open CMakeLists files. -package help doesn't open CMakeLists files. --- .../wxCDMAppliDescriptionPanel.cpp | 12 +- .../wxCDMAppliHelpDialog.cpp | 146 ++++++++++++++++ lib/creaDevManagerLib/wxCDMAppliHelpDialog.h | 86 ++++++++++ .../wxCDMApplicationDescriptionPanel.cpp | 8 + .../wxCDMApplicationHelpDialog.cpp | 157 +++++++++++++++++ .../wxCDMApplicationHelpDialog.h | 87 ++++++++++ .../wxCDMBlackBoxDescriptionPanel.cpp | 8 + .../wxCDMBlackBoxHelpDialog.cpp | 159 ++++++++++++++++++ .../wxCDMBlackBoxHelpDialog.h | 87 ++++++++++ .../wxCDMLibDescriptionPanel.cpp | 8 + lib/creaDevManagerLib/wxCDMLibHelpDialog.cpp | 146 ++++++++++++++++ lib/creaDevManagerLib/wxCDMLibHelpDialog.h | 86 ++++++++++ .../wxCDMLibraryDescriptionPanel.cpp | 8 + .../wxCDMLibraryHelpDialog.cpp | 157 +++++++++++++++++ .../wxCDMLibraryHelpDialog.h | 87 ++++++++++ .../wxCDMPackageDescriptionPanel.cpp | 3 +- .../wxCDMPackageHelpDialog.cpp | 4 +- .../wxCDMPackageHelpDialog.h | 6 +- .../wxCDMProjectDescriptionPanel.cpp | 2 +- .../wxCDMProjectHelpDialog.cpp | 123 +------------- .../wxCDMProjectHelpDialog.h | 13 +- 21 files changed, 1255 insertions(+), 138 deletions(-) create mode 100644 lib/creaDevManagerLib/wxCDMAppliHelpDialog.cpp create mode 100644 lib/creaDevManagerLib/wxCDMAppliHelpDialog.h create mode 100644 lib/creaDevManagerLib/wxCDMApplicationHelpDialog.cpp create mode 100644 lib/creaDevManagerLib/wxCDMApplicationHelpDialog.h create mode 100644 lib/creaDevManagerLib/wxCDMBlackBoxHelpDialog.cpp create mode 100644 lib/creaDevManagerLib/wxCDMBlackBoxHelpDialog.h create mode 100644 lib/creaDevManagerLib/wxCDMLibHelpDialog.cpp create mode 100644 lib/creaDevManagerLib/wxCDMLibHelpDialog.h create mode 100644 lib/creaDevManagerLib/wxCDMLibraryHelpDialog.cpp create mode 100644 lib/creaDevManagerLib/wxCDMLibraryHelpDialog.h diff --git a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp index e7bde23..9fb749d 100644 --- a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp @@ -34,9 +34,13 @@ #include "wxCDMAppliDescriptionPanel.h" -#include "creaDevManagerIds.h" + #include "wxCDMMainFrame.h" + +#include "wxCDMAppliHelpDialog.h" + +#include "creaDevManagerIds.h" #include "images/ApIcon64.xpm" BEGIN_EVENT_TABLE(wxCDMAppliDescriptionPanel, wxPanel) @@ -144,6 +148,12 @@ void wxCDMAppliDescriptionPanel::CreateControls() //Assign sizer SetSizer(sizer); sizer->SetSizeHints(this); + + if (((wxCDMMainFrame*)this->GetParent())->isHelp()) + { + wxCDMAppliHelpDialog* helpDialog = new wxCDMAppliHelpDialog(this->GetParent(), this->appli, wxID_ANY); + helpDialog->Show(true); + } } void wxCDMAppliDescriptionPanel::OnBtnCreateApplication(wxCommandEvent& event) diff --git a/lib/creaDevManagerLib/wxCDMAppliHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMAppliHelpDialog.cpp new file mode 100644 index 0000000..e3d487e --- /dev/null +++ b/lib/creaDevManagerLib/wxCDMAppliHelpDialog.cpp @@ -0,0 +1,146 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + + +/* + * wxCDMAppliHelpDialog.cpp + * + * Created on: 11/1/2013 + * Author: Daniel Felipe Gonzalez Obando + */ + +#include "wxCDMAppliHelpDialog.h" + +#include "creaDevManagerIds.h" + +BEGIN_EVENT_TABLE(wxCDMAppliHelpDialog, wxDialog) +EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMAppliHelpDialog::OnFinish) +EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMAppliHelpDialog::OnEditCMake) +EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMAppliHelpDialog::OnDisableHelp) +END_EVENT_TABLE() + +wxCDMAppliHelpDialog::wxCDMAppliHelpDialog( + wxWindow* parent, + modelCDMAppli* appli, + wxWindowID id, + const wxString& caption, + const wxPoint& position, + const wxSize& size, + long style +) +{ + wxCDMAppliHelpDialog::Create(parent, id, caption, position, size, style); + this->appli = appli; +} + +wxCDMAppliHelpDialog::~wxCDMAppliHelpDialog() +{ +} + +bool wxCDMAppliHelpDialog::Create( + wxWindow* parent, + wxWindowID id, + const wxString& caption, + const wxPoint& position, + const wxSize& size, + long int style +) +{ + wxDialog::Create(parent, id, caption, position, size, style); + + this->CreateControls(); + + return TRUE; +} + +void wxCDMAppliHelpDialog::CreateControls() +{ + wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL); + + + 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); + v_sizer1->Add(title, 0, wxALIGN_LEFT | wxALL | wxALIGN_CENTER_VERTICAL, 5); + + wxStaticText* instruction = new wxStaticText( + this, + wxID_ANY, + crea::std2wx( + "Applications are stand alone programs that use the projects' core functionality (libraries' functions). These " + "applications are useful when showing the projects' \"out of the box\" functionalities.\n" + "\n" + "In the application manager you can view a list of the available applications in the current project, as well as create " + "new applications. Remember that any application you make must be included in the appli's folder CMakeLists file. You can do that " + "by clicking on the \"Edit Appli's CMakeLists File\" button bellow or in the Application Manager the \"Edit CMakeLists file\" " + "button and include the desired applications at the end of the file.\n" + "For a better understanding of how to use the applications please check the \"myFierceAppli\" application (which is shipped by " + "default in every new project) and take a look at how it's included in the project."), + wxDefaultPosition, + wxDefaultSize, + wxALIGN_LEFT + ); + v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5); + + v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10); + + v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30); + + SetSizer(v_sizer1); + +} + +void wxCDMAppliHelpDialog::OnFinish(wxCommandEvent& event) +{ + this->EndDialog(wxID_CANCEL); +} + +void wxCDMAppliHelpDialog::OnEditCMake(wxCommandEvent& event) +{ + //TODO: implement method + std::cout << "OnEditCMake not implemented yet." << std::endl; + event.Skip(); +} + + +void wxCDMAppliHelpDialog::OnEditCMakeMouseEnter(wxMouseEvent& event) +{ + //TODO: implement method + std::cout << "OnEditCMakeEnter not implemented yet." << std::endl; + event.Skip(); +} + +void wxCDMAppliHelpDialog::OnEditCMakeMouseExit(wxMouseEvent& event) +{ + //TODO: implement method + std::cout << "OnEditCMakeExit not implemented yet." << std::endl; + event.Skip(); +} + + +void wxCDMAppliHelpDialog::OnDisableHelp(wxCommandEvent& event) +{ + wxPostEvent(this->GetParent(), event); +} diff --git a/lib/creaDevManagerLib/wxCDMAppliHelpDialog.h b/lib/creaDevManagerLib/wxCDMAppliHelpDialog.h new file mode 100644 index 0000000..4f60da9 --- /dev/null +++ b/lib/creaDevManagerLib/wxCDMAppliHelpDialog.h @@ -0,0 +1,86 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ +*/ + + +/* + * wxCDMAppliHelpDialog.h + * + * Created on: 11/1/2013 + * Author: Daniel Felipe Gonzalez Obando + */ + +#ifndef WXCDMAPPLIHELPDIALOG_H_ +#define WXCDMAPPLIHELPDIALOG_H_ + +#include +#include + +#include "modelCDMAppli.h" + +class wxCDMAppliHelpDialog : public wxDialog +{ + DECLARE_EVENT_TABLE() +public: + wxCDMAppliHelpDialog( + wxWindow* parent, + modelCDMAppli* appli, + wxWindowID id = wxID_ANY, + const wxString& caption = wxT("Managing Packages"), + const wxPoint& position = wxDefaultPosition, + const wxSize& size = wxSize(350,600), + long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER + ); + ~wxCDMAppliHelpDialog(); + bool Create( + wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& caption = wxT("Managing Packages"), + const wxPoint& position = wxDefaultPosition, + const wxSize& size = wxSize(350,600), + long style = wxDEFAULT_DIALOG_STYLE + ); + +protected: + void CreateControls(); + +//attributes +private: + modelCDMAppli* appli; + +//handlers +protected: + void OnFinish(wxCommandEvent& event); + + void OnEditCMake(wxCommandEvent& event); + + void OnEditCMakeMouseEnter(wxMouseEvent& event); + void OnEditCMakeMouseExit(wxMouseEvent& event); + + void OnDisableHelp(wxCommandEvent& event); +}; + +#endif /* WXCDMAPPLIHELPDIALOG_H_ */ diff --git a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp index ddb0da9..2180eb7 100644 --- a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp @@ -37,6 +37,8 @@ #include "CDMUtilities.h" #include "wxCDMMainFrame.h" +#include "wxCDMApplicationHelpDialog.h" + #include "creaDevManagerIds.h" #include "images/AIcon64.xpm" @@ -161,6 +163,12 @@ void wxCDMApplicationDescriptionPanel::CreateControls() //Assign sizer SetSizer(sizer); sizer->SetSizeHints(this); + + if (((wxCDMMainFrame*)this->GetParent())->isHelp()) + { + wxCDMApplicationHelpDialog* helpDialog = new wxCDMApplicationHelpDialog(this->GetParent(), this->application, wxID_ANY); + helpDialog->Show(true); + } } void wxCDMApplicationDescriptionPanel::OnBtnReturn(wxCommandEvent& event) diff --git a/lib/creaDevManagerLib/wxCDMApplicationHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMApplicationHelpDialog.cpp new file mode 100644 index 0000000..d9ff03a --- /dev/null +++ b/lib/creaDevManagerLib/wxCDMApplicationHelpDialog.cpp @@ -0,0 +1,157 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + + +/* + * wxCDMApplicationHelpDialog.cpp + * + * Created on: 11/1/2013 + * Author: Daniel Felipe Gonzalez Obando + */ + +#include "wxCDMApplicationHelpDialog.h" + +#include "creaDevManagerIds.h" + +BEGIN_EVENT_TABLE(wxCDMApplicationHelpDialog, wxDialog) +EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMApplicationHelpDialog::OnFinish) +EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMApplicationHelpDialog::OnCMakeLists) +EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMApplicationHelpDialog::OnCMakeLists) +EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMApplicationHelpDialog::OnDisableHelp) +END_EVENT_TABLE() + +wxCDMApplicationHelpDialog::wxCDMApplicationHelpDialog( + wxWindow* parent, + modelCDMApplication* application, + wxWindowID id, + const wxString& caption, + const wxPoint& position, + const wxSize& size, + long style +) +{ + wxCDMApplicationHelpDialog::Create(parent, id, caption, position, size, style); + this->application = application; +} + +wxCDMApplicationHelpDialog::~wxCDMApplicationHelpDialog() +{ +} + +bool wxCDMApplicationHelpDialog::Create( + wxWindow* parent, + wxWindowID id, + const wxString& caption, + const wxPoint& position, + const wxSize& size, + long int style +) +{ + wxDialog::Create(parent, id, caption, position, size, style); + + this->CreateControls(); + + return TRUE; +} + +void wxCDMApplicationHelpDialog::CreateControls() +{ + + wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL); + + + wxStaticText* title = new wxStaticText(this, wxID_ANY, wxT("Working with Applications"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);//new wxRichTextCtrl(this,wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxRE_READONLY); + v_sizer1->Add(title, 0, wxALIGN_LEFT | wxALL | wxALIGN_CENTER_VERTICAL, 5); + + wxStaticText* instruction = new wxStaticText( + this, + wxID_ANY, + crea::std2wx( + "Applications are stand alone programs that use the projects' core functionality (libraries' functions). These " + "applications are useful when showing the projects' \"out of the box\" functionalities.\n" + "Applications are stored in the project's appli folder and each application has its own dedicated folder. Inside " + "these folders each application has its main file.\n" + "\n" + "To start developing an application, go ahead and open the application main file with the button \"Open Main File\" " + "and implement the application's functionality.\n" + "If you need to create separate classes in the application folder, or inside an specific folders you can do it by " + "creating a new class with the \"Create Class\" button or by creating a folder with the \"Create Folder\" button.\n" + "Then, in order to include your applications in the project correctly you must include them in the appli's folder " + "\"CMakeLists.txt\" file. Also, if you create additional folders in your library you should include them in the application's " + "\"CMakeLists.txt\" file.\n" + "\n" + "You can easily edit the CMakeLists files previously mentioned by clicking on the following buttons."), + wxDefaultPosition, + wxDefaultSize, + wxALIGN_LEFT + ); + v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5); + + wxButton* editCMakePKGBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Open Application's directory CMakeLists file")); + wxButton* editCMakePRJBtn= new wxButton(this, ID_BUTTON_OPENPROJECT, wxT("Open Appli's directory CMakeLists file")); + + v_sizer1->Add(editCMakePKGBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15); + v_sizer1->Add(editCMakePRJBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15); + + v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10); + + v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30); + + SetSizer(v_sizer1); + //v_sizer1->RecalcSizes(); +} + +void wxCDMApplicationHelpDialog::OnFinish(wxCommandEvent& event) +{ + this->EndDialog(wxID_CANCEL); +} + +void wxCDMApplicationHelpDialog::OnCMakeLists(wxCommandEvent& event) +{ + //TODO: implement method + std::cout << "OnCMakeLists not implemented yet." << std::endl; + event.Skip(); +} + +void wxCDMApplicationHelpDialog::OnCMakeListsEnter(wxMouseEvent& event) +{ + //TODO: implement method + std::cout << "OnCMakeListsEnter not implemented yet." << std::endl; + event.Skip(); +} + +void wxCDMApplicationHelpDialog::OnCMakeListsExit(wxMouseEvent& event) +{ + //TODO: implement method + std::cout << "OnCMakeListsExit not implemented yet." << std::endl; + event.Skip(); +} + +void wxCDMApplicationHelpDialog::OnDisableHelp(wxCommandEvent& event) +{ + wxPostEvent(this->GetParent(), event); +} diff --git a/lib/creaDevManagerLib/wxCDMApplicationHelpDialog.h b/lib/creaDevManagerLib/wxCDMApplicationHelpDialog.h new file mode 100644 index 0000000..084c181 --- /dev/null +++ b/lib/creaDevManagerLib/wxCDMApplicationHelpDialog.h @@ -0,0 +1,87 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ +*/ + + +/* + * wxCDMApplicationHelpDialog.h + * + * Created on: 11/1/2013 + * Author: Daniel Felipe Gonzalez Obando + */ + +#ifndef WXCDMAPPLICATIONHELPDIALOG_H_ +#define WXCDMAPPLICATIONHELPDIALOG_H_ + +#include +#include + +#include "modelCDMApplication.h" + +#include + +class wxCDMApplicationHelpDialog : public wxDialog +{ + DECLARE_EVENT_TABLE() +public: + wxCDMApplicationHelpDialog( + wxWindow* parent, + modelCDMApplication* application, + wxWindowID id = wxID_ANY, + const wxString& caption = wxT("Working With Applications"), + const wxPoint& position = wxDefaultPosition, + const wxSize& size = wxSize(410,670), + long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER + ); + ~wxCDMApplicationHelpDialog(); + bool Create( + wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& caption = wxT("Working With Applications"), + const wxPoint& position = wxDefaultPosition, + const wxSize& size = wxSize(410,670), + long style = wxDEFAULT_DIALOG_STYLE + ); + +protected: + void CreateControls(); + +private: + modelCDMApplication* application; + +//handlers +protected: + void OnFinish(wxCommandEvent& event); + + void OnCMakeLists(wxCommandEvent& event); + + void OnCMakeListsEnter(wxMouseEvent& event); + void OnCMakeListsExit(wxMouseEvent& event); + + void OnDisableHelp(wxCommandEvent& event); +}; + +#endif /* WXCDMAPPLICATIONHELPDIALOG_H_ */ diff --git a/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp index d972925..eb0ed5a 100644 --- a/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp @@ -36,6 +36,8 @@ #include "wxCDMMainFrame.h" +#include "wxCDMBlackBoxHelpDialog.h" + #include "creaDevManagerIds.h" #include "images/BBIcon64.xpm" @@ -174,6 +176,12 @@ void wxCDMBlackBoxDescriptionPanel::CreateControls() //Assign sizer SetSizer(sizer); sizer->SetSizeHints(this); + + if (((wxCDMMainFrame*)this->GetParent())->isHelp()) + { + wxCDMBlackBoxHelpDialog* helpDialog = new wxCDMBlackBoxHelpDialog(this->GetParent(), this->blackBox, wxID_ANY); + helpDialog->Show(true); + } } void wxCDMBlackBoxDescriptionPanel::OnBtnReturn(wxCommandEvent& event) diff --git a/lib/creaDevManagerLib/wxCDMBlackBoxHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMBlackBoxHelpDialog.cpp new file mode 100644 index 0000000..4d4ff43 --- /dev/null +++ b/lib/creaDevManagerLib/wxCDMBlackBoxHelpDialog.cpp @@ -0,0 +1,159 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + + +/* + * wxCDMBlackBoxHelpDialog.cpp + * + * Created on: 11/1/2013 + * Author: Daniel Felipe Gonzalez Obando + */ + +#include "wxCDMBlackBoxHelpDialog.h" + +#include "creaDevManagerIds.h" + +BEGIN_EVENT_TABLE(wxCDMBlackBoxHelpDialog, wxDialog) +EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMBlackBoxHelpDialog::OnFinish) +EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMBlackBoxHelpDialog::OnCMakeLists) +EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMBlackBoxHelpDialog::OnCMakeLists) +EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMBlackBoxHelpDialog::OnDisableHelp) +END_EVENT_TABLE() + +wxCDMBlackBoxHelpDialog::wxCDMBlackBoxHelpDialog( + wxWindow* parent, + modelCDMBlackBox* blackBox, + wxWindowID id, + const wxString& caption, + const wxPoint& position, + const wxSize& size, + long style +) +{ + wxCDMBlackBoxHelpDialog::Create(parent, id, caption, position, size, style); + this->blackBox = blackBox; +} + +wxCDMBlackBoxHelpDialog::~wxCDMBlackBoxHelpDialog() +{ +} + +bool wxCDMBlackBoxHelpDialog::Create( + wxWindow* parent, + wxWindowID id, + const wxString& caption, + const wxPoint& position, + const wxSize& size, + long int style +) +{ + wxDialog::Create(parent, id, caption, position, size, style); + + this->CreateControls(); + + return TRUE; +} + +void wxCDMBlackBoxHelpDialog::CreateControls() +{ + + wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL); + + + wxStaticText* title = new wxStaticText(this, wxID_ANY, wxT("Working with BlackBoxes"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);//new wxRichTextCtrl(this,wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxRE_READONLY); + v_sizer1->Add(title, 0, wxALIGN_LEFT | wxALL | wxALIGN_CENTER_VERTICAL, 5); + + wxStaticText* instruction = new wxStaticText( + this, + wxID_ANY, + crea::std2wx( + "Black boxes are made to work in a modular fashion. They have programmer defined inputs and outputs. Their " + "purpose is to use the functions available in the libraries and expose them to be used as boxes in the crea " + "environment.\n" + "Black boxes are stored in the src folder of a package and they are composed of two files, the header(.h) " + "and the implementation(.cxx) files.\n" + "To start developing black boxes, go ahead and open the header file with the button \"Open .h\" and define " + "the inputs and outputs of the black box. Then, you will be able to use them in the implementation file, which " + "you can open using the \"Open .cxx\" button.\n" + "If you don't understand how this inputs and outputs are used, try looking at the sample black boxes available " + "in the sample package, which is shipped with every new project.\n" + "Also, don't forget to include the libraries your boxes use in the header and implementation files. They should " + "also be pointed and included in the package's directory CMakeLists.txt file and the project's directory " + "CMakeLists.txt file. Again, please take a look at the sample package and its boxes to see how to include libraries " + "in order to use them in the boxes.\n" + "\n" + "You can easily edit the CMakeLists files previously mentioned by clicking on the following buttons."), + wxDefaultPosition, + wxDefaultSize, + wxALIGN_LEFT + ); + v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5); + + wxButton* editCMakePKGBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Open Package's directory CMakeLists file")); + wxButton* editCMakePRJBtn= new wxButton(this, ID_BUTTON_OPENPROJECT, wxT("Open Project's directory CMakeLists file")); + + v_sizer1->Add(editCMakePKGBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15); + v_sizer1->Add(editCMakePRJBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15); + + v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10); + + v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30); + + SetSizer(v_sizer1); + //v_sizer1->RecalcSizes(); +} + +void wxCDMBlackBoxHelpDialog::OnFinish(wxCommandEvent& event) +{ + this->EndDialog(wxID_CANCEL); +} + +void wxCDMBlackBoxHelpDialog::OnCMakeLists(wxCommandEvent& event) +{ + //TODO: implement method + std::cout << "OnCMakeLists not implemented yet." << std::endl; + event.Skip(); +} + +void wxCDMBlackBoxHelpDialog::OnCMakeListsEnter(wxMouseEvent& event) +{ + //TODO: implement method + std::cout << "OnCMakeListsEnter not implemented yet." << std::endl; + event.Skip(); +} + +void wxCDMBlackBoxHelpDialog::OnCMakeListsExit(wxMouseEvent& event) +{ + //TODO: implement method + std::cout << "OnCMakeListsExit not implemented yet." << std::endl; + event.Skip(); +} + +void wxCDMBlackBoxHelpDialog::OnDisableHelp(wxCommandEvent& event) +{ + wxPostEvent(this->GetParent(), event); +} diff --git a/lib/creaDevManagerLib/wxCDMBlackBoxHelpDialog.h b/lib/creaDevManagerLib/wxCDMBlackBoxHelpDialog.h new file mode 100644 index 0000000..40fca32 --- /dev/null +++ b/lib/creaDevManagerLib/wxCDMBlackBoxHelpDialog.h @@ -0,0 +1,87 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ +*/ + + +/* + * wxCDMBlackBoxHelpDialog.h + * + * Created on: 11/1/2013 + * Author: Daniel Felipe Gonzalez Obando + */ + +#ifndef WXCDMBLACKBOXHELPDIALOG_H_ +#define WXCDMBLACKBOXHELPDIALOG_H_ + +#include +#include + +#include "modelCDMBlackBox.h" + +#include + +class wxCDMBlackBoxHelpDialog : public wxDialog +{ + DECLARE_EVENT_TABLE() +public: + wxCDMBlackBoxHelpDialog( + wxWindow* parent, + modelCDMBlackBox* blackBox, + wxWindowID id = wxID_ANY, + const wxString& caption = wxT("Working With Black Boxes"), + const wxPoint& position = wxDefaultPosition, + const wxSize& size = wxSize(410,700), + long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER + ); + ~wxCDMBlackBoxHelpDialog(); + bool Create( + wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& caption = wxT("Working With Black Boxes"), + const wxPoint& position = wxDefaultPosition, + const wxSize& size = wxSize(410,700), + long style = wxDEFAULT_DIALOG_STYLE + ); + +protected: + void CreateControls(); + +private: + modelCDMBlackBox* blackBox; + +//handlers +protected: + void OnFinish(wxCommandEvent& event); + + void OnCMakeLists(wxCommandEvent& event); + + void OnCMakeListsEnter(wxMouseEvent& event); + void OnCMakeListsExit(wxMouseEvent& event); + + void OnDisableHelp(wxCommandEvent& event); +}; + +#endif /* WXCDMBLACKBOXHELPDIALOG_H_ */ diff --git a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp index d31f2b2..4edb01f 100644 --- a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp @@ -36,6 +36,8 @@ #include "wxCDMMainFrame.h" +#include "wxCDMLibHelpDialog.h" + #include "creaDevManagerIds.h" #include "images/LbIcon64.xpm" @@ -144,6 +146,12 @@ void wxCDMLibDescriptionPanel::CreateControls() //Assign sizer SetSizer(sizer); sizer->SetSizeHints(this); + + if (((wxCDMMainFrame*)this->GetParent())->isHelp()) + { + wxCDMLibHelpDialog* helpDialog = new wxCDMLibHelpDialog(this->GetParent(), this->lib, wxID_ANY); + helpDialog->Show(true); + } } void wxCDMLibDescriptionPanel::OnBtnCreateLibrary(wxCommandEvent& event) diff --git a/lib/creaDevManagerLib/wxCDMLibHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMLibHelpDialog.cpp new file mode 100644 index 0000000..85e83aa --- /dev/null +++ b/lib/creaDevManagerLib/wxCDMLibHelpDialog.cpp @@ -0,0 +1,146 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + + +/* + * wxCDMLibHelpDialog.cpp + * + * Created on: 11/1/2013 + * Author: Daniel Felipe Gonzalez Obando + */ + +#include "wxCDMLibHelpDialog.h" + +#include "creaDevManagerIds.h" + +BEGIN_EVENT_TABLE(wxCDMLibHelpDialog, wxDialog) +EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMLibHelpDialog::OnFinish) +EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMLibHelpDialog::OnEditCMake) +EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMLibHelpDialog::OnDisableHelp) +END_EVENT_TABLE() + +wxCDMLibHelpDialog::wxCDMLibHelpDialog( + wxWindow* parent, + modelCDMLib* lib, + wxWindowID id, + const wxString& caption, + const wxPoint& position, + const wxSize& size, + long style +) +{ + wxCDMLibHelpDialog::Create(parent, id, caption, position, size, style); + this->lib = lib; +} + +wxCDMLibHelpDialog::~wxCDMLibHelpDialog() +{ +} + +bool wxCDMLibHelpDialog::Create( + wxWindow* parent, + wxWindowID id, + const wxString& caption, + const wxPoint& position, + const wxSize& size, + long int style +) +{ + wxDialog::Create(parent, id, caption, position, size, style); + + this->CreateControls(); + + return TRUE; +} + +void wxCDMLibHelpDialog::CreateControls() +{ + wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL); + + + 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); + v_sizer1->Add(title, 0, wxALIGN_LEFT | wxALL | wxALIGN_CENTER_VERTICAL, 5); + + wxStaticText* instruction = new wxStaticText( + this, + wxID_ANY, + crea::std2wx( + "Libraries contain the core classes of your project, these libraries should be used by black boxes and applications " + "from this project to perform the main functions of the project. Functions implementing important tasks such as image " + "processing algorithms or point cloud processing algorithms should be developed in the libraries of the project, while " + "the black boxes and applications serve as interfaces between the user or other platforms and the libraries functions.\n" + "\n" + "In the library manager you can view a list of the available libraries in the current project, as well as create " + "new libraries. Remember that any library you make must be included in the lib's folder CMakeLists file. You can do that " + "by clicking on the \"Edit Lib's CMakeLists File\" button bellow or in the Library Manager the \"Edit CMakeLists file\" " + "button and include the desired libraries at the end of the file."), + wxDefaultPosition, + wxDefaultSize, + wxALIGN_LEFT + ); + v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5); + + v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10); + + v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30); + + SetSizer(v_sizer1); + +} + +void wxCDMLibHelpDialog::OnFinish(wxCommandEvent& event) +{ + this->EndDialog(wxID_CANCEL); +} + +void wxCDMLibHelpDialog::OnEditCMake(wxCommandEvent& event) +{ + //TODO: implement method + std::cout << "OnEditCMake not implemented yet." << std::endl; + event.Skip(); +} + + +void wxCDMLibHelpDialog::OnEditCMakeMouseEnter(wxMouseEvent& event) +{ + //TODO: implement method + std::cout << "OnEditCMakeEnter not implemented yet." << std::endl; + event.Skip(); +} + +void wxCDMLibHelpDialog::OnEditCMakeMouseExit(wxMouseEvent& event) +{ + //TODO: implement method + std::cout << "OnEditCMakeExit not implemented yet." << std::endl; + event.Skip(); +} + + +void wxCDMLibHelpDialog::OnDisableHelp(wxCommandEvent& event) +{ + wxPostEvent(this->GetParent(), event); +} diff --git a/lib/creaDevManagerLib/wxCDMLibHelpDialog.h b/lib/creaDevManagerLib/wxCDMLibHelpDialog.h new file mode 100644 index 0000000..59a000f --- /dev/null +++ b/lib/creaDevManagerLib/wxCDMLibHelpDialog.h @@ -0,0 +1,86 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ +*/ + + +/* + * wxCDMLibHelpDialog.h + * + * Created on: 11/1/2013 + * Author: Daniel Felipe Gonzalez Obando + */ + +#ifndef WXCDMLIBHELPDIALOG_H_ +#define WXCDMLIBHELPDIALOG_H_ + +#include +#include + +#include "modelCDMLib.h" + +class wxCDMLibHelpDialog : public wxDialog +{ + DECLARE_EVENT_TABLE() +public: + wxCDMLibHelpDialog( + wxWindow* parent, + modelCDMLib* lib, + wxWindowID id = wxID_ANY, + const wxString& caption = wxT("Managing Libraries"), + const wxPoint& position = wxDefaultPosition, + const wxSize& size = wxSize(350,600), + long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER + ); + ~wxCDMLibHelpDialog(); + bool Create( + wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& caption = wxT("Managing Libraries"), + const wxPoint& position = wxDefaultPosition, + const wxSize& size = wxSize(350,600), + long style = wxDEFAULT_DIALOG_STYLE + ); + +protected: + void CreateControls(); + +//attributes +private: + modelCDMLib* lib; + +//handlers +protected: + void OnFinish(wxCommandEvent& event); + + void OnEditCMake(wxCommandEvent& event); + + void OnEditCMakeMouseEnter(wxMouseEvent& event); + void OnEditCMakeMouseExit(wxMouseEvent& event); + + void OnDisableHelp(wxCommandEvent& event); +}; + +#endif /* WXCDMLIBHELPDIALOG_H_ */ diff --git a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp index 1c14b74..fd207a5 100644 --- a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp @@ -37,6 +37,8 @@ #include "CDMUtilities.h" #include "wxCDMMainFrame.h" +#include "wxCDMLibraryHelpDialog.h" + #include "creaDevManagerIds.h" #include "images/LIcon64.xpm" @@ -154,6 +156,12 @@ void wxCDMLibraryDescriptionPanel::CreateControls() //Assign sizer SetSizer(sizer); sizer->SetSizeHints(this); + + if (((wxCDMMainFrame*)this->GetParent())->isHelp()) + { + wxCDMLibraryHelpDialog* helpDialog = new wxCDMLibraryHelpDialog(this->GetParent(), this->library, wxID_ANY); + helpDialog->Show(true); + } } void wxCDMLibraryDescriptionPanel::OnBtnReturn(wxCommandEvent& event) diff --git a/lib/creaDevManagerLib/wxCDMLibraryHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMLibraryHelpDialog.cpp new file mode 100644 index 0000000..455b559 --- /dev/null +++ b/lib/creaDevManagerLib/wxCDMLibraryHelpDialog.cpp @@ -0,0 +1,157 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ + */ + + +/* + * wxCDMLibraryHelpDialog.cpp + * + * Created on: 11/1/2013 + * Author: Daniel Felipe Gonzalez Obando + */ + +#include "wxCDMLibraryHelpDialog.h" + +#include "creaDevManagerIds.h" + +BEGIN_EVENT_TABLE(wxCDMLibraryHelpDialog, wxDialog) +EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMLibraryHelpDialog::OnFinish) +EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMLibraryHelpDialog::OnCMakeLists) +EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMLibraryHelpDialog::OnCMakeLists) +EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMLibraryHelpDialog::OnDisableHelp) +END_EVENT_TABLE() + +wxCDMLibraryHelpDialog::wxCDMLibraryHelpDialog( + wxWindow* parent, + modelCDMLibrary* library, + wxWindowID id, + const wxString& caption, + const wxPoint& position, + const wxSize& size, + long style +) +{ + wxCDMLibraryHelpDialog::Create(parent, id, caption, position, size, style); + this->library = library; +} + +wxCDMLibraryHelpDialog::~wxCDMLibraryHelpDialog() +{ +} + +bool wxCDMLibraryHelpDialog::Create( + wxWindow* parent, + wxWindowID id, + const wxString& caption, + const wxPoint& position, + const wxSize& size, + long int style +) +{ + wxDialog::Create(parent, id, caption, position, size, style); + + this->CreateControls(); + + return TRUE; +} + +void wxCDMLibraryHelpDialog::CreateControls() +{ + + wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL); + + + wxStaticText* title = new wxStaticText(this, wxID_ANY, wxT("Working with Libraries"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);//new wxRichTextCtrl(this,wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxRE_READONLY); + v_sizer1->Add(title, 0, wxALIGN_LEFT | wxALL | wxALIGN_CENTER_VERTICAL, 5); + + wxStaticText* instruction = new wxStaticText( + this, + wxID_ANY, + crea::std2wx( + "Libraries are made to expose the projects' main functionalities to the applications and black boxes of the project. " + "The functions and classes available in the libraries are the core of any project, thus they should implement important " + "tasks such as image processing algorithms or point cloud processing algorithms." + "Libraries are stored in the project's lib folder and each library has its own dedicated folder. Inside these folders " + "each library has its classes.\n" + "\n" + "To start developing a library, go ahead and create a new class with the button \"Create Class\" and implement the main " + "functionalities of your project inside the created files.\n" + "If you need to separate classes in folders you can do it by creating a folder with the \"Create Folder\" button.\n" + "Then, in order to include your libraries in the project correctly you must include them in the lib's folder " + "\"CMakeLists.txt\" file. Also, if you create additional folders in your library you should include them in the library's " + "\"CMakeLists.txt\" file.\n" + "\n" + "You can easily edit the CMakeLists files previously mentioned by clicking on the following buttons."), + wxDefaultPosition, + wxDefaultSize, + wxALIGN_LEFT + ); + v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5); + + wxButton* editCMakePKGBtn = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Open Library's directory CMakeLists file")); + wxButton* editCMakePRJBtn= new wxButton(this, ID_BUTTON_OPENPROJECT, wxT("Open Lib's directory CMakeLists file")); + + v_sizer1->Add(editCMakePKGBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15); + v_sizer1->Add(editCMakePRJBtn, 0, wxEXPAND | wxLEFT | wxRIGHT, 15); + + v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10); + + v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30); + + SetSizer(v_sizer1); + //v_sizer1->RecalcSizes(); +} + +void wxCDMLibraryHelpDialog::OnFinish(wxCommandEvent& event) +{ + this->EndDialog(wxID_CANCEL); +} + +void wxCDMLibraryHelpDialog::OnCMakeLists(wxCommandEvent& event) +{ + //TODO: implement method + std::cout << "OnCMakeLists not implemented yet." << std::endl; + event.Skip(); +} + +void wxCDMLibraryHelpDialog::OnCMakeListsEnter(wxMouseEvent& event) +{ + //TODO: implement method + std::cout << "OnCMakeListsEnter not implemented yet." << std::endl; + event.Skip(); +} + +void wxCDMLibraryHelpDialog::OnCMakeListsExit(wxMouseEvent& event) +{ + //TODO: implement method + std::cout << "OnCMakeListsExit not implemented yet." << std::endl; + event.Skip(); +} + +void wxCDMLibraryHelpDialog::OnDisableHelp(wxCommandEvent& event) +{ + wxPostEvent(this->GetParent(), event); +} diff --git a/lib/creaDevManagerLib/wxCDMLibraryHelpDialog.h b/lib/creaDevManagerLib/wxCDMLibraryHelpDialog.h new file mode 100644 index 0000000..328ee4d --- /dev/null +++ b/lib/creaDevManagerLib/wxCDMLibraryHelpDialog.h @@ -0,0 +1,87 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Sant�) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# Previous Authors : Laurent Guigues, Jean-Pierre Roux +# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ +*/ + + +/* + * wxCDMLibraryHelpDialog.h + * + * Created on: 11/1/2013 + * Author: Daniel Felipe Gonzalez Obando + */ + +#ifndef WXCDMLIBRARYHELPDIALOG_H_ +#define WXCDMLIRBARYHELPDIALOG_H_ + +#include +#include + +#include "modelCDMLibrary.h" + +#include + +class wxCDMLibraryHelpDialog : public wxDialog +{ + DECLARE_EVENT_TABLE() +public: + wxCDMLibraryHelpDialog( + wxWindow* parent, + modelCDMLibrary* library, + wxWindowID id = wxID_ANY, + const wxString& caption = wxT("Working With Libraries"), + const wxPoint& position = wxDefaultPosition, + const wxSize& size = wxSize(410,650), + long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER + ); + ~wxCDMLibraryHelpDialog(); + bool Create( + wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& caption = wxT("Working With Libraries"), + const wxPoint& position = wxDefaultPosition, + const wxSize& size = wxSize(410,650), + long style = wxDEFAULT_DIALOG_STYLE + ); + +protected: + void CreateControls(); + +private: + modelCDMLibrary* library; + +//handlers +protected: + void OnFinish(wxCommandEvent& event); + + void OnCMakeLists(wxCommandEvent& event); + + void OnCMakeListsEnter(wxMouseEvent& event); + void OnCMakeListsExit(wxMouseEvent& event); + + void OnDisableHelp(wxCommandEvent& event); +}; + +#endif /* WXCDMLIRBARYHELPDIALOG_H_ */ diff --git a/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp index 74cd7fc..e6f70b2 100644 --- a/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp @@ -217,8 +217,7 @@ void wxCDMPackageDescriptionPanel::CreateControls() if (((wxCDMMainFrame*)this->GetParent())->isHelp()) { - std::vector files; - wxCDMPackageHelpDialog* helpDialog = new wxCDMPackageHelpDialog(this->GetParent(), files, wxID_ANY); + wxCDMPackageHelpDialog* helpDialog = new wxCDMPackageHelpDialog(this->GetParent(), this->package, wxID_ANY); helpDialog->Show(true); } } diff --git a/lib/creaDevManagerLib/wxCDMPackageHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMPackageHelpDialog.cpp index 5263810..0a30fa5 100644 --- a/lib/creaDevManagerLib/wxCDMPackageHelpDialog.cpp +++ b/lib/creaDevManagerLib/wxCDMPackageHelpDialog.cpp @@ -44,7 +44,7 @@ END_EVENT_TABLE() wxCDMPackageHelpDialog::wxCDMPackageHelpDialog( wxWindow* parent, - std::vector& files, + modelCDMPackage* package, wxWindowID id, const wxString& caption, const wxPoint& position, @@ -53,7 +53,7 @@ wxCDMPackageHelpDialog::wxCDMPackageHelpDialog( ) { wxCDMPackageHelpDialog::Create(parent, id, caption, position, size, style); - this->cmakefiles = files; + this->package = package; } wxCDMPackageHelpDialog::~wxCDMPackageHelpDialog() diff --git a/lib/creaDevManagerLib/wxCDMPackageHelpDialog.h b/lib/creaDevManagerLib/wxCDMPackageHelpDialog.h index 2bdcc19..1db7ffa 100644 --- a/lib/creaDevManagerLib/wxCDMPackageHelpDialog.h +++ b/lib/creaDevManagerLib/wxCDMPackageHelpDialog.h @@ -39,7 +39,7 @@ #include #include -#include "modelCDMCMakeListsFile.h" +#include "modelCDMPackage.h" #include @@ -49,7 +49,7 @@ class wxCDMPackageHelpDialog : public wxDialog public: wxCDMPackageHelpDialog( wxWindow* parent, - std::vector & files, + modelCDMPackage* package, wxWindowID id = wxID_ANY, const wxString& caption = wxT("Working With Packages"), const wxPoint& position = wxDefaultPosition, @@ -70,7 +70,7 @@ protected: void CreateControls(); private: - std::vector cmakefiles; + modelCDMPackage* package; //handlers protected: diff --git a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp index 4d7679b..d809700 100644 --- a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp @@ -213,7 +213,7 @@ void wxCDMProjectDescriptionPanel::CreateControls() if(((wxCDMMainFrame*)this->GetParent())->isHelp()) { - wxCDMProjectHelpDialog* helpDialog = new wxCDMProjectHelpDialog(this->GetParent(), this, wxID_ANY); + wxCDMProjectHelpDialog* helpDialog = new wxCDMProjectHelpDialog(this->GetParent(), this->project, wxID_ANY); helpDialog->Show(true); } } diff --git a/lib/creaDevManagerLib/wxCDMProjectHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMProjectHelpDialog.cpp index 7ced2c2..baf51a9 100644 --- a/lib/creaDevManagerLib/wxCDMProjectHelpDialog.cpp +++ b/lib/creaDevManagerLib/wxCDMProjectHelpDialog.cpp @@ -41,15 +41,12 @@ BEGIN_EVENT_TABLE(wxCDMProjectHelpDialog, wxDialog) EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMProjectHelpDialog::OnFinish) -EVT_BUTTON(ID_BUTTON_GOTO_PACKAGE_MANAGER, wxCDMProjectHelpDialog::OnManagePackages) -EVT_BUTTON(ID_BUTTON_GOTO_LIB_MANAGER, wxCDMProjectHelpDialog::OnManageLibraries) -EVT_BUTTON(ID_BUTTON_GOTO_APPLI_MANAGER, wxCDMProjectHelpDialog::OnManageApplications) EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMProjectHelpDialog::OnDisableHelp) END_EVENT_TABLE() wxCDMProjectHelpDialog::wxCDMProjectHelpDialog( wxWindow* parent, - wxCDMProjectDescriptionPanel* projectDescription, + modelCDMProject* project, wxWindowID id, const wxString& caption, const wxPoint& position, @@ -58,7 +55,7 @@ wxCDMProjectHelpDialog::wxCDMProjectHelpDialog( ) { wxCDMProjectHelpDialog::Create(parent, id, caption, position, size, style); - this->projectDescription = projectDescription; + this->project = project; } wxCDMProjectHelpDialog::~wxCDMProjectHelpDialog() @@ -100,7 +97,9 @@ void wxCDMProjectHelpDialog::CreateControls() "- Applications: Stand alone programs that use the functions available on your libraries.\n" "- Configuration file: Contains the information of what should or shouldn't be compiled from this project.\n" "\n" - "To the right of the project you will find a tree with the project structure and it's actual content.\n" + "To the right of the description panel you will find a tree with the project structure and it's actual content.\n" + "Bellow the description panel you will find a panel with the project's main actions when you're ready to compile " + "the project. you can hover on this buttons to see more information about what they do.\n" "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 " "packages you can do it by clicking the \"Package Manager\" button bellow. You can also work with Libraries and " "Applications. Just click in the \"Library Manager\" button or \"Application manager\" button to start working " @@ -124,118 +123,6 @@ void wxCDMProjectHelpDialog::OnFinish(wxCommandEvent& event) this->EndDialog(wxID_CANCEL); } -void wxCDMProjectHelpDialog::OnManagePackages(wxCommandEvent& event) -{ - wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetId(1); - newEvent->SetString(wxT("manage_packages")); - newEvent->SetInt(this->projectDescription->GetProject()->GetId()); - wxPostEvent(this->GetParent(), *newEvent); - event.Skip(); - - this->EndDialog(wxID_OK); -} - -void wxCDMProjectHelpDialog::OnManageLibraries(wxCommandEvent& event) -{ - wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetId(1); - newEvent->SetString(wxT("manage_libraries")); - wxPostEvent(this->GetParent(), *newEvent); - - wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED); - - if(this->projectDescription->GetProject()->GetLib() != NULL) - { - int CMId = this->projectDescription->GetProject()->GetLib()->GetId(); - newEvent1->SetInt(CMId); - newEvent1->SetId(0); - wxPostEvent(this->GetParent(), *newEvent1); - } - - event.Skip(); - - this->EndDialog(wxID_OK); -} - -void wxCDMProjectHelpDialog::OnManageApplications(wxCommandEvent& event) -{ - wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetId(1); - newEvent->SetString(wxT("manage_applications")); - wxPostEvent(this->GetParent(), *newEvent); - - wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED); - - if(this->projectDescription->GetProject()->GetAppli() != NULL) - { - int CMId = this->projectDescription->GetProject()->GetAppli()->GetId(); - newEvent1->SetInt(CMId); - newEvent1->SetId(0); - wxPostEvent(this->GetParent(), *newEvent1); - } - - event.Skip(); - - this->EndDialog(wxID_OK); -} - -void wxCDMProjectHelpDialog::OnAppliMouseEnter(wxMouseEvent& event) -{ - wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED); - - if(this->projectDescription->GetProject()->GetAppli() != NULL) - { - int AppId = this->projectDescription->GetProject()->GetAppli()->GetId(); - newEvent->SetInt(AppId); - newEvent->SetId(0); - wxPostEvent(this->GetParent(), *newEvent); - } - event.Skip(); -} - -void wxCDMProjectHelpDialog::OnAppliMouseExit(wxMouseEvent& event) -{ - wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED); - - if(this->projectDescription->GetProject()->GetAppli() != NULL) - { - int AppId = this->projectDescription->GetProject()->GetAppli()->GetId(); - newEvent->SetInt(AppId); - newEvent->SetId(0); - wxPostEvent(this->GetParent(), *newEvent); - } - event.Skip(); -} - -void wxCDMProjectHelpDialog::OnLibMouseEnter(wxMouseEvent& event) -{ - wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED); - - if(this->projectDescription->GetProject()->GetLib() != NULL) - { - int LbId = this->projectDescription->GetProject()->GetLib()->GetId(); - newEvent->SetInt(LbId); - newEvent->SetId(0); - wxPostEvent(this->GetParent(), *newEvent); - } - event.Skip(); -} - -void wxCDMProjectHelpDialog::OnLibMouseExit(wxMouseEvent& event) -{ - wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED); - - if(this->projectDescription->GetProject()->GetLib() != NULL) - { - int LbId = this->projectDescription->GetProject()->GetLib()->GetId(); - newEvent->SetInt(LbId); - newEvent->SetId(0); - wxPostEvent(this->GetParent(), *newEvent); - } - event.Skip(); -} - void wxCDMProjectHelpDialog::OnDisableHelp(wxCommandEvent& event) { wxPostEvent(this->GetParent(), event); diff --git a/lib/creaDevManagerLib/wxCDMProjectHelpDialog.h b/lib/creaDevManagerLib/wxCDMProjectHelpDialog.h index b138cf9..789d812 100644 --- a/lib/creaDevManagerLib/wxCDMProjectHelpDialog.h +++ b/lib/creaDevManagerLib/wxCDMProjectHelpDialog.h @@ -47,7 +47,7 @@ class wxCDMProjectHelpDialog : public wxDialog public: wxCDMProjectHelpDialog( wxWindow* parent, - wxCDMProjectDescriptionPanel* projectDescription, + modelCDMProject* project, wxWindowID id = wxID_ANY, const wxString& caption = wxT("Project Ready"), const wxPoint& position = wxDefaultPosition, @@ -69,21 +69,12 @@ protected: //attributes private: - wxCDMProjectDescriptionPanel* projectDescription; + modelCDMProject* project; //handlers protected: void OnFinish(wxCommandEvent& event); - void OnManagePackages(wxCommandEvent& event); - void OnManageLibraries(wxCommandEvent& event); - void OnManageApplications(wxCommandEvent& event); - - void OnAppliMouseEnter(wxMouseEvent& event); - void OnAppliMouseExit(wxMouseEvent& event); - void OnLibMouseEnter(wxMouseEvent& event); - void OnLibMouseExit(wxMouseEvent& event); - void OnDisableHelp(wxCommandEvent& event); }; -- 2.45.1