]> Creatis software - crea.git/commitdiff
Feature #1711
authorDaniel Gonzalez <daniel.gonzalez@creatis.insa-lyon.fr>
Mon, 7 Jan 2013 16:44:57 +0000 (17:44 +0100)
committerDaniel Gonzalez <daniel.gonzalez@creatis.insa-lyon.fr>
Mon, 7 Jan 2013 16:44:57 +0000 (17:44 +0100)
CreaDevManager application implementation

-Project help starts from the project description
-Main description help implemented
-Package Manager help implemented

15 files changed:
lib/creaDevManagerLib/creaDevManagerIds.h
lib/creaDevManagerLib/modelCDMPackageSrc.cpp
lib/creaDevManagerLib/wxCDMMainDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMMainFrame.cpp
lib/creaDevManagerLib/wxCDMMainFrame.h
lib/creaDevManagerLib/wxCDMMainHelpDialog.cpp [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMMainHelpDialog.h [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMPackageManagerHelpDialog.cpp [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMPackageManagerHelpDialog.h [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp
lib/creaDevManagerLib/wxCDMPackageManagerPanel.h
lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.h
lib/creaDevManagerLib/wxCDMProjectHelpDialog.cpp
lib/creaDevManagerLib/wxCDMProjectHelpDialog.h

index 509822f28a2d398ca4141d3d642944b11c385439..f595934b75575095d74be82bad7a816b5cc904f1 100644 (file)
 
 #define ID_CHECKBOX_ENABLE_HELP         10334
 #define ID_CHECKBOX_DISABLE_HELP        10335
-#define ID_CHECKBOX_TOGGLE_HELP        10335
+#define ID_CHECKBOX_TOGGLE_HELP         10335
 
 #endif /* CREADEVMANAGERIDS_H_ */
index 06d0c09d2da2c07a48323c63e314cbd1d1490cfb..6aa9c5355b663cc738f4221fad49449750f7c549 100644 (file)
@@ -144,7 +144,7 @@ modelCDMBlackBox* modelCDMPackageSrc::CreateBlackBox(
 {
   //parse name
   std::vector<std::string> words;
-  CDMUtilities::splitter::split(words, name, " \n\",/\\", CDMUtilities::splitter::no_empties);
+  CDMUtilities::splitter::split(words, name, " \n\",/\\'", CDMUtilities::splitter::no_empties);
   std::string bbName;
   for (int i = 0; i < words.size(); i++)
     {
@@ -152,7 +152,7 @@ modelCDMBlackBox* modelCDMPackageSrc::CreateBlackBox(
     }
 
   //parse categories
-  CDMUtilities::splitter::split(words, categories, " \n\",/\\", CDMUtilities::splitter::no_empties);
+  CDMUtilities::splitter::split(words, categories, " \n\",/\\'", CDMUtilities::splitter::no_empties);
   std::string bbCategories;
   if(words.size() > 0)
     {
@@ -166,7 +166,7 @@ modelCDMBlackBox* modelCDMPackageSrc::CreateBlackBox(
     bbCategories = "empty";
 
   //parse authors
-  CDMUtilities::splitter::split(words, authors, "\n\",/\\", CDMUtilities::splitter::no_empties);
+  CDMUtilities::splitter::split(words, authors, "\n\",/\\'", CDMUtilities::splitter::no_empties);
   std::string bbAuthors;
   if(words.size() > 0)
     {
@@ -180,7 +180,7 @@ modelCDMBlackBox* modelCDMPackageSrc::CreateBlackBox(
     bbAuthors = "Unknown";
 
   //parse description
-  CDMUtilities::splitter::split(words, authorsEmail, " \n\"/\\", CDMUtilities::splitter::no_empties);
+  CDMUtilities::splitter::split(words, authorsEmail, " \n\"/\\'", CDMUtilities::splitter::no_empties);
   std::string bbDescription;
   if(words.size() > 0)
     {
@@ -191,7 +191,7 @@ modelCDMBlackBox* modelCDMPackageSrc::CreateBlackBox(
         }
       bbDescription += " - ";
     }
-  CDMUtilities::splitter::split(words, description, "\n\"/\\", CDMUtilities::splitter::no_empties);
+  CDMUtilities::splitter::split(words, description, "\n\"/\\'", CDMUtilities::splitter::no_empties);
   if(words.size() > 0)
     {
       bbDescription += words[0];
index bb2c3eb0f69ee6f41b9d98e9b4448633530b1643..73cda490ae1063dbb66236258645ca1d7a7447dc 100644 (file)
 
 #include "wxCDMMainDescriptionPanel.h"
 
+#include "wxCDMMainFrame.h"
+
+#include "wxCDMMainHelpDialog.h"
+
 #include "creaDevManagerIds.h"
 #include "images/CIcon64.xpm"
 
 BEGIN_EVENT_TABLE(wxCDMMainDescriptionPanel, wxPanel)
 EVT_MENU(ID_MENU_NEW_PROJECT, wxCDMMainDescriptionPanel::OnBtnNewProject)
 EVT_MENU(ID_MENU_OPEN_PROJECT, wxCDMMainDescriptionPanel::OnBtnOpenProject)
+
 END_EVENT_TABLE()
 
 wxCDMMainDescriptionPanel::wxCDMMainDescriptionPanel(
@@ -107,6 +112,13 @@ void wxCDMMainDescriptionPanel::CreateControls()
   //Asign sizer
   sizer->SetSizeHints(this);
   SetSizer(sizer);
+
+  if(((wxCDMMainFrame*)this->GetParent())->isHelp())
+    {
+      wxDialog* helpDialog = new wxCDMMainHelpDialog(this->GetParent(), this, wxID_ANY);
+      helpDialog->Show(true);
+    }
+
 }
 
 void wxCDMMainDescriptionPanel::OnBtnNewProject(wxCommandEvent& event)
index 07ea08094331cedf025105631a6c5643ff2327ff..6f0af4608e0acb5e93b494ab0e1ad4d6d540c9b0 100755 (executable)
@@ -53,7 +53,6 @@
 #include "wxCDMProjectActionsPanel.h"
 #include "wxCDMNewProjectDialog.h"
 
-#include "wxCDMProjectHelpDialog.h"
 
 
 BEGIN_EVENT_TABLE(wxCDMMainFrame, wxFrame)
@@ -81,12 +80,17 @@ EVT_MENU(ID_MENU_HELP, wxCDMMainFrame::OnMenuHelp)
 EVT_MENU(ID_MENU_REPORT_BUG, wxCDMMainFrame::OnMenuReportBug)
 EVT_MENU(ID_MENU_ABOUT_CREADEVMANAGER, wxCDMMainFrame::OnMenuAboutCreaDevManager)
 EVT_MENU(ID_MENU_ABOUT_CREATIS, wxCDMMainFrame::OnMenuAboutCreatis)
+
 EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCDMMainFrame::OnMenuNewProject)
 EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMMainFrame::OnMenuOpenProject)
+
 EVT_TREE_SEL_CHANGED(ID_TREE_PROJECTS, wxCDMMainFrame::OnTreeSelectionChanged)
+
 EVT_COMMAND(wxID_ANY, wxEVT_DISPLAY_CHANGED, wxCDMMainFrame::OnCreationComplete)
 EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_LIST_ITEM_SELECTED, wxCDMMainFrame::OnElementSelected)
 EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxCDMMainFrame::OnElementDeselected)
+
+
 EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMMainFrame::OnDisableHelp)
 END_EVENT_TABLE()
 
@@ -129,6 +133,16 @@ modelCDMMain* wxCDMMainFrame::GetModel() const
   return this->model;
 }
 
+wxPanel* wxCDMMainFrame::GetPropertiesPanel() const
+{
+  return this->panel_Properties;
+}
+
+bool wxCDMMainFrame::isHelp() const
+{
+  return this->help;
+}
+
 void wxCDMMainFrame::RefreshProject()
 {
   std::string* result;
@@ -629,7 +643,6 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
       //project
       modelCDMProject* elementProject = dynamic_cast<modelCDMProject*>(element);
       wxPanel* description;
-      wxDialog* helpDialog = NULL;
       if(elementProject != NULL)
         {
           //create element description
@@ -643,10 +656,6 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
               0
           );
 
-          if(this->help)
-            {
-              helpDialog = new wxCDMProjectHelpDialog(this, wxID_ANY);
-            }
         }
       else
         {
@@ -664,6 +673,7 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
                   wxSize(600, 400),
                   0
               );
+
             }
           else
             {
@@ -841,10 +851,7 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
       //set new view
 
       this->panel_Properties = description;
-      if(this->help && helpDialog != NULL)
-        {
-          helpDialog->Show(true);
-        }
+
       //auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400).CloseButton(false));
       auiManager.Update();
       event.Skip();
index fbca81a688c3524ba19e0d73e127c7dbd0671482..64a316f6b6274e440d9bfb67381c0f477888af52 100755 (executable)
@@ -61,6 +61,8 @@ public:
   );
 
   modelCDMMain* GetModel() const;
+  wxPanel* GetPropertiesPanel() const;
+  bool isHelp() const;
 
   void RefreshProject();
 
diff --git a/lib/creaDevManagerLib/wxCDMMainHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMMainHelpDialog.cpp
new file mode 100644 (file)
index 0000000..6223d54
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+# ---------------------------------------------------------------------
+#
+# 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.
+# ------------------------------------------------------------------------ 
+ */
+
+
+/*
+ * wxCDMMainHelpDialog.cpp
+ *
+ *  Created on: 7/1/2013
+ *      Author: Daniel Felipe Gonzalez Obando
+ */
+
+#include "wxCDMMainHelpDialog.h"
+
+#include "creaDevManagerIds.h"
+
+BEGIN_EVENT_TABLE(wxCDMMainHelpDialog, wxDialog)
+EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMMainHelpDialog::OnFinish)
+EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCDMMainHelpDialog::OnNewProject)
+EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMMainHelpDialog::OnOpenProject)
+EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMMainHelpDialog::OnDisableHelp)
+END_EVENT_TABLE()
+
+wxCDMMainHelpDialog::wxCDMMainHelpDialog(
+    wxWindow* parent,
+    wxCDMMainDescriptionPanel* mainDescription,
+    wxWindowID id,
+    const wxString& caption,
+    const wxPoint& position,
+    const wxSize& size,
+    long style
+)
+{
+  wxCDMMainHelpDialog::Create(parent, id, caption, position, size, style);
+  this->mainDescription = mainDescription;
+}
+
+wxCDMMainHelpDialog::~wxCDMMainHelpDialog()
+{
+}
+
+bool wxCDMMainHelpDialog::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 wxCDMMainHelpDialog::CreateControls()
+{
+  wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
+
+
+  wxStaticText* title = new wxStaticText(this, wxID_ANY, wxT("Welcome to the Crea Development Manager"), 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(
+          "This application was made to help you in the creation process of Crea projects. This help dialogs will explain what "
+          "each part of the program does and will give you tips to get your project up and running in no time. You can disable "
+          "them by checking the \"Disable Help\" option, you can also enable it at any time checking the \"Help Dialogs\" "
+          "option in the Help menu.\n To begin working on your projects you can either create a new project or open an already "
+          "existing project.\n"
+          "\n"
+          "Select an action or click Close to continue working on the project."),
+          wxDefaultPosition,
+          wxDefaultSize,
+          wxALIGN_LEFT
+  );
+  v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
+
+  wxFlexGridSizer* formItems = new wxFlexGridSizer(1,2,9,15);
+
+  wxButton* createPackageBtn = new wxButton(this, ID_BUTTON_NEWPROJECT, wxT("New Project"));
+  wxButton* editCMakeBtn= new wxButton(this, ID_BUTTON_OPENPROJECT, wxT("Open Project"));
+
+  formItems->Add(createPackageBtn, 1, wxALIGN_CENTER);
+  formItems->Add(editCMakeBtn, 1, wxALIGN_CENTER);
+
+  formItems->AddGrowableCol(0,1);
+  formItems->AddGrowableCol(1,1);
+
+  v_sizer1->Add(formItems, 1, wxEXPAND | wxALL, 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 wxCDMMainHelpDialog::OnFinish(wxCommandEvent& event)
+{
+  this->EndDialog(wxID_CANCEL);
+}
+
+void wxCDMMainHelpDialog::OnNewProject(wxCommandEvent& event)
+{
+  wxPostEvent(this->GetParent(), event);
+  event.Skip();
+
+  this->EndDialog(wxID_OK);
+}
+
+void wxCDMMainHelpDialog::OnOpenProject(wxCommandEvent& event)
+{
+  wxPostEvent(this->GetParent(), event);
+    event.Skip();
+
+  this->EndDialog(wxID_OK);
+}
+
+void wxCDMMainHelpDialog::OnDisableHelp(wxCommandEvent& event)
+{
+  wxPostEvent(this->GetParent(), event);
+}
diff --git a/lib/creaDevManagerLib/wxCDMMainHelpDialog.h b/lib/creaDevManagerLib/wxCDMMainHelpDialog.h
new file mode 100644 (file)
index 0000000..7f9e5d2
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+# ---------------------------------------------------------------------
+#
+# 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.
+# ------------------------------------------------------------------------ 
+*/ 
+
+
+/*
+ * wxCDMMainHelpDialog.h
+ *
+ *  Created on: 7/1/2013
+ *      Author: Daniel Felipe Gonzalez Obando
+ */
+
+#ifndef WXCDMMAINHELPDIALOG_H_
+#define WXCDMMAINHELPDIALOG_H_
+
+#include <creaWx.h>
+#include <wx/dialog.h>
+
+#include "wxCDMMainDescriptionPanel.h"
+
+class wxCDMMainHelpDialog : public wxDialog
+{
+  DECLARE_EVENT_TABLE()
+public:
+  wxCDMMainHelpDialog(
+      wxWindow* parent,
+      wxCDMMainDescriptionPanel* packageManager,
+      wxWindowID id = wxID_ANY,
+      const wxString& caption = wxT("Welcome"),
+      const wxPoint& position = wxDefaultPosition,
+      const wxSize& size = wxSize(350,450),
+      long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
+  );
+  ~wxCDMMainHelpDialog();
+  bool Create(
+      wxWindow* parent,
+      wxWindowID id = wxID_ANY,
+      const wxString& caption = wxT("Welcome"),
+      const wxPoint& position = wxDefaultPosition,
+      const wxSize& size = wxSize(350,450),
+      long style = wxDEFAULT_DIALOG_STYLE
+  );
+
+protected:
+  void CreateControls();
+
+//attributes
+private:
+  wxCDMMainDescriptionPanel* mainDescription;
+
+//handlers
+protected:
+  void OnFinish(wxCommandEvent& event);
+
+  void OnNewProject(wxCommandEvent& event);
+  void OnOpenProject(wxCommandEvent& event);
+
+  void OnDisableHelp(wxCommandEvent& event);
+};
+
+#endif /* WXCDMPACKAGEMANAGERHELPDIALOG_H_ */
diff --git a/lib/creaDevManagerLib/wxCDMPackageManagerHelpDialog.cpp b/lib/creaDevManagerLib/wxCDMPackageManagerHelpDialog.cpp
new file mode 100644 (file)
index 0000000..fe72272
--- /dev/null
@@ -0,0 +1,188 @@
+/*
+# ---------------------------------------------------------------------
+#
+# 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.
+# ------------------------------------------------------------------------ 
+ */
+
+
+/*
+ * wxCDMPackageManagerHelpDialog.cpp
+ *
+ *  Created on: 7/1/2013
+ *      Author: Daniel Felipe Gonzalez Obando
+ */
+
+#include "wxCDMPackageManagerHelpDialog.h"
+
+#include "creaDevManagerIds.h"
+
+BEGIN_EVENT_TABLE(wxCDMPackageManagerHelpDialog, wxDialog)
+EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMPackageManagerHelpDialog::OnFinish)
+EVT_BUTTON(ID_BUTTON_CREATE_PACKAGE, wxCDMPackageManagerHelpDialog::OnCreatePackage)
+EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMPackageManagerHelpDialog::OnEditCMake)
+EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMPackageManagerHelpDialog::OnDisableHelp)
+END_EVENT_TABLE()
+
+wxCDMPackageManagerHelpDialog::wxCDMPackageManagerHelpDialog(
+    wxWindow* parent,
+    wxCDMPackageManagerPanel* packageManager,
+    wxWindowID id,
+    const wxString& caption,
+    const wxPoint& position,
+    const wxSize& size,
+    long style
+)
+{
+  wxCDMPackageManagerHelpDialog::Create(parent, id, caption, position, size, style);
+  this->packageManager = packageManager;
+}
+
+wxCDMPackageManagerHelpDialog::~wxCDMPackageManagerHelpDialog()
+{
+}
+
+bool wxCDMPackageManagerHelpDialog::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 wxCDMPackageManagerHelpDialog::CreateControls()
+{
+  wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
+
+
+  wxStaticText* title = new wxStaticText(this, wxID_ANY, wxT("Managing your packages"), 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(
+          "In the package manager you can view a list of the available packages in the current project, as well as create "
+          "new packages. Remember that any package you make must be included in the CMakeLists file. You can do that by "
+          "clicking on the \"Edit CMakeLists File\" button and include the desired packages at the end of the file. You "
+          "should also include the libraries you are using on your black boxes in this file.\n"
+          "\n"
+          "Select an action or click Close to continue working on the project."),
+          wxDefaultPosition,
+          wxDefaultSize,
+          wxALIGN_LEFT
+  );
+  v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
+
+  wxFlexGridSizer* formItems = new wxFlexGridSizer(1,2,9,15);
+
+  wxButton* createPackageBtn = new wxButton(this, ID_BUTTON_CREATE_PACKAGE, wxT("Create a Package"));
+  wxButton* editCMakeBtn= new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, wxT("Edit the CMakeLists File"));
+  editCMakeBtn->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageManagerHelpDialog::OnEditCMakeMouseEnter,NULL,this);
+  editCMakeBtn->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageManagerHelpDialog::OnEditCMakeMouseExit,NULL,this);
+
+  formItems->Add(createPackageBtn, 1, wxALIGN_CENTER);
+  formItems->Add(editCMakeBtn, 1, wxALIGN_CENTER);
+
+  formItems->AddGrowableCol(0,1);
+  formItems->AddGrowableCol(1,1);
+
+  v_sizer1->Add(formItems, 1, wxEXPAND | wxALL, 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 wxCDMPackageManagerHelpDialog::OnFinish(wxCommandEvent& event)
+{
+  this->EndDialog(wxID_CANCEL);
+}
+
+void wxCDMPackageManagerHelpDialog::OnCreatePackage(wxCommandEvent& event)
+{
+  if(this->packageManager != NULL)
+    {
+      wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_TOOL_CLICKED);
+      wxPostEvent(this->packageManager, *newEvent);
+    }
+  event.Skip();
+
+  this->EndDialog(wxID_OK);
+}
+
+void wxCDMPackageManagerHelpDialog::OnEditCMake(wxCommandEvent& event)
+{
+  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_TOOL_ENTER);
+  if(this->packageManager != NULL)
+    wxPostEvent(this->packageManager, *newEvent);
+  event.Skip();
+
+  this->EndDialog(wxID_OK);
+}
+
+
+void wxCDMPackageManagerHelpDialog::OnEditCMakeMouseEnter(wxMouseEvent& event)
+{
+  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+  if(packageManager->GetProject()->GetCMakeLists() != NULL)
+    {
+      int CMId = packageManager->GetProject()->GetCMakeLists()->GetId();
+      newEvent->SetInt(CMId);
+      newEvent->SetId(0);
+      wxPostEvent(this->GetParent(), *newEvent);
+    }
+  event.Skip();
+}
+
+void wxCDMPackageManagerHelpDialog::OnEditCMakeMouseExit(wxMouseEvent& event)
+{
+  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+  if(packageManager->GetProject()->GetCMakeLists() != NULL)
+    {
+      int CMId = packageManager->GetProject()->GetCMakeLists()->GetId();
+      newEvent->SetInt(CMId);
+      newEvent->SetId(0);
+      wxPostEvent(this->GetParent(), *newEvent);
+    }
+  event.Skip();
+}
+
+
+void wxCDMPackageManagerHelpDialog::OnDisableHelp(wxCommandEvent& event)
+{
+  wxPostEvent(this->GetParent(), event);
+}
diff --git a/lib/creaDevManagerLib/wxCDMPackageManagerHelpDialog.h b/lib/creaDevManagerLib/wxCDMPackageManagerHelpDialog.h
new file mode 100644 (file)
index 0000000..e20e377
--- /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.
+# ------------------------------------------------------------------------ 
+*/ 
+
+
+/*
+ * wxCDMPackageManagerHelpDialog.h
+ *
+ *  Created on: 7/1/2013
+ *      Author: Daniel Felipe Gonzalez Obando
+ */
+
+#ifndef WXCDMPACKAGEMANAGERHELPDIALOG_H_
+#define WXCDMPACKAGEMANAGERHELPDIALOG_H_
+
+#include <creaWx.h>
+#include <wx/dialog.h>
+
+#include "wxCDMPackageManagerPanel.h"
+
+class wxCDMPackageManagerHelpDialog : public wxDialog
+{
+  DECLARE_EVENT_TABLE()
+public:
+  wxCDMPackageManagerHelpDialog(
+      wxWindow* parent,
+      wxCDMPackageManagerPanel* packageManager,
+      wxWindowID id = wxID_ANY,
+      const wxString& caption = wxT("Managing Packages"),
+      const wxPoint& position = wxDefaultPosition,
+      const wxSize& size = wxSize(350,450),
+      long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
+  );
+  ~wxCDMPackageManagerHelpDialog();
+  bool Create(
+      wxWindow* parent,
+      wxWindowID id = wxID_ANY,
+      const wxString& caption = wxT("Managing Packages"),
+      const wxPoint& position = wxDefaultPosition,
+      const wxSize& size = wxSize(350,450),
+      long style = wxDEFAULT_DIALOG_STYLE
+  );
+
+protected:
+  void CreateControls();
+
+//attributes
+private:
+  wxCDMPackageManagerPanel* packageManager;
+
+//handlers
+protected:
+  void OnFinish(wxCommandEvent& event);
+
+  void OnCreatePackage(wxCommandEvent& event);
+  void OnEditCMake(wxCommandEvent& event);
+
+  void OnEditCMakeMouseEnter(wxMouseEvent& event);
+  void OnEditCMakeMouseExit(wxMouseEvent& event);
+
+  void OnDisableHelp(wxCommandEvent& event);
+};
+
+#endif /* WXCDMPACKAGEMANAGERHELPDIALOG_H_ */
index 683d4ec4d09f7951897b662895e682a42c9fc63d..d11472750999a7ff63e607d8444a2f6438c67fed 100644 (file)
@@ -37,6 +37,8 @@
 #include "wxCDMMainFrame.h"
 #include "wxCDMNewPackageDialog.h"
 
+#include "wxCDMPackageManagerHelpDialog.h"
+
 #include "creaDevManagerIds.h"
 #include "images/PkIcon64.xpm"
 
@@ -44,7 +46,9 @@ BEGIN_EVENT_TABLE(wxCDMPackageManagerPanel, wxPanel)
 EVT_BUTTON(ID_BUTTON_PREV, wxCDMPackageManagerPanel::OnBtnReturn)
 EVT_HYPERLINK(ID_LINK_SELECT_PACKAGE, wxCDMPackageManagerPanel::OnLnkPackageSelect)
 EVT_BUTTON(ID_BUTTON_CREATE_PACKAGE, wxCDMPackageManagerPanel::OnBtnCreatePackage)
+EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_TOOL_CLICKED, wxCDMPackageManagerPanel::OnBtnCreatePackage)
 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMPackageManagerPanel::OnBtnEditCMakeLists)
+EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_TOOL_ENTER, wxCDMPackageManagerPanel::OnBtnEditCMakeLists)
 END_EVENT_TABLE()
 
 wxCDMPackageManagerPanel::wxCDMPackageManagerPanel(
@@ -140,6 +144,17 @@ void wxCDMPackageManagerPanel::CreateControls()
   //Assign sizer
   SetSizer(sizer);
   sizer->SetSizeHints(this);
+
+  if (((wxCDMMainFrame*)this->GetParent())->isHelp())
+    {
+      wxCDMPackageManagerHelpDialog* helpDialog = new wxCDMPackageManagerHelpDialog(this->GetParent(), this, wxID_ANY);
+      helpDialog->Show(true);
+    }
+}
+
+modelCDMProject* wxCDMPackageManagerPanel::GetProject() const
+{
+  return this->project;
 }
 
 void wxCDMPackageManagerPanel::OnBtnReturn(wxCommandEvent& event)
index 3ce319f1b39b0405bf178f5c03871230167d0fb4..7c59cea4bd1f2cc0727d472a450f9fb8f64d4734 100644 (file)
@@ -42,6 +42,7 @@
 
 #include "modelCDMProject.h"
 
+
 class wxCDMPackageManagerPanel : public wxPanel
 {
   DECLARE_EVENT_TABLE()
@@ -71,6 +72,8 @@ public:
 
   void CreateControls();
 
+  modelCDMProject* GetProject() const;
+
 private:
   modelCDMProject* project;
 
index 1bc58e291b3f1abcec70838f946873a9ee655d88..4d7679b7afea14787dee5d13a85f60d648f3747f 100644 (file)
@@ -37,6 +37,8 @@
 #include "wxCDMMainFrame.h"
 #include "wxCDMNewPackageDialog.h"
 
+#include "wxCDMProjectHelpDialog.h"
+
 #include "creaDevManagerIds.h"
 #include "images/PrIcon64.xpm"
 #include "CDMUtilities.h"
@@ -208,6 +210,17 @@ void wxCDMProjectDescriptionPanel::CreateControls()
   //Assign sizer
   this->SetSizer(sizer);
   sizer->SetSizeHints(this);
+
+  if(((wxCDMMainFrame*)this->GetParent())->isHelp())
+    {
+      wxCDMProjectHelpDialog* helpDialog = new wxCDMProjectHelpDialog(this->GetParent(), this, wxID_ANY);
+      helpDialog->Show(true);
+    }
+}
+
+modelCDMProject* wxCDMProjectDescriptionPanel::GetProject() const
+{
+  return this->project;
 }
 
 void wxCDMProjectDescriptionPanel::OnBtnManagePackages(wxCommandEvent& event)
index 06c12bd3c3bc0555090236d3f3e64f8390aa223c..0341921b7812340a19711396523f3b1e1d14cb88 100644 (file)
@@ -69,6 +69,8 @@ public:
 
   void CreateControls();
 
+  modelCDMProject* GetProject() const;
+
 private:
   modelCDMProject* project;
   wxStaticText* versiontc;
index e676a5503f46bfe287982c556778aac618ee2cc3..97b925add2e9015077a50991f5fa89374a14afaf 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "wxCDMProjectHelpDialog.h"
 
-#include "wxCDMMainFrame.h"
+#include "wxCDMProjectDescriptionPanel.h"
 
 #include "creaDevManagerIds.h"
 
@@ -49,6 +49,7 @@ END_EVENT_TABLE()
 
 wxCDMProjectHelpDialog::wxCDMProjectHelpDialog(
     wxWindow* parent,
+    wxCDMProjectDescriptionPanel* projectDescription,
     wxWindowID id,
     const wxString& caption,
     const wxPoint& position,
@@ -57,6 +58,7 @@ wxCDMProjectHelpDialog::wxCDMProjectHelpDialog(
 )
 {
   wxCDMProjectHelpDialog::Create(parent, id, caption, position, size, style);
+  this->projectDescription = projectDescription;
 }
 
 wxCDMProjectHelpDialog::~wxCDMProjectHelpDialog()
@@ -95,7 +97,7 @@ void wxCDMProjectHelpDialog::CreateControls()
           "Applications, just click in the \"Manage Libraries\" button or \"Manage Applications\" button to start working "
           "with them.\n"
           "\n"
-          "Select an action or click Finish to continue working on the project."),
+          "Select an action or click Close to continue working on the project."),
           wxDefaultPosition,
           wxDefaultSize,
           wxALIGN_LEFT
@@ -123,7 +125,7 @@ void wxCDMProjectHelpDialog::CreateControls()
 
   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("Cancel")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30);
+  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();
@@ -139,7 +141,7 @@ void wxCDMProjectHelpDialog::OnManagePackages(wxCommandEvent& event)
   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
   newEvent->SetId(1);
   newEvent->SetString(wxT("manage_packages"));
-  newEvent->SetInt(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetId());
+  newEvent->SetInt(this->projectDescription->GetProject()->GetId());
   wxPostEvent(this->GetParent(), *newEvent);
   event.Skip();
 
@@ -155,9 +157,9 @@ void wxCDMProjectHelpDialog::OnManageLibraries(wxCommandEvent& event)
 
   wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
 
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib() != NULL)
+  if(this->projectDescription->GetProject()->GetLib() != NULL)
     {
-      int CMId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib()->GetId();
+      int CMId = this->projectDescription->GetProject()->GetLib()->GetId();
       newEvent1->SetInt(CMId);
       newEvent1->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent1);
@@ -177,9 +179,9 @@ void wxCDMProjectHelpDialog::OnManageApplications(wxCommandEvent& event)
 
   wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
 
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli() != NULL)
+  if(this->projectDescription->GetProject()->GetAppli() != NULL)
     {
-      int CMId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli()->GetId();
+      int CMId = this->projectDescription->GetProject()->GetAppli()->GetId();
       newEvent1->SetInt(CMId);
       newEvent1->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent1);
@@ -194,9 +196,9 @@ void wxCDMProjectHelpDialog::OnAppliMouseEnter(wxMouseEvent& event)
 {
   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
 
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli() != NULL)
+  if(this->projectDescription->GetProject()->GetAppli() != NULL)
     {
-      int AppId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli()->GetId();
+      int AppId = this->projectDescription->GetProject()->GetAppli()->GetId();
       newEvent->SetInt(AppId);
       newEvent->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent);
@@ -208,9 +210,9 @@ void wxCDMProjectHelpDialog::OnAppliMouseExit(wxMouseEvent& event)
 {
   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
 
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli() != NULL)
+  if(this->projectDescription->GetProject()->GetAppli() != NULL)
     {
-      int AppId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetAppli()->GetId();
+      int AppId = this->projectDescription->GetProject()->GetAppli()->GetId();
       newEvent->SetInt(AppId);
       newEvent->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent);
@@ -222,9 +224,9 @@ void wxCDMProjectHelpDialog::OnLibMouseEnter(wxMouseEvent& event)
 {
   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
 
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib() != NULL)
+  if(this->projectDescription->GetProject()->GetLib() != NULL)
     {
-      int LbId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib()->GetId();
+      int LbId = this->projectDescription->GetProject()->GetLib()->GetId();
       newEvent->SetInt(LbId);
       newEvent->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent);
@@ -236,9 +238,9 @@ void wxCDMProjectHelpDialog::OnLibMouseExit(wxMouseEvent& event)
 {
   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
 
-  if(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib() != NULL)
+  if(this->projectDescription->GetProject()->GetLib() != NULL)
     {
-      int LbId = ((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetLib()->GetId();
+      int LbId = this->projectDescription->GetProject()->GetLib()->GetId();
       newEvent->SetInt(LbId);
       newEvent->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent);
index 13fbee3cf3bcd7fb3818378fdf6bd7f77a4599a4..0bd33ece8641c5b3b4e226a95ce7472c8508c837 100644 (file)
 #include <creaWx.h>
 #include <wx/dialog.h>
 
+#include "wxCDMProjectDescriptionPanel.h"
+
 class wxCDMProjectHelpDialog : public wxDialog
 {
   DECLARE_EVENT_TABLE()
 public:
   wxCDMProjectHelpDialog(
       wxWindow* parent,
+      wxCDMProjectDescriptionPanel* projectDescription,
       wxWindowID id = wxID_ANY,
       const wxString& caption = wxT("Project Ready"),
       const wxPoint& position = wxDefaultPosition,
@@ -64,6 +67,10 @@ public:
 protected:
   void CreateControls();
 
+//attributes
+private:
+  wxCDMProjectDescriptionPanel* projectDescription;
+
 //handlers
 protected:
   void OnFinish(wxCommandEvent& event);