]> Creatis software - crea.git/blob - lib/creaDevManagerLib/wxCDMProjectHelpDialog.cpp
Fixes:
[crea.git] / lib / creaDevManagerLib / wxCDMProjectHelpDialog.cpp
1 /*
2 # ---------------------------------------------------------------------
3 #
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
5 #                        pour la Sant�)
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
9 #
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.
16 #
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
21 #  liability. 
22 #
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 # ------------------------------------------------------------------------ 
26  */
27
28
29 /*
30  * wxCDMProjectReadyDialog.cpp
31  *
32  *  Created on: 3/1/2013
33  *      Author: Daniel Felipe Gonzalez Obando
34  */
35
36 #include "wxCDMProjectHelpDialog.h"
37
38 #include "wxCDMProjectDescriptionPanel.h"
39
40 #include "creaDevManagerIds.h"
41
42 BEGIN_EVENT_TABLE(wxCDMProjectHelpDialog, wxDialog)
43 EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMProjectHelpDialog::OnFinish)
44 EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMProjectHelpDialog::OnDisableHelp)
45 END_EVENT_TABLE()
46
47 wxCDMProjectHelpDialog::wxCDMProjectHelpDialog(
48     wxWindow* parent,
49     modelCDMProject* project,
50     wxWindowID id,
51     const wxString& caption,
52     const wxPoint& position,
53     const wxSize& size,
54     long style
55 )
56 {
57   wxCDMProjectHelpDialog::Create(parent, id, caption, position, size, style);
58   this->project = project;
59 }
60
61 wxCDMProjectHelpDialog::~wxCDMProjectHelpDialog()
62 {
63 }
64
65 bool wxCDMProjectHelpDialog::Create(
66     wxWindow* parent,
67     wxWindowID id,
68     const wxString& caption,
69     const wxPoint& position,
70     const wxSize& size,
71     long int style
72 )
73 {
74   wxDialog::Create(parent, id, caption, position, size, style);
75
76   this->CreateControls();
77
78   return TRUE;
79 }
80
81 void wxCDMProjectHelpDialog::CreateControls()
82 {
83
84   wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
85
86
87   wxStaticText* title = new wxStaticText(this, wxID_ANY, wxT("Your project is ready!"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);//new wxRichTextCtrl(this,wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxRE_READONLY);
88   v_sizer1->Add(title, 0, wxALIGN_LEFT | wxALL | wxALIGN_CENTER_VERTICAL, 5);
89
90   wxStaticText* instruction = new wxStaticText(
91       this,
92       wxID_ANY,
93       crea::std2wx(
94           "A project has four main elements:\n"
95           "- Packages: Host the black boxes you make.\n"
96           "- Libraries: Contain the core functions of your programs, they are called by the black boxes and applications you make.\n"
97           "- Applications: Stand alone programs that use the functions available on your libraries.\n"
98           "- Configuration file: Contains the information of what should or shouldn't be compiled from this project.\n"
99           "\n"
100           "The Panel on the left is called \"Description Panel\" and show the details of the project item you are currently working on.\n"
101           "To the right of the description panel you will find a tree with the project structure and it's actual content.\n"
102           "Below the description panel you will find a panel with the project's main actions when you're ready to compile "
103           "the project. you can hover on this buttons to see more information about what they do. They must be executed in the displayed "
104           "order.\n"
105           "When you create a project it comes with a default package. If you need to work on it or if you want to create more "
106           "packages you can do it by clicking the \"Package Manager\" button below. You can also work with Libraries and "
107           "Applications. Just click in the \"Library Manager\" button or \"Application manager\" button to start working "
108           "with them.\n"),
109           wxDefaultPosition,
110           wxDefaultSize,
111           wxALIGN_LEFT
112   );
113   v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
114
115   v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10);
116
117   v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30);
118
119   SetSizer(v_sizer1);
120   //v_sizer1->RecalcSizes();
121 }
122
123 void wxCDMProjectHelpDialog::OnFinish(wxCommandEvent& event)
124 {
125   this->EndDialog(wxID_CANCEL);
126 }
127
128 void wxCDMProjectHelpDialog::OnDisableHelp(wxCommandEvent& event)
129 {
130   wxPostEvent(this->GetParent(), event);
131 }