]> Creatis software - crea.git/blob - lib/creaDevManagerLib/wxCDMAppliHelpDialog.cpp
e3d487e34213b7d8055bef31c7906fe562a66a14
[crea.git] / lib / creaDevManagerLib / wxCDMAppliHelpDialog.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  * wxCDMAppliHelpDialog.cpp
31  *
32  *  Created on: 11/1/2013
33  *      Author: Daniel Felipe Gonzalez Obando
34  */
35
36 #include "wxCDMAppliHelpDialog.h"
37
38 #include "creaDevManagerIds.h"
39
40 BEGIN_EVENT_TABLE(wxCDMAppliHelpDialog, wxDialog)
41 EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMAppliHelpDialog::OnFinish)
42 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMAppliHelpDialog::OnEditCMake)
43 EVT_CHECKBOX(ID_CHECKBOX_DISABLE_HELP, wxCDMAppliHelpDialog::OnDisableHelp)
44 END_EVENT_TABLE()
45
46 wxCDMAppliHelpDialog::wxCDMAppliHelpDialog(
47     wxWindow* parent,
48     modelCDMAppli* appli,
49     wxWindowID id,
50     const wxString& caption,
51     const wxPoint& position,
52     const wxSize& size,
53     long style
54 )
55 {
56   wxCDMAppliHelpDialog::Create(parent, id, caption, position, size, style);
57   this->appli = appli;
58 }
59
60 wxCDMAppliHelpDialog::~wxCDMAppliHelpDialog()
61 {
62 }
63
64 bool wxCDMAppliHelpDialog::Create(
65     wxWindow* parent,
66     wxWindowID id,
67     const wxString& caption,
68     const wxPoint& position,
69     const wxSize& size,
70     long int style
71 )
72 {
73   wxDialog::Create(parent, id, caption, position, size, style);
74
75   this->CreateControls();
76
77   return TRUE;
78 }
79
80 void wxCDMAppliHelpDialog::CreateControls()
81 {
82   wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
83
84
85   wxStaticText* title = new wxStaticText(this, wxID_ANY, wxT("Managing your applications"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);//new wxRichTextCtrl(this,wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxRE_READONLY);
86   v_sizer1->Add(title, 0, wxALIGN_LEFT | wxALL | wxALIGN_CENTER_VERTICAL, 5);
87
88   wxStaticText* instruction = new wxStaticText(
89       this,
90       wxID_ANY,
91       crea::std2wx(
92           "Applications are stand alone programs that use the projects' core functionality (libraries' functions). These "
93           "applications are useful when showing the projects' \"out of the box\" functionalities.\n"
94           "\n"
95           "In the application manager you can view a list of the available applications in the current project, as well as create "
96           "new applications. Remember that any application you make must be included in the appli's folder CMakeLists file. You can do that "
97           "by clicking on the \"Edit Appli's CMakeLists File\" button bellow or in the Application Manager the \"Edit CMakeLists file\" "
98           "button and include the desired applications at the end of the file.\n"
99           "For a better understanding of how to use the applications please check the \"myFierceAppli\" application (which is shipped by "
100           "default in every new project) and take a look at how it's included in the project."),
101           wxDefaultPosition,
102           wxDefaultSize,
103           wxALIGN_LEFT
104   );
105   v_sizer1->Add(instruction, 0,wxEXPAND | wxALL, 5);
106
107   v_sizer1->Add(new wxCheckBox(this, ID_CHECKBOX_DISABLE_HELP, wxT("&Disable help")), 0, wxALIGN_RIGHT | wxRIGHT, 10);
108
109   v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxT("Close")), 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30);
110
111   SetSizer(v_sizer1);
112
113 }
114
115 void wxCDMAppliHelpDialog::OnFinish(wxCommandEvent& event)
116 {
117   this->EndDialog(wxID_CANCEL);
118 }
119
120 void wxCDMAppliHelpDialog::OnEditCMake(wxCommandEvent& event)
121 {
122   //TODO: implement method
123   std::cout << "OnEditCMake not implemented yet." << std::endl;
124   event.Skip();
125 }
126
127
128 void wxCDMAppliHelpDialog::OnEditCMakeMouseEnter(wxMouseEvent& event)
129 {
130   //TODO: implement method
131   std::cout << "OnEditCMakeEnter not implemented yet." << std::endl;
132   event.Skip();
133 }
134
135 void wxCDMAppliHelpDialog::OnEditCMakeMouseExit(wxMouseEvent& event)
136 {
137   //TODO: implement method
138   std::cout << "OnEditCMakeExit not implemented yet." << std::endl;
139   event.Skip();
140 }
141
142
143 void wxCDMAppliHelpDialog::OnDisableHelp(wxCommandEvent& event)
144 {
145   wxPostEvent(this->GetParent(), event);
146 }