2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------
30 * wxCDMProjectMapDialog.cpp
32 * Created on: 25/4/2013
33 * Author: Daniel Felipe Gonzalez Obando
36 #include "wxCDMProjectMapDialog.h"
38 #include "creaDevManagerIds.h"
39 #include "../../src/creaSystem.h"
40 #include "CDMUtilities.h"
42 BEGIN_EVENT_TABLE(wxCDMProjectMapDialog, wxDialog)
43 EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMProjectMapDialog::OnFinish)
44 EVT_PAINT(wxCDMProjectMapDialog::PaintEvent)
47 wxCDMProjectMapDialog::wxCDMProjectMapDialog(
50 const wxString& caption,
51 const wxPoint& position,
56 wxCDMProjectMapDialog::Create(parent, id, caption, position, size, style);
59 wxCDMProjectMapDialog::~wxCDMProjectMapDialog()
63 bool wxCDMProjectMapDialog::Create(
66 const wxString& caption,
67 const wxPoint& position,
72 wxDialog::Create(parent, id, caption, position, size, style);
73 this->SetMaxSize(wxSize(650,-1));
75 this->CreateControls();
80 void wxCDMProjectMapDialog::CreateControls()
83 wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
86 wxStaticText* instruction = new wxStaticText(
90 "This is the map of the possible routes for project development in CreaTools.\n"
91 "It's a simple image guide. For more information please read the user manual.\n"
92 " - Each bubble represents a step in the project development.\n"
93 " - The arrows are the possible routes of the development.\n"
94 " - The icons represent the different software used in each step."
100 v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
102 wxScrolledWindow* imageWindow = new wxScrolledWindow(this);
103 imageWindow->FitInside();
104 imageWindow->SetScrollRate(5,5);
105 imagePanel = new wxPanel(imageWindow);
106 imagePanel->SetMinSize(wxSize(600,1641));
107 imageWindow->SetSizer(new wxBoxSizer(wxVERTICAL));
108 imageWindow->GetSizer()->Add(imagePanel,1,wxEXPAND);
110 wxImage::AddHandler(new wxPNGHandler);
111 image = new wxImage();
113 std::string pathToImage = crea::System::GetExecutablePath() + CDMUtilities::SLASH + ".." + CDMUtilities::SLASH + "share" + CDMUtilities::SLASH + "creaDevManager" + CDMUtilities::SLASH + "data" + CDMUtilities::SLASH + "projectMap.png";
114 image->LoadFile(crea::std2wx(pathToImage), wxBITMAP_TYPE_PNG);
117 wxPaintDC* canvas = new wxPaintDC(imageWindow);
121 v_sizer1->Add(imageWindow, 1, wxEXPAND);
123 v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30);
129 wxCDMProjectMapDialog::PaintEvent(wxPaintEvent& evt)
131 wxPaintDC* canvas = new wxPaintDC(imagePanel);
132 canvas->DrawBitmap(wxBitmap(image->Scale(600,1641,wxIMAGE_QUALITY_HIGH)),0,0, false);
135 void wxCDMProjectMapDialog::OnFinish(wxCommandEvent& event)
137 this->EndDialog(wxID_CANCEL);