From: Daniel Gonzalez Date: Thu, 25 Apr 2013 14:06:40 +0000 (+0200) Subject: Feature #1711 CreaDevManager application implementation X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=crea.git;a=commitdiff_plain;h=f5cd0d2ab363ef8d6fd89d547ace70ca31d2bf3e Feature #1711 CreaDevManager application implementation Feature: Now the project route map is shown in Help->Show Project Map --- diff --git a/CMakeLists.txt b/CMakeLists.txt index c317c3b..53f87ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 index 0000000..7e2163f --- /dev/null +++ b/data/CMakeLists.txt @@ -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 index 0000000..d734469 Binary files /dev/null and b/data/projectMap.png differ diff --git a/install/CMakeLists.txt b/install/CMakeLists.txt index 7b4e92f..599e73d 100644 --- a/install/CMakeLists.txt +++ b/install/CMakeLists.txt @@ -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 #----------------------------------------------------------------------------- diff --git a/lib/creaDevManagerLib/CMakeLists.txt b/lib/creaDevManagerLib/CMakeLists.txt index bb1dbea..d0daed4 100644 --- a/lib/creaDevManagerLib/CMakeLists.txt +++ b/lib/creaDevManagerLib/CMakeLists.txt @@ -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/ + ../../src + ) #---------------------------------------------------------------------------- # MACRO WHICH DOES ALL THE JOB : BUILD AND INSTALL diff --git a/lib/creaDevManagerLib/creaDevManagerIds.h b/lib/creaDevManagerLib/creaDevManagerIds.h index 2ac3960..22a2808 100644 --- a/lib/creaDevManagerLib/creaDevManagerIds.h +++ b/lib/creaDevManagerLib/creaDevManagerIds.h @@ -65,10 +65,11 @@ #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 diff --git a/lib/creaDevManagerLib/wxCDMMainFrame.cpp b/lib/creaDevManagerLib/wxCDMMainFrame.cpp index 76d18f4..6b8536a 100755 --- a/lib/creaDevManagerLib/wxCDMMainFrame.cpp +++ b/lib/creaDevManagerLib/wxCDMMainFrame.cpp @@ -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) { diff --git a/lib/creaDevManagerLib/wxCDMMainFrame.h b/lib/creaDevManagerLib/wxCDMMainFrame.h index 3cacf8a..6cbaf9f 100755 --- a/lib/creaDevManagerLib/wxCDMMainFrame.h +++ b/lib/creaDevManagerLib/wxCDMMainFrame.h @@ -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 index 0000000..626cae1 --- /dev/null +++ b/lib/creaDevManagerLib/wxCDMProjectMapDialog.cpp @@ -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 index 0000000..b082105 --- /dev/null +++ b/lib/creaDevManagerLib/wxCDMProjectMapDialog.h @@ -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 +#include + + +/** + * 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_ */