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 # ------------------------------------------------------------------------
32 * Created on: 13/11/2012
33 * Author: Daniel Felipe Gonzalez Obando
36 #include "wxCDMMainDescriptionPanel.h"
38 #include "wxCDMMainFrame.h"
40 #include "wxCDMMainHelpDialog.h"
42 #include "creaDevManagerIds.h"
43 #include "images/CIcon64.xpm"
45 BEGIN_EVENT_TABLE(wxCDMMainDescriptionPanel, wxPanel)
46 EVT_MENU(ID_MENU_NEW_PROJECT, wxCDMMainDescriptionPanel::OnBtnNewProject)
47 EVT_MENU(ID_MENU_OPEN_PROJECT, wxCDMMainDescriptionPanel::OnBtnOpenProject)
51 wxCDMMainDescriptionPanel::wxCDMMainDescriptionPanel(
54 const wxString& caption,
60 wxCDMMainDescriptionPanel::Create(parent, id, caption, pos, size, style);
63 wxCDMMainDescriptionPanel::~wxCDMMainDescriptionPanel()
67 bool wxCDMMainDescriptionPanel::Create(
70 const wxString& caption,
76 //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
77 #if wxMAJOR_VERSION <= 2
78 wxPanel::Create(parent, id, pos, size, style);
80 wxScrolledWindow::Create(parent, id, pos, size, style);
84 this->FitInside(); // ask the sizer about the needed size
85 this->SetScrollRate(5, 5);
89 void wxCDMMainDescriptionPanel::CreateControls()
91 wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
94 wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
97 headerSizer->Add(new wxStaticBitmap(this, -1, wxBitmap(CIcon64)),0, wxALIGN_CENTER, 0);
98 wxBoxSizer* textSizer = new wxBoxSizer(wxVERTICAL);
100 textSizer->Add(new wxStaticText(this, -1, _("Welcome")),0, wxALIGN_LEFT, 0);
102 textSizer->Add(new wxStaticText(this, -1, crea::std2wx("Crea Development Manager")),0, wxALIGN_LEFT, 0);
103 headerSizer->Add(textSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
105 sizer->Add(headerSizer, 0, wxALIGN_CENTER | wxUP, 10);
108 wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxHORIZONTAL, this, wxT("&Actions"));
109 actionsBox->GetStaticBox()->SetToolTip(wxT("Create a new crea project or open an existing one selection any of the available actions."));
110 //wxPanel* actionsPanel = new wxPanel(this);
111 //wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL);
113 wxButton* newProjectbt = new wxButton(this, ID_BUTTON_NEWPROJECT, _T("New Project"));
114 newProjectbt->SetToolTip(wxT("Create a new crea project."));
115 actionsBox->Add(newProjectbt, 0, wxALL, 20);
116 wxButton* openProjectbt = new wxButton(this, ID_BUTTON_OPENPROJECT, _T("Open Project (source/binaries)"));
117 openProjectbt->SetToolTip(wxT("Open an existing crea project from its binaries or its sources."));
118 actionsBox->Add(openProjectbt, 0, wxALL, 20);
120 //actionsPanel->SetSizer(actionsPanelSizer);
121 //actionsPanelSizer->Fit(actionsPanel);
123 //actionsBox->Add(actionsPanel, 0,wxEXPAND | wxALIGN_CENTER | wxALL, 10);
124 sizer -> Add(actionsBox, 0, wxALIGN_CENTER | wxALL, 20);
127 sizer->SetSizeHints(this);
130 if(((wxCDMMainFrame*)this->GetParent())->isHelp())
132 wxDialog* helpDialog = new wxCDMMainHelpDialog(this->GetParent(), this, wxID_ANY);
133 helpDialog->Show(true);
138 void wxCDMMainDescriptionPanel::OnBtnNewProject(wxCommandEvent& event)
143 void wxCDMMainDescriptionPanel::OnBtnOpenProject(wxCommandEvent& event)