]> Creatis software - crea.git/blob - lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp
Feature #1711 CreaDevManager application implementation
[crea.git] / lib / creaDevManagerLib / wxCDMProjectDescriptionPanel.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  * wxCDMProjectDescriptionPanel.cpp
30  *
31  *  Created on: Nov 27, 2012
32  *      Author: Daniel Felipe Gonzalez Obando
33  */
34
35 #include "wxCDMProjectDescriptionPanel.h"
36
37 #include "wxCDMMainFrame.h"
38 #include "wxCDMNewPackageDialog.h"
39 #include "wxCDMProjectConfigurationDialog.h"
40
41 #include "wxCDMProjectHelpDialog.h"
42
43 #include "creaDevManagerIds.h"
44 #include "images/PrIcon64.xpm"
45 #include "CDMUtilities.h"
46
47 BEGIN_EVENT_TABLE(wxCDMProjectDescriptionPanel, wxPanel)
48 EVT_BUTTON(ID_BUTTON_GOTO_PACKAGE_MANAGER, wxCDMProjectDescriptionPanel::OnBtnManagePackages)
49 EVT_BUTTON(ID_BUTTON_GOTO_LIB_MANAGER, wxCDMProjectDescriptionPanel::OnBtnManageLibraries)
50 EVT_BUTTON(ID_BUTTON_GOTO_APPLI_MANAGER, wxCDMProjectDescriptionPanel::OnBtnManageApplications)
51 EVT_BUTTON(ID_BUTTON_CHOOSE, wxCDMProjectDescriptionPanel::OnBtnConfigProject)
52 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists)
53 EVT_BUTTON(ID_BUTTON_SET_BUILD_PATH, wxCDMProjectDescriptionPanel::OnBtnSetBuildPath)
54 EVT_BUTTON(ID_BUTTON_OPEN_BUILD_PATH, wxCDMProjectDescriptionPanel::OnBtnOpenBuild)
55 EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMProjectDescriptionPanel::OnBtnOpenFolder)
56 EVT_BUTTON(ID_BUTTON_SET_VERSION, wxCDMProjectDescriptionPanel::OnBtnSetVersion)
57 END_EVENT_TABLE()
58
59 wxCDMProjectDescriptionPanel::wxCDMProjectDescriptionPanel(
60     wxWindow* parent,
61     modelCDMProject* project,
62     wxWindowID id,
63     const wxString& caption,
64     const wxPoint& pos,
65     const wxSize& size,
66     long style
67 )
68 {
69   wxCDMProjectDescriptionPanel::Create(parent, project, id, caption, pos, size, style);
70 }
71
72 wxCDMProjectDescriptionPanel::~wxCDMProjectDescriptionPanel()
73 {
74 }
75
76 bool wxCDMProjectDescriptionPanel::Create(
77     wxWindow* parent,
78     modelCDMProject* project,
79     wxWindowID id,
80     const wxString& caption,
81     const wxPoint& pos,
82     const wxSize& size,
83     long style
84 )
85 {
86   wxPanel::Create(parent, id, pos, size, style);
87   this->project = project;
88   CreateControls();
89   // this part makes the scrollbars show up
90   this->FitInside(); // ask the sizer about the needed size
91   this->SetScrollRate(5, 5);
92   return TRUE;
93 }
94
95 void wxCDMProjectDescriptionPanel::CreateControls()
96 {
97   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
98
99   //Header
100   wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
101   {
102     //Image
103     headerSizer->Add(new wxStaticBitmap(this, -1, wxBitmap(PrIcon64)),0, wxALIGN_CENTER, 0);
104     wxBoxSizer* textSizer = new wxBoxSizer(wxVERTICAL);
105     //Title
106     textSizer->Add(new wxStaticText(this, -1, _("Project")),0, wxALIGN_LEFT, 0);
107     //Project Name
108     textSizer->Add(new wxStaticText(this, -1, crea::std2wx(this->project->GetName())),0, wxALIGN_LEFT, 0);
109     headerSizer->Add(textSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
110   }
111   sizer->Add(headerSizer, 0, wxALIGN_CENTER);
112
113
114
115
116   //----------------------------------Project Properties-----------------------------------
117   //properties StaticBoxSizer
118   wxStaticBoxSizer* propertiesBox = new wxStaticBoxSizer(wxVERTICAL, this, _T("&Properties"));
119   //properties Panel
120   wxPanel* propertiesPanel = new wxPanel(this);
121   //properties Sizer
122   wxBoxSizer* propertiesPanelSizer = new wxBoxSizer(wxVERTICAL);
123   //propertiesGrid Sizer
124   wxFlexGridSizer* propertiesGridSizer = new wxFlexGridSizer(4, 2, 9, 15);
125   //properties elements
126   //labels
127   wxStaticText* pVersion = new wxStaticText(propertiesPanel, wxID_ANY, wxT("Version"));
128   wxStaticText* pVersionDate = new wxStaticText(propertiesPanel, wxID_ANY, wxT("Version Date"));
129   wxStaticText* pSourceLocation = new wxStaticText(propertiesPanel, wxID_ANY, wxT("Source Location"));
130   wxStaticText* pBuildLocation = new wxStaticText(propertiesPanel, wxID_ANY, wxT("Build Location"));
131   //values
132   // version
133   wxBoxSizer* pVersionsz = new wxBoxSizer(wxHORIZONTAL);
134   this->versiontc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(this->project->GetVersion()));
135   wxButton* pVersionbt = new wxButton(propertiesPanel, ID_BUTTON_SET_VERSION, wxT("Set"));
136   pVersionbt->SetToolTip(wxT("Update the version of the project."));
137   pVersionsz->Add(this->versiontc, 1, wxALIGN_CENTER, 1);
138   pVersionsz->Add(pVersionbt, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10);
139   // versionDate
140   this->versionDatetc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetVersionDate()));
141   // sourceLocation
142   wxBoxSizer* pSourceLocationsz = new wxBoxSizer(wxHORIZONTAL);
143   wxStaticText* pSourceLocationtc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetPath()));
144   pSourceLocationtc->SetMaxSize(wxSize(200,-1));
145   wxButton* pSourceLocationbt = new wxButton(propertiesPanel, ID_BUTTON_OPEN_FOLDER, wxT("Open"));
146   pSourceLocationbt->SetToolTip(wxT("Open the source folder in the file explorer."));
147   pSourceLocationsz->Add(pSourceLocationtc, 1, wxALIGN_CENTER, 1);
148   pSourceLocationsz->Add(pSourceLocationbt, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10);
149   // buildLocation
150   wxBoxSizer* pBuildLocationsz = new wxBoxSizer(wxHORIZONTAL);
151   this->buildPathtc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetBuildPath()));
152   this->buildPathtc->SetMaxSize(wxSize(200,-1));
153
154   wxButton* pBuildLocationbt = new wxButton(propertiesPanel, ID_BUTTON_SET_BUILD_PATH, wxT("Choose..."));
155   pBuildLocationbt->SetToolTip(wxT("Select a new location for compiling the project."));
156
157   wxButton* pBuildOpenbt = new wxButton(propertiesPanel, ID_BUTTON_OPEN_BUILD_PATH, wxT("Open"));
158   pBuildOpenbt->SetToolTip(wxT("Open the binaries folder in the file explorer."));
159
160   pBuildLocationsz->Add(this->buildPathtc, 1, wxALIGN_CENTER, 1);
161   pBuildLocationsz->Add(pBuildLocationbt, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10);
162   pBuildLocationsz->Add(pBuildOpenbt, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10);
163
164   propertiesGridSizer->Add(pVersion, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
165   propertiesGridSizer->Add(pVersionsz, 1, wxEXPAND);
166   propertiesGridSizer->Add(pVersionDate, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
167   propertiesGridSizer->Add(this->versionDatetc, 1, wxEXPAND);
168   propertiesGridSizer->Add(pSourceLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
169   propertiesGridSizer->Add(pSourceLocationsz, 1, wxEXPAND);
170   propertiesGridSizer->Add(pBuildLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
171   propertiesGridSizer->Add(pBuildLocationsz, 1, wxEXPAND);
172
173   propertiesGridSizer->AddGrowableCol(1,1);
174
175   propertiesPanelSizer-> Add(propertiesGridSizer, 1, wxALL | wxEXPAND, 5);
176
177   //SetPanel sizer and box
178   propertiesPanel->SetSizer(propertiesPanelSizer);
179   propertiesPanelSizer->Fit(propertiesPanel);
180   propertiesBox->Add(propertiesPanel, 1, wxEXPAND);
181   sizer->Add(propertiesBox, 0, wxEXPAND | wxLEFT | wxRIGHT, 10);
182
183   //----------------------------------Project Actions--------------------------------------
184   //actions StaticBoxSizer
185   wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxHORIZONTAL,this, _T("&Actions"));
186   actionsBox->GetStaticBox()->SetToolTip(wxT("Go to any of the content managers of the project or edit the project's CMakeLists.txt file by selecting any of the available actions."));
187   //actions Panel
188   wxPanel* actionsPanel = new wxPanel(this);
189   //actions Sizer
190   wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL);
191
192   //actionsGrid Sizer
193   wxFlexGridSizer* actionsGridSizer = new wxFlexGridSizer(3, 2, 9, 15);
194   //buttons
195   // lib manager
196   //   show only if there is a lib folder
197   if(this->project->GetLib() != NULL)
198     {
199       wxButton* libMgrbt = new wxButton(actionsPanel, ID_BUTTON_GOTO_LIB_MANAGER, _T("A. Library Manager"));
200       libMgrbt->SetToolTip(wxT("Find the current available libraries into this project. You can also create new Libraries in this section as well as edit the lib folder's CMakeLists.txt file."));
201       libMgrbt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnLibMouseEnter,NULL,this);
202       libMgrbt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnLibMouseExit,NULL,this);
203       actionsGridSizer->Add(libMgrbt, 1, wxALL | wxEXPAND, 5);
204     }
205   // package manager
206   wxButton* packageMgrbt = new wxButton(actionsPanel, ID_BUTTON_GOTO_PACKAGE_MANAGER, _T("B. Package Manager"));
207   packageMgrbt->SetToolTip(wxT("Find the current available packages into this project. You can also create new Packages in this section."));
208   actionsGridSizer->Add(packageMgrbt, 1, wxALL | wxEXPAND, 5);
209
210   // appli manager
211   //   show only if there is a appli folder
212   if(this->project->GetAppli() != NULL)
213     {
214       wxButton* appliMgrbt = new wxButton(actionsPanel, ID_BUTTON_GOTO_APPLI_MANAGER, _T("C. Application Manager"));
215       appliMgrbt->SetToolTip(wxT("Find the current available applications into this project. You can also create new Applications in this section as well as edit the appli folder's CMakeLists.txt file."));
216       appliMgrbt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnAppliMouseEnter,NULL,this);
217       appliMgrbt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnAppliMouseExit,NULL,this);
218       actionsGridSizer->Add(appliMgrbt, 1, wxALL | wxEXPAND, 5);
219     }
220   // edit 3rd Party libraries
221   wxButton* configPrjbt = new wxButton(actionsPanel, ID_BUTTON_CHOOSE, _T("D. 3rd Party Libraries Manager"));
222   configPrjbt->SetToolTip(wxT("Select which third party libraries will be used in this project."));
223   actionsGridSizer->Add(configPrjbt, 1, wxALL | wxEXPAND, 5);
224
225   // edit CMakeLists file
226   wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
227   editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt file of this project."));
228   editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnCMakeMouseEnter,NULL,this);
229   editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnCMakeMouseExit,NULL,this);
230   actionsGridSizer->Add(editCMakebt, 1, wxALL | wxEXPAND, 5);
231
232   actionsGridSizer->AddGrowableCol(0,1);
233   actionsGridSizer->AddGrowableCol(1,1);
234
235   actionsPanelSizer->Add(actionsGridSizer, 1, wxEXPAND, 0);
236   //SetPanel sizer and box
237   actionsPanel->SetSizer(actionsPanelSizer);
238   actionsPanelSizer->Fit(actionsPanel);
239   actionsBox->Add(actionsPanel, 1, wxALL | wxEXPAND, 5);
240   sizer->Add(actionsBox, 0, wxEXPAND | wxALL, 10);
241
242
243   //Assign sizer
244   this->SetSizer(sizer);
245   sizer->SetSizeHints(this);
246
247   if(((wxCDMMainFrame*)this->GetParent())->isHelp())
248     {
249       wxCDMProjectHelpDialog* helpDialog = new wxCDMProjectHelpDialog(this->GetParent(), this->project, wxID_ANY);
250       helpDialog->Show(true);
251     }
252 }
253
254 modelCDMProject* wxCDMProjectDescriptionPanel::GetProject() const
255 {
256   return this->project;
257 }
258
259 void wxCDMProjectDescriptionPanel::OnBtnManagePackages(wxCommandEvent& event)
260 {
261   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
262   newEvent->SetId(1);
263   newEvent->SetString(wxT("manage_packages"));
264   newEvent->SetClientData(this->project);
265   wxPostEvent(this->GetParent(), *newEvent);
266   event.Skip();
267 }
268
269 void wxCDMProjectDescriptionPanel::OnBtnManageLibraries(wxCommandEvent& event)
270 {
271   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
272   newEvent->SetId(1);
273   newEvent->SetString(wxT("manage_libraries"));
274   wxPostEvent(this->GetParent(), *newEvent);
275
276   wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
277
278   if(this->project->GetLib() != NULL)
279     {
280       newEvent1->SetClientData(this->project->GetLib());
281       newEvent1->SetId(0);
282       wxPostEvent(this->GetParent(), *newEvent1);
283     }
284
285   event.Skip();
286 }
287
288 void wxCDMProjectDescriptionPanel::OnBtnManageApplications(wxCommandEvent& event)
289 {
290   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
291   newEvent->SetId(1);
292   newEvent->SetString(wxT("manage_applications"));
293   wxPostEvent(this->GetParent(), *newEvent);
294
295   wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
296
297   if(this->project->GetAppli() != NULL)
298     {
299       newEvent1->SetClientData(this->project->GetAppli());
300       newEvent1->SetId(0);
301       wxPostEvent(this->GetParent(), *newEvent1);
302     }
303
304   event.Skip();
305 }
306
307 void wxCDMProjectDescriptionPanel::OnBtnConfigProject(wxCommandEvent& event)
308 {
309   wxCDMProjectConfigurationDialog* dialog = new wxCDMProjectConfigurationDialog(this,this->project);
310   long userResponse;
311   userResponse = dialog->ShowModal();
312 }
313
314 void wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
315 {
316   std::string* result;
317   if(!this->project->OpenCMakeListsFile(result))
318     wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
319
320   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
321
322   if(this->project->GetCMakeLists() != NULL)
323     {
324       newEvent->SetClientData(this->project->GetCMakeLists());
325       newEvent->SetId(0);
326       wxPostEvent(this->GetParent(), *newEvent);
327     }
328 }
329
330 void wxCDMProjectDescriptionPanel::OnBtnSetBuildPath(wxCommandEvent& event)
331 {
332   wxDirDialog* dialog = new wxDirDialog(this, wxT("Choose the new build location for the project"));
333   if(dialog->ShowModal())
334     {
335       std::string* result;
336       if(!this->project->SetBuildPath(crea::wx2std(dialog->GetPath()), result))
337         wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
338     }
339   this->buildPathtc->SetLabel(crea::std2wx(this->project->GetBuildPath()));
340 }
341
342 void wxCDMProjectDescriptionPanel::OnBtnOpenBuild(wxCommandEvent& event)
343 {
344   if(CDMUtilities::openFileExplorer(this->project->GetBuildPath()))
345     wxMessageBox(crea::std2wx("The folder doesn't exist or hasn't yet been created."),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
346 }
347
348 void wxCDMProjectDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
349 {
350   std::string* result;
351   if(!this->project->OpenInFileExplorer(result))
352     wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
353 }
354
355 void wxCDMProjectDescriptionPanel::OnBtnSetVersion(wxCommandEvent& event)
356 {
357   //get version
358   wxString libraryName = wxGetTextFromUser(
359       wxT("Enter the new version name"),
360       wxT("Change Project Version - creaDevManager"),
361       crea::std2wx(this->project->GetVersion())
362   );
363   //check name
364   std::vector<std::string> parts;
365   CDMUtilities::splitter::split(parts, crea::wx2std(libraryName), " .", CDMUtilities::splitter::no_empties);
366   if(parts.size() == 3)
367     {
368       std::string* result;
369       if(!this->project->SetVersion(crea::wx2std(libraryName), result))
370         wxMessageBox(crea::std2wx(*result),_T("Open File - Error!"),wxOK | wxICON_ERROR);
371     }
372   else
373     {
374       wxMessageBox(crea::std2wx("The version format is incorrect, please follow the following format:\nX.Y.Z\nX: Major Version\nY: Minor Version\nZ: Build Version"),_T("Set Project Version - Error!"),wxOK | wxICON_ERROR);
375     }
376   this->versiontc->SetLabel(crea::std2wx(this->project->GetVersion()));
377   this->versionDatetc->SetLabel(crea::std2wx(this->project->GetVersionDate()));
378
379 }
380
381 void wxCDMProjectDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event)
382 {
383   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED);
384
385   if(this->project->GetCMakeLists() != NULL)
386     {
387       newEvent->SetClientData(this->project->GetCMakeLists());
388       newEvent->SetId(0);
389       wxPostEvent(this->GetParent(), *newEvent);
390     }
391   event.Skip();
392 }
393
394 void wxCDMProjectDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event)
395 {
396   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
397
398   if(this->project->GetCMakeLists() != NULL)
399     {
400       newEvent->SetClientData(this->project->GetCMakeLists());
401       newEvent->SetId(0);
402       wxPostEvent(this->GetParent(), *newEvent);
403     }
404   event.Skip();
405 }
406
407 void wxCDMProjectDescriptionPanel::OnAppliMouseEnter(wxMouseEvent& event)
408 {
409   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED);
410   std::cout << "entra appli " << this->project->GetAppli()->GetCMakeLists();
411   if(this->project->GetAppli() != NULL)
412     {
413       newEvent->SetClientData(this->project->GetAppli());
414       newEvent->SetId(0);
415       wxPostEvent(this->GetParent(), *newEvent);
416     }
417   event.Skip();
418 }
419
420 void wxCDMProjectDescriptionPanel::OnAppliMouseExit(wxMouseEvent& event)
421 {
422   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
423
424   if(this->project->GetAppli() != NULL)
425     {
426       newEvent->SetClientData(this->project->GetAppli());
427       newEvent->SetId(0);
428       wxPostEvent(this->GetParent(), *newEvent);
429     }
430   event.Skip();
431 }
432
433 void wxCDMProjectDescriptionPanel::OnLibMouseEnter(wxMouseEvent& event)
434 {
435   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED);
436
437   if(this->project->GetLib() != NULL)
438     {
439       newEvent->SetClientData(this->project->GetLib());
440       newEvent->SetId(0);
441       wxPostEvent(this->GetParent(), *newEvent);
442     }
443   event.Skip();
444 }
445
446 void wxCDMProjectDescriptionPanel::OnLibMouseExit(wxMouseEvent& event)
447 {
448   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
449
450   if(this->project->GetLib() != NULL)
451     {
452       newEvent->SetClientData(this->project->GetLib());
453       newEvent->SetId(0);
454       wxPostEvent(this->GetParent(), *newEvent);
455     }
456   event.Skip();
457 }