]> Creatis software - crea.git/commitdiff
Feature #1711
authorDaniel Gonzalez <daniel.gonzalez@creatis.insa-lyon.fr>
Fri, 11 Jan 2013 11:12:19 +0000 (12:12 +0100)
committerDaniel Gonzalez <daniel.gonzalez@creatis.insa-lyon.fr>
Fri, 11 Jan 2013 11:12:19 +0000 (12:12 +0100)
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.

21 files changed:
lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMAppliHelpDialog.cpp [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMAppliHelpDialog.h [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMApplicationHelpDialog.cpp [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMApplicationHelpDialog.h [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMBlackBoxHelpDialog.cpp [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMBlackBoxHelpDialog.h [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMLibHelpDialog.cpp [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMLibHelpDialog.h [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMLibraryHelpDialog.cpp [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMLibraryHelpDialog.h [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMPackageHelpDialog.cpp
lib/creaDevManagerLib/wxCDMPackageHelpDialog.h
lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMProjectHelpDialog.cpp
lib/creaDevManagerLib/wxCDMProjectHelpDialog.h

index e7bde237655fd912d6c41851b4c880fc5f388612..9fb749ddfe6ac0002777c1ae6d5fec99c7afaa78 100644 (file)
 
 #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 (file)
index 0000000..e3d487e
--- /dev/null
@@ -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 (file)
index 0000000..4f60da9
--- /dev/null
@@ -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 <creaWx.h>
+#include <wx/dialog.h>
+
+#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_ */
index ddb0da95b857ba904d4711c804a1857b028bf67b..2180eb76cea163abefbb23fedf3d17fe0e8746a6 100644 (file)
@@ -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 (file)
index 0000000..d9ff03a
--- /dev/null
@@ -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 (file)
index 0000000..084c181
--- /dev/null
@@ -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 <creaWx.h>
+#include <wx/dialog.h>
+
+#include "modelCDMApplication.h"
+
+#include <vector>
+
+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_ */
index d972925ac645b2de5e84b3eea9b2c9226e46aae7..eb0ed5acf3c391c3cb318739b3cb29c6ba1bb9ea 100644 (file)
@@ -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 (file)
index 0000000..4d4ff43
--- /dev/null
@@ -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 (file)
index 0000000..40fca32
--- /dev/null
@@ -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 <creaWx.h>
+#include <wx/dialog.h>
+
+#include "modelCDMBlackBox.h"
+
+#include <vector>
+
+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_ */
index d31f2b2ba51f399fdd306e3d6e8588085510ecfd..4edb01f38311931e8e05677a93ff38d1cea6a979 100644 (file)
@@ -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 (file)
index 0000000..85e83aa
--- /dev/null
@@ -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 (file)
index 0000000..59a000f
--- /dev/null
@@ -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 <creaWx.h>
+#include <wx/dialog.h>
+
+#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_ */
index 1c14b74cba6c48f405c6f22a89b0e364c1603115..fd207a5ee80289d76af6a4c3d614cf5e9f30a7cb 100644 (file)
@@ -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 (file)
index 0000000..455b559
--- /dev/null
@@ -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 (file)
index 0000000..328ee4d
--- /dev/null
@@ -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 <creaWx.h>
+#include <wx/dialog.h>
+
+#include "modelCDMLibrary.h"
+
+#include <vector>
+
+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_ */
index 74cd7fcf360b6fa755de700314c785b982e1932b..e6f70b2f8b4100731d8b7b7f0e6a6a437ff48fa6 100644 (file)
@@ -217,8 +217,7 @@ void wxCDMPackageDescriptionPanel::CreateControls()
 
   if (((wxCDMMainFrame*)this->GetParent())->isHelp())
     {
-      std::vector<modelCDMCMakeListsFile*> files;
-      wxCDMPackageHelpDialog* helpDialog = new wxCDMPackageHelpDialog(this->GetParent(), files, wxID_ANY);
+      wxCDMPackageHelpDialog* helpDialog = new wxCDMPackageHelpDialog(this->GetParent(), this->package, wxID_ANY);
       helpDialog->Show(true);
     }
 }
index 52638102922c89ca0e1273c1213dca12fcb955c8..0a30fa55f8bccd6eaf3f08564b88f30bae83841a 100644 (file)
@@ -44,7 +44,7 @@ END_EVENT_TABLE()
 
 wxCDMPackageHelpDialog::wxCDMPackageHelpDialog(
     wxWindow* parent,
-    std::vector<modelCDMCMakeListsFile*>& 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()
index 2bdcc1979ff9f56607f738fb05e48498d69a3d40..1db7ffabf8299af2b554e17d3a3b8706b9738dfd 100644 (file)
@@ -39,7 +39,7 @@
 #include <creaWx.h>
 #include <wx/dialog.h>
 
-#include "modelCDMCMakeListsFile.h"
+#include "modelCDMPackage.h"
 
 #include <vector>
 
@@ -49,7 +49,7 @@ class wxCDMPackageHelpDialog : public wxDialog
 public:
   wxCDMPackageHelpDialog(
       wxWindow* parent,
-      std::vector<modelCDMCMakeListsFile*> & 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<modelCDMCMakeListsFile*> cmakefiles;
+  modelCDMPackage* package;
 
 //handlers
 protected:
index 4d7679b7afea14787dee5d13a85f60d648f3747f..d8097005908b3d8786591be2e457f3f25b04f41d 100644 (file)
@@ -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);
     }
 }
index 7ced2c2c62daff1a08565d02ad71ee694c81e74b..baf51a9065c012a58a232435df561d3a6ed463d6 100644 (file)
 
 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);
index b138cf97e89417f0d4ba738abb3e9b9f64427b84..789d81223f42f8ade40b40b9080662a6d1a23c7e 100644 (file)
@@ -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);
 };