]> Creatis software - crea.git/commitdiff
Feature #1711 CreaDevManager application implementation
authorDaniel Gonzalez <daniel.gonzalez@creatis.insa-lyon.fr>
Thu, 25 Apr 2013 14:06:40 +0000 (16:06 +0200)
committerDaniel Gonzalez <daniel.gonzalez@creatis.insa-lyon.fr>
Thu, 25 Apr 2013 14:06:40 +0000 (16:06 +0200)
Feature: Now the project route map is shown in Help->Show Project Map

CMakeLists.txt
data/CMakeLists.txt [new file with mode: 0644]
data/projectMap.png [new file with mode: 0644]
install/CMakeLists.txt
lib/creaDevManagerLib/CMakeLists.txt
lib/creaDevManagerLib/creaDevManagerIds.h
lib/creaDevManagerLib/wxCDMMainFrame.cpp
lib/creaDevManagerLib/wxCDMMainFrame.h
lib/creaDevManagerLib/wxCDMProjectMapDialog.cpp [new file with mode: 0644]
lib/creaDevManagerLib/wxCDMProjectMapDialog.h [new file with mode: 0644]

index c317c3b5623e048336e60cf8b99448f18a18e7c3..53f87ec4b22dd0921c48c5e66b75ae6889e51783 100644 (file)
@@ -102,6 +102,7 @@ INCLUDE_DIRECTORIES(/usr/lib/x86_64-linux-gnu/glib-2.0/include/)
 
 ADD_SUBDIRECTORY(cmake)
 ADD_SUBDIRECTORY(src)
+ADD_SUBDIRECTORY(data)
 ADD_SUBDIRECTORY(appli)
 ADD_SUBDIRECTORY(lib)
 #-----------------------------------------------------------------------------
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7e2163f
--- /dev/null
@@ -0,0 +1,42 @@
+# ---------------------------------------------------------------------
+#
+# 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.
+# ------------------------------------------------------------------------ */                                                                         
+
+
+SET(INPUT_DATA_DIR ${PROJECT_SOURCE_DIR}/data)
+
+FILE(GLOB CONFIGURE_DATA_FILES *.*)
+
+IF(WIN32)
+       SET(OUTPUT_DATA_DIR ${PROJECT_BINARY_DIR}/Debug/data)
+       CREA_CPDIR(${INPUT_DATA_DIR} ${OUTPUT_DATA_DIR})
+       SET(OUTPUT_DATA_DIR ${PROJECT_BINARY_DIR}/Release/data)
+       CREA_CPDIR(${INPUT_DATA_DIR} ${OUTPUT_DATA_DIR})
+       SET(OUTPUT_DATA_DIR ${PROJECT_BINARY_DIR}/RelWithDebInfo/data)
+       CREA_CPDIR(${INPUT_DATA_DIR} ${OUTPUT_DATA_DIR})
+ELSE(WIN32)
+       SET(OUTPUT_DATA_DIR ${PROJECT_BINARY_DIR}/data)
+       CREA_CPDIR(${INPUT_DATA_DIR} ${OUTPUT_DATA_DIR})
+ENDIF(WIN32)
+
diff --git a/data/projectMap.png b/data/projectMap.png
new file mode 100644 (file)
index 0000000..d734469
Binary files /dev/null and b/data/projectMap.png differ
index 7b4e92f773c2f029eda7a46c621537b7418d1364..599e73d559e3d014dd42f10eac2109fd14558254 100644 (file)
@@ -73,6 +73,25 @@ SET(${LIBRARY_NAME}_ADDITIONAL_USE_FILE
 CREA_ADVANCED_INSTALL_LIBRARY_FOR_CMAKE(${LIBRARY_NAME})
 #-----------------------------------------------------------------------------
 
+#-----------------------------------------------------------------------------
+# CreaDevManager Data
+#-----------------------------------------------------------------------------
+IF (WIN32)
+  SET(INSTALL_DATA_DIR "bin/data")
+ELSE (WIN32)
+  SET(INSTALL_DATA_DIR "share/creaDevManager/data")
+ENDIF (WIN32)
+
+#-- data --
+SET(DATA_DIR ${PROJECT_SOURCE_DIR}/data )
+FILE(GLOB DATA_FILES "${DATA_DIR}/*.*")
+FOREACH( iLST  ${DATA_FILES} )
+   INSTALL( 
+        FILES ${iLST}
+        DESTINATION ${INSTALL_DATA_DIR}
+   )
+ENDFOREACH(iLST)
+
 #-----------------------------------------------------------------------------
 # CPACK+NSIS PACKAGING
 #-----------------------------------------------------------------------------
index bb1dbea12bb24554962021003dfe1ae332032d56..d0daed4b8e06233943d9070d030192772c9243c8 100644 (file)
@@ -87,10 +87,16 @@ IF ( BUILD_${LIBRARY_NAME} )
 
   # If this library must link against other libraries 
   # USER! : Add here any extra Library you need
-
+  crea
   )
   #----------------------------------------------------------------------------
+  INCLUDE_DIRECTORIES (
 
+  # USER! : Add here the directories holding th extra .h files you need
+  # e.g.
+  # ../../lib/<my_library_I_just_created>
+  ../../src
+  )
   #----------------------------------------------------------------------------
   # MACRO WHICH DOES ALL THE JOB : BUILD AND INSTALL
 
index 2ac39608f999fa89354957495b88a6e2884dde23..22a2808b44803215c494e4911e47a75894dedf57 100644 (file)
 #define ID_MENU_REPORT_BUG              10222
 #define ID_MENU_ABOUT_CREADEVMANAGER    10223
 #define ID_MENU_ABOUT_CREATIS           10224
+#define ID_MENU_SHOW_PROJECT_MAP        10225
 
-#define ID_TREE_PROJECTS                10225
-#define ID_WINDOW_PROPERTIES            10226
-#define ID_WINDOW_PROJ_ACTIONS          10227
+#define ID_TREE_PROJECTS                10226
+#define ID_WINDOW_PROPERTIES            10227
+#define ID_WINDOW_PROJ_ACTIONS          10228
 
 #define ID_BUTTON_NEXT                  10300
 #define ID_BUTTON_PREV                  10301
index 76d18f4f4927a0bf435f87d643413768483e102a..6b8536a194ad31f50ae33ba5c4e592886a430173 100755 (executable)
@@ -55,6 +55,7 @@
 #include "wxCDMFolderDescriptionPanel.h"
 #include "wxCDMFileDescriptionPanel.h"
 #include "wxCDMPackageManagerPanel.h"
+#include "wxCDMProjectMapDialog.h"
 
 #include "wxCDMSettingsDialog.h"
 
@@ -83,6 +84,7 @@ EVT_MENU(ID_MENU_CODE_EDITOR, wxCDMMainFrame::OnMenuCodeEditor)
 EVT_MENU(ID_MENU_COMMAND_LINE, wxCDMMainFrame::OnMenuCommandLine)
 EVT_MENU(ID_MENU_TOGGLE_HELP, wxCDMMainFrame::OnMenuToggleHelp)
 EVT_MENU(ID_MENU_HELP, wxCDMMainFrame::OnMenuHelp)
+EVT_MENU(ID_MENU_SHOW_PROJECT_MAP, wxCDMMainFrame::OnMenuShowProjectMap)
 EVT_MENU(ID_MENU_REPORT_BUG, wxCDMMainFrame::OnMenuReportBug)
 EVT_MENU(ID_MENU_ABOUT_CREADEVMANAGER, wxCDMMainFrame::OnMenuAboutCreaDevManager)
 EVT_MENU(ID_MENU_ABOUT_CREATIS, wxCDMMainFrame::OnMenuAboutCreatis)
@@ -232,10 +234,10 @@ void wxCDMMainFrame::CreateMenus()
 
   //ToolsMenu
   menu_Tools = new wxMenu();
-  menu_Tools->Append(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxT("BBTK &Graphical Editor"));
-  menu_Tools->Append(ID_MENU_MINITOOLS, wxT("&MiniTools"));
-  menu_Tools->Append(ID_MENU_CODE_EDITOR, wxT("&Code Editor"));
-  menu_Tools->Append(ID_MENU_COMMAND_LINE, wxT("&Command Line"));
+  menu_Tools->Append(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxT("Open BBEditor (BBTK &Graphical Editor)"));
+  menu_Tools->Append(ID_MENU_MINITOOLS, wxT("Open &CreaTools"));
+  menu_Tools->Append(ID_MENU_CODE_EDITOR, wxT("Open Code &Editor"));
+  menu_Tools->Append(ID_MENU_COMMAND_LINE, wxT("Open Command &Line"));
 
   menuBar->Append(menu_Tools, wxT("&Tools"));
 
@@ -243,6 +245,7 @@ void wxCDMMainFrame::CreateMenus()
   menu_Help = new wxMenu();
   menu_Help->AppendCheckItem(ID_MENU_TOGGLE_HELP, wxT("He&lp Dialogs"));
   menu_Help->Check(ID_MENU_TOGGLE_HELP, this->help);
+  menu_Help->Append(ID_MENU_SHOW_PROJECT_MAP, wxT("&Show Project Map"));
   menu_Help->Append(ID_MENU_HELP, wxT("&Help"));
   menu_Help->Append(ID_MENU_REPORT_BUG, wxT("Report &Bug"));
   menu_Help->Append(ID_MENU_ABOUT_CREADEVMANAGER, wxT("&About CreaDevManager"));
@@ -751,10 +754,18 @@ void wxCDMMainFrame::OnMenuCommandLine(wxCommandEvent& event)
     }
 }
 
+//Help Menu
+void wxCDMMainFrame::OnMenuShowProjectMap(wxCommandEvent& event)
+{
+  wxCDMProjectMapDialog* dialog = new wxCDMProjectMapDialog(this);
+
+  dialog->Show(true);
+}
+
 //Help Menu
 void wxCDMMainFrame::OnMenuHelp(wxCommandEvent& event)
 {
-  wxLaunchDefaultBrowser(_T("http://www.creatis.insa-lyon.fr/site/en/CreatoolsDocumentation"), 0);
+  wxLaunchDefaultBrowser(_T("http://www.creatis.insa-lyon.fr/~gonzalez/documentationSWDoc.html"), 0);
 }
 void wxCDMMainFrame::OnMenuReportBug(wxCommandEvent& event)
 {
index 3cacf8afbc168ec7f921d2acd81d0e17245e291e..6cbaf9f1751337ed8bf4eb693722bf515bd1c9fd 100755 (executable)
@@ -266,6 +266,11 @@ protected:
    * @param event The event object that triggers the handler.
    */
   void OnMenuToggleHelp(wxCommandEvent& event);
+  /**
+   * Open the road map for crea projects.
+   * @param event The event object that triggers the handler.
+   */
+  void OnMenuShowProjectMap(wxCommandEvent& event);
   /**
    * Open the default web browser and redirects to the CreaTools Documentation page.
    * @param event The event object that triggers the handler.
diff --git a/lib/creaDevManagerLib/wxCDMProjectMapDialog.cpp b/lib/creaDevManagerLib/wxCDMProjectMapDialog.cpp
new file mode 100644 (file)
index 0000000..626cae1
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+# ---------------------------------------------------------------------
+#
+# 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.
+# ------------------------------------------------------------------------ 
+ */
+
+
+/*
+ * wxCDMProjectMapDialog.cpp
+ *
+ *  Created on: 25/4/2013
+ *      Author: Daniel Felipe Gonzalez Obando
+ */
+
+#include "wxCDMProjectMapDialog.h"
+
+#include "creaDevManagerIds.h"
+#include "../../src/creaSystem.h"
+#include "CDMUtilities.h"
+
+BEGIN_EVENT_TABLE(wxCDMProjectMapDialog, wxDialog)
+EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMProjectMapDialog::OnFinish)
+EVT_PAINT(wxCDMProjectMapDialog::PaintEvent)
+END_EVENT_TABLE()
+
+wxCDMProjectMapDialog::wxCDMProjectMapDialog(
+    wxWindow* parent,
+    wxWindowID id,
+    const wxString& caption,
+    const wxPoint& position,
+    const wxSize& size,
+    long style
+)
+{
+  wxCDMProjectMapDialog::Create(parent, id, caption, position, size, style);
+}
+
+wxCDMProjectMapDialog::~wxCDMProjectMapDialog()
+{
+}
+
+bool wxCDMProjectMapDialog::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->SetMaxSize(wxSize(650,-1));
+
+  this->CreateControls();
+
+  return TRUE;
+}
+
+void wxCDMProjectMapDialog::CreateControls()
+{
+
+  wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
+
+
+  wxStaticText* instruction = new wxStaticText(
+      this,
+      wxID_ANY,
+      crea::std2wx(
+          "This is the map of the possible routes for project development in CreaTools.\n"
+          "It's a simple image guide. For more information please read the user manual.\n"
+          " - Each bubble represents a step in the project development.\n"
+          " - The arrows are the possible routes of the development.\n"
+          " - The icons represent the different software used in each step."
+          ),
+          wxDefaultPosition,
+          wxDefaultSize,
+          wxALIGN_LEFT
+  );
+  v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
+
+  wxScrolledWindow* imageWindow = new wxScrolledWindow(this);
+  imageWindow->FitInside();
+  imageWindow->SetScrollRate(5,5);
+  imagePanel = new wxPanel(imageWindow);
+  imagePanel->SetMinSize(wxSize(600,1641));
+  imageWindow->SetSizer(new wxBoxSizer(wxVERTICAL));
+  imageWindow->GetSizer()->Add(imagePanel,1,wxEXPAND);
+
+  wxImage::AddHandler(new wxPNGHandler);
+  image = new wxImage();
+
+  std::string pathToImage = crea::System::GetExecutablePath() + CDMUtilities::SLASH + ".." + CDMUtilities::SLASH + "share" + CDMUtilities::SLASH + "creaDevManager" + CDMUtilities::SLASH +  "data" + CDMUtilities::SLASH + "projectMap.png";
+  image->LoadFile(crea::std2wx(pathToImage), wxBITMAP_TYPE_PNG);
+
+
+  wxPaintDC* canvas = new wxPaintDC(imageWindow);
+
+
+
+  v_sizer1->Add(imageWindow, 1, wxEXPAND);
+
+  v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30);
+
+  SetSizer(v_sizer1);
+}
+
+void
+wxCDMProjectMapDialog::PaintEvent(wxPaintEvent& evt)
+{
+  wxPaintDC* canvas = new wxPaintDC(imagePanel);
+  canvas->DrawBitmap(wxBitmap(image->Scale(600,1641,wxIMAGE_QUALITY_HIGH)),0,0, false);
+}
+
+void wxCDMProjectMapDialog::OnFinish(wxCommandEvent& event)
+{
+  this->EndDialog(wxID_CANCEL);
+}
+
+
diff --git a/lib/creaDevManagerLib/wxCDMProjectMapDialog.h b/lib/creaDevManagerLib/wxCDMProjectMapDialog.h
new file mode 100644 (file)
index 0000000..b082105
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+# ---------------------------------------------------------------------
+#
+# 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.
+# ------------------------------------------------------------------------ 
+*/ 
+
+
+/*
+ * wxCDMProjectMapDialog.h
+ *
+ *  Created on: 25/4/2013
+ *      Author: Daniel Felipe Gonzalez Obando
+ */
+
+#ifndef WXCDMPROJECTMAPDIALOG_H_
+#define WXCDMPROJECTMAPDIALOG_H_
+
+#include <creaWx.h>
+#include <wx/dialog.h>
+
+
+/**
+ * Project Map Dialog
+ */
+class wxCDMProjectMapDialog : public wxDialog
+{
+  DECLARE_EVENT_TABLE()
+public:
+  /**
+   * Project Map Dialog Constructor.
+   * @param parent Parent window.
+   * @param id Dialog ID. By default wxID_ANY.
+   * @param caption Dialog label. By default "Project Routes Map".
+   * @param position Dialog position. By default wxDefaultPosition.
+   * @param size Dialog size. By default 350, 370.
+   * @param style Dialog style. By default wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER.
+   */
+  wxCDMProjectMapDialog(
+      wxWindow* parent,
+      wxWindowID id = wxID_ANY,
+      const wxString& caption = wxT("Project Routes Map"),
+      const wxPoint& position = wxDefaultPosition,
+      const wxSize& size = wxSize(630,500),
+      long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
+  );
+  /**
+   * Destructor.
+   */
+  ~wxCDMProjectMapDialog();
+  /**
+   * Project Map Dialog Creator.
+   * @param parent Parent window.
+   * @param id Dialog ID. By default wxID_ANY.
+   * @param caption Dialog label. By default "Project Routes Map".
+   * @param position Dialog position. By default wxDefaultPosition.
+   * @param size Dialog size. By default 350, 370.
+   * @param style Dialog style. By default wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER.
+   * @return if the creation was successful.
+   */
+  bool Create(
+      wxWindow* parent,
+      wxWindowID id = wxID_ANY,
+      const wxString& caption = wxT("Project Routes Map"),
+      const wxPoint& position = wxDefaultPosition,
+      const wxSize& size = wxSize(630,500),
+      long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
+  );
+
+protected:
+  /**
+   * Creates the help controls (text and buttons).
+   */
+  void CreateControls();
+
+  void PaintEvent(wxPaintEvent& evt);
+
+//attributes
+private:
+
+  wxImage* image;
+  wxPanel* imagePanel;
+
+//handlers
+protected:
+  /**
+   * Handler to close help dialog.
+   * @param event Unused.
+   */
+  void OnFinish(wxCommandEvent& event);
+};
+
+#endif /* WXCDMPROJECTMAPDIALOG_H_ */