]> Creatis software - crea.git/blob - lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp
Feature #1711 CreaDevManager application implementation
[crea.git] / lib / creaDevManagerLib / wxCDMLibraryDescriptionPanel.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  * wxCDMLibraryDescriptionPanel.cpp
30  *
31  *  Created on: Nov 27, 2012
32  *      Author: Daniel Felipe Gonzalez Obando
33  */
34
35 #include "wxCDMLibraryDescriptionPanel.h"
36
37 #include "CDMUtilities.h"
38 #include "wxCDMMainFrame.h"
39
40 #include "wxCDMLibraryHelpDialog.h"
41
42 #include "creaDevManagerIds.h"
43 #include "images/LIcon64.xpm"
44
45 BEGIN_EVENT_TABLE(wxCDMLibraryDescriptionPanel, wxPanel)
46 EVT_HYPERLINK(ID_BUTTON_PREV, wxCDMLibraryDescriptionPanel::OnBtnReturn)
47 EVT_BUTTON(ID_BUTTON_SET_NAME, wxCDMLibraryDescriptionPanel::OnBtnSetExeName)
48 EVT_BUTTON(ID_BUTTON_CREATE_CLASS, wxCDMLibraryDescriptionPanel::OnBtnCreateClass)
49 EVT_BUTTON(ID_BUTTON_CREATE_FOLDER, wxCDMLibraryDescriptionPanel::OnBtnCreateFolder)
50 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMLibraryDescriptionPanel::OnBtnEditCMakeLists)
51 EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMLibraryDescriptionPanel::OnBtnOpenFolder)
52 EVT_CHECKBOX(ID_CHECK_INCLUDE_3RDLIBRARY, wxCDMLibraryDescriptionPanel::On3rdLibraryChBChange)
53 EVT_CHECKBOX(ID_CHECK_INCLUDE_LIBRARY, wxCDMLibraryDescriptionPanel::OnLibraryChBChange)
54 END_EVENT_TABLE()
55
56 wxCDMLibraryDescriptionPanel::wxCDMLibraryDescriptionPanel(
57     wxWindow* parent,
58     modelCDMLibrary* library,
59     wxWindowID id,
60     const wxString& caption,
61     const wxPoint& pos,
62     const wxSize& size,
63     long style
64 )
65 {
66   wxCDMLibraryDescriptionPanel::Create(parent, library, id, caption, pos, size, style);
67 }
68
69 wxCDMLibraryDescriptionPanel::~wxCDMLibraryDescriptionPanel()
70 {
71 }
72
73 bool wxCDMLibraryDescriptionPanel::Create(
74     wxWindow* parent,
75     modelCDMLibrary* library,
76     wxWindowID id,
77     const wxString& caption,
78     const wxPoint& pos,
79     const wxSize& size,
80     long style
81 )
82 {
83   wxPanel::Create(parent, id, pos, size, style);
84   // this part makes the scrollbars show up
85   this->FitInside(); // ask the sizer about the needed size
86   this->SetScrollRate(5, 5);
87
88   this->library = library;
89   CreateControls();
90   return TRUE;
91 }
92
93 void wxCDMLibraryDescriptionPanel::CreateControls()
94 {
95   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
96
97   //Links to return
98   wxBoxSizer *linksSizer = new wxBoxSizer(wxHORIZONTAL);
99   std::vector<modelCDMIProjectTreeNode*> parents = this->library->GetParents();
100   for (int i = 0; i < (int)(parents.size()); i++)
101     {
102       wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE);
103       returnLnk->SetWindowStyle(wxNO_BORDER);
104           returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + "."));
105       linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5);
106       linksSizer->Add(new wxStaticText(this,wxID_ANY, wxT("/")), 0, wxALIGN_CENTER, 0);
107     }
108
109   linksSizer->Add(new wxStaticText(this, wxID_ANY, crea::std2wx(this->library->GetName())), 0, wxALIGN_CENTER, 0);
110
111   sizer->Add(linksSizer, 0, wxALIGN_CENTER | wxALL, 5);
112
113   //Header
114   wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
115   {
116     //Image
117     headerSizer->Add(new wxStaticBitmap(this, -1, wxBitmap(LIcon64)),0, wxALIGN_CENTER, 0);
118     wxBoxSizer* textSizer = new wxBoxSizer(wxVERTICAL);
119     //Title
120     textSizer->Add(new wxStaticText(this, -1, _("Library")),0, wxALIGN_LEFT, 0);
121     //Library Name
122     textSizer->Add(new wxStaticText(this, -1, crea::std2wx(this->library->GetName())),0, wxALIGN_LEFT, 0);
123     headerSizer->Add(textSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
124   }
125   sizer->Add(headerSizer, 0, wxALIGN_CENTER);
126
127   /*//Properties
128   wxStaticBoxSizer* propertiesBox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Properties"));
129   wxPanel* propertiesPanel = new wxPanel(this);
130   wxBoxSizer* propertiesPanelSizer = new wxBoxSizer(wxVERTICAL);
131
132   wxFlexGridSizer* propertiesGridSizer = new wxFlexGridSizer(4, 2, 9, 15);
133
134   wxStaticText *pMainFile = new wxStaticText(propertiesPanel, -1, wxT("Library Name"));
135   wxBoxSizer* pMainFilesz = new wxBoxSizer(wxHORIZONTAL);
136   this->libraryNametc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(this->library->GetNameLibrary()));
137   wxButton* pMainFilebt = new wxButton(propertiesPanel, ID_BUTTON_SET_NAME, wxT("Set"));
138   pMainFilebt->SetToolTip(wxT("Set the name of the library for the project."));
139   pMainFilesz->Add(this->libraryNametc, 0, wxALIGN_CENTER_VERTICAL, 0);
140   pMainFilesz->Add(pMainFilebt, 0, wxALIGN_CENTER | wxLEFT, 10);
141
142   propertiesGridSizer->Add(pMainFile, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
143   propertiesGridSizer->Add(pMainFilesz, 1, wxEXPAND);
144
145   propertiesGridSizer->AddGrowableCol(1,1);
146
147   propertiesPanelSizer->Add(propertiesGridSizer, 0, wxEXPAND);
148   propertiesPanel->SetSizer(propertiesPanelSizer);
149   propertiesPanelSizer->Fit(propertiesPanel);
150   propertiesBox->Add(propertiesPanel, 0, wxEXPAND);
151   sizer->Add(propertiesBox, 0, wxEXPAND | wxALL, 10);
152    */
153
154   //Includes
155   wxStaticBoxSizer* includesBox = new wxStaticBoxSizer(wxHORIZONTAL, this, wxT("&Used Libraries"));
156   includesBox->SetMinSize(250,250);
157   wxScrolledWindow* includesPanel = new wxScrolledWindow(this);
158   wxBoxSizer* includesPanelSizer = new wxBoxSizer(wxVERTICAL);
159
160   //Third Party Libraries
161   wxStaticText* Title1 = new wxStaticText(includesPanel, wxID_ANY, wxT("Third Party Libraries:"));
162   wxFont font = Title1->GetFont();
163   font.SetWeight(wxFONTWEIGHT_BOLD);
164   Title1->SetFont(font);
165   includesPanelSizer->Add(Title1, 0, wxEXPAND);
166
167   //inclusion data
168   std::map<std::string, bool> inclusions = this->library->Get3rdPartyLibraries();
169   //includesGrid Sizer
170   wxFlexGridSizer* includesGridSizer = new wxFlexGridSizer(inclusions.size()+1, 2, 0, 5);
171
172   wxStaticText* ChBTitle = new wxStaticText(
173       includesPanel,
174       wxID_ANY,
175       wxT("Included"),
176       wxDefaultPosition,
177       wxDefaultSize,
178       wxALIGN_CENTER
179     );
180   wxStaticText* LNmTitle = new wxStaticText(
181       includesPanel,
182       wxID_ANY,
183       wxT("Library Name"),
184       wxDefaultPosition,
185       wxDefaultSize,
186       wxALIGN_LEFT
187     );
188
189   includesGridSizer->Add(ChBTitle, 1, wxEXPAND);
190   includesGridSizer->Add(LNmTitle, 1, wxEXPAND);
191
192   for (std::map<std::string, bool>::iterator it = inclusions.begin(); it != inclusions.end(); ++it) {
193     wxCheckBox* ChBIncl = new wxCheckBox(
194         includesPanel, ID_CHECK_INCLUDE_3RDLIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
195       );
196     ChBIncl->SetToolTip(crea::std2wx("When this box is checked the " + it->first + " library is included in the project configuration for this library."));
197     ChBIncl->SetName(crea::std2wx(it->first));
198     ChBIncl->SetValue(it->second);
199     includesGridSizer->Add(ChBIncl, 1, wxEXPAND);
200
201     wxStaticText* LNmIncl = new wxStaticText(includesPanel, wxID_ANY, crea::std2wx(it->first));
202     includesGridSizer->Add(LNmIncl, 1, wxEXPAND);
203   }
204
205   includesGridSizer->AddGrowableCol(1,1);
206
207   includesPanelSizer->Add(includesGridSizer, 0, wxEXPAND | wxLEFT, 5);
208
209   //Custom Libraries
210   wxStaticText* Title2 = new wxStaticText(includesPanel, wxID_ANY, wxT("Custom Libraries:"));
211   font = Title2->GetFont();
212   font.SetWeight(wxFONTWEIGHT_BOLD);
213   Title2->SetFont(font);
214   includesPanelSizer->Add(Title2, 0, wxEXPAND);
215
216   //inclusion data
217   std::map<std::string, bool> inclusionsLibs = this->library->GetCustomLibraries();
218   //includesGrid Sizer
219   wxFlexGridSizer* includesLibGridSizer = new wxFlexGridSizer(inclusionsLibs.size()+1, 2, 0, 5);
220
221   wxStaticText* ChBTitle1 = new wxStaticText(
222       includesPanel,
223       wxID_ANY,
224       wxT("Included"),
225       wxDefaultPosition,
226       wxDefaultSize,
227       wxALIGN_CENTER
228     );
229   wxStaticText* LNmTitle1 = new wxStaticText(
230       includesPanel,
231       wxID_ANY,
232       wxT("Library Name"),
233       wxDefaultPosition,
234       wxDefaultSize,
235       wxALIGN_LEFT
236     );
237
238   includesLibGridSizer->Add(ChBTitle1, 1, wxEXPAND);
239   includesLibGridSizer->Add(LNmTitle1, 1, wxEXPAND);
240
241   for (std::map<std::string, bool>::iterator it = inclusionsLibs.begin(); it != inclusionsLibs.end(); ++it) {
242     wxCheckBox* ChBIncl = new wxCheckBox(
243         includesPanel, ID_CHECK_INCLUDE_LIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
244       );
245     ChBIncl->SetToolTip(crea::std2wx("When this box is checked the " + it->first + " custom library is included in the project configuration for this library."));
246     ChBIncl->SetName(crea::std2wx(it->first));
247     ChBIncl->SetValue(it->second);
248     includesLibGridSizer->Add(ChBIncl, 1, wxEXPAND);
249
250     wxStaticText* LNmIncl = new wxStaticText(includesPanel, wxID_ANY, crea::std2wx(it->first));
251     includesLibGridSizer->Add(LNmIncl, 1, wxEXPAND);
252   }
253
254   includesLibGridSizer->AddGrowableCol(1,1);
255
256   includesPanelSizer->Add(includesLibGridSizer, 0, wxEXPAND | wxLEFT, 5);
257
258   includesPanel->SetSizer(includesPanelSizer);
259   includesPanelSizer->Fit(includesPanel);
260
261   includesPanel->FitInside();
262   includesPanel->SetScrollRate(5,5);
263
264   includesBox->Add(includesPanel, 1, wxEXPAND);
265   sizer -> Add(includesBox, 0, wxALL | wxEXPAND, 10);
266
267
268
269   //Actions
270   wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxHORIZONTAL, this, wxT("&Actions"));
271   wxPanel* actionsPanel = new wxPanel(this);
272   wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL);
273
274   //actionsGrid Sizer
275   wxFlexGridSizer* actionsGridSizer = new wxFlexGridSizer(2, 2, 9, 15);
276
277   wxButton* createClassbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_CLASS, _T("A. Create Class"));
278   createClassbt->SetToolTip(wxT("Create a new class for this library."));
279   actionsGridSizer->Add(createClassbt, 1, wxALL | wxEXPAND, 5);
280   wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("B. Open Library Folder"));
281   openFolderbt->SetToolTip(wxT("Open the library folder in the file explorer."));
282   actionsGridSizer->Add(openFolderbt, 1, wxALL | wxEXPAND, 5);
283   wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
284   editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt of this library in the default text editor."));
285   editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibraryDescriptionPanel::OnCMakeMouseEnter,NULL,this);
286   editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibraryDescriptionPanel::OnCMakeMouseExit,NULL,this);
287   actionsGridSizer->Add(editCMakebt, 1, wxALL | wxEXPAND, 5);
288   wxButton* createFolderbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_FOLDER, _T("Create Folder"));
289   createFolderbt->SetToolTip(wxT("Create a new folder for this library."));
290   actionsGridSizer->Add(createFolderbt, 1, wxALL | wxEXPAND, 5);
291
292   actionsGridSizer->AddGrowableCol(0,1);
293   actionsGridSizer->AddGrowableCol(1,1);
294
295   actionsPanelSizer->Add(actionsGridSizer, 1, wxEXPAND, 0);
296   actionsPanel->SetSizer(actionsPanelSizer);
297   actionsPanelSizer->Fit(actionsPanel);
298   actionsBox->Add(actionsPanel, 1, wxEXPAND);
299   sizer -> Add(actionsBox, 0, wxALL | wxEXPAND, 10);
300
301   //Assign sizer
302   SetSizer(sizer);
303   sizer->SetSizeHints(this);
304
305   if (((wxCDMMainFrame*)this->GetParent())->isHelp())
306     {
307       wxCDMLibraryHelpDialog* helpDialog = new wxCDMLibraryHelpDialog(this->GetParent(), this->library, wxID_ANY);
308       helpDialog->Show(true);
309     }
310 }
311
312 void wxCDMLibraryDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
313 {
314   std::vector<modelCDMIProjectTreeNode*> parents = this->library->GetParents();
315     std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
316     //std::cout << parentURL << std::endl;
317     for (int i = 0; i < (int)(parents.size()); i++)
318       {
319         if (parents[i]->GetPath() == parentURL)
320           {
321             wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
322             newEvent->SetClientData(parents[i]);
323             newEvent->SetId(0);
324             wxPostEvent(this->GetParent(), *newEvent);
325           }
326       }
327 }
328
329 void wxCDMLibraryDescriptionPanel::OnBtnSetExeName(wxCommandEvent& event)
330 {
331   //get name
332   wxString versionWx = wxGetTextFromUser(
333       wxT("Enter the new executable name"),
334       wxT("Change Library Name - creaDevManager"),
335       crea::std2wx(this->library->GetNameLibrary())
336   );
337   //check name
338   std::vector<std::string> parts;
339   CDMUtilities::splitter::split(parts, crea::wx2std(versionWx), " .", CDMUtilities::splitter::no_empties);
340   if(parts.size() > 0)
341     {
342       std::string* result;
343       if(!this->library->SetNameLibrary(crea::wx2std(versionWx), result))
344         wxMessageBox(crea::std2wx(*result),_T("Change Library Name - Error!"),wxOK | wxICON_ERROR);
345     }
346   else
347     {
348       wxMessageBox(crea::std2wx("No name specified"),_T("Set Library Name - Error!"),wxOK | wxICON_ERROR);
349     }
350   this->libraryNametc->SetLabel(crea::std2wx(this->library->GetNameLibrary()));
351 }
352
353 void wxCDMLibraryDescriptionPanel::On3rdLibraryChBChange(wxCommandEvent& event)
354 {
355   this->library->Set3rdPartyLibrary(crea::wx2std(((wxCheckBox*)event.GetEventObject())->GetName()), ((wxCheckBox*)event.GetEventObject())->GetValue());
356 }
357
358 void wxCDMLibraryDescriptionPanel::OnLibraryChBChange(wxCommandEvent& event)
359 {
360   this->library->SetCustomLibrary(crea::wx2std(((wxCheckBox*)event.GetEventObject())->GetName()), ((wxCheckBox*)event.GetEventObject())->GetValue());
361 }
362
363 void wxCDMLibraryDescriptionPanel::OnBtnCreateClass(wxCommandEvent& event)
364 {
365   //get class name from user
366   wxTextEntryDialog* newClassDlg = new wxTextEntryDialog(
367       this,
368       wxT("Please enter the new class name."),
369       wxT("New Class - creaDevManager"),
370       wxT(""),
371       wxOK | wxCANCEL
372   );
373
374   if (newClassDlg->ShowModal() == wxID_OK)
375     {
376       std::string className = crea::wx2std(newClassDlg->GetValue());
377       //check class name
378       if(className.size() > 0)
379         {
380           if(!this->library->CreateClass(className))
381             wxMessageBox(crea::std2wx("Something has gone wrong with the creation of the class."),_T("New Class - Error!"),wxOK | wxICON_ERROR);
382
383           ((wxCDMMainFrame*)this->GetParent())->RefreshProject();
384
385           wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
386           newEvent->SetId(0);
387           newEvent->SetClientData(this->library);
388           wxPostEvent(this->GetParent(), *newEvent);
389
390           wxMessageBox(crea::std2wx("The class has been created successfully."),_T("New Class - Success"),wxOK | wxICON_INFORMATION);
391         }
392       else
393         {
394           wxMessageBox(crea::std2wx("The new class name cannot be empty."),_T("New Class - Error!"),wxOK | wxICON_ERROR);
395         }
396     }
397 }
398
399 void wxCDMLibraryDescriptionPanel::OnBtnCreateFolder(wxCommandEvent& event)
400 {
401   //get name
402   wxString folderName = wxGetTextFromUser(
403       wxT("Enter the name of the new folder:"),
404       wxT("Create Folder - creaDevManager")
405   );
406   //check name
407   std::vector<std::string> parts;
408   CDMUtilities::splitter::split(parts, crea::wx2std(folderName), " /\\\"", CDMUtilities::splitter::no_empties);
409   if(parts.size() > 0)
410     {
411       std::string* result;
412       modelCDMFolder* folderC = this->library->CreateFolder(crea::wx2std(folderName), result);
413       if(folderC == NULL)
414         {
415           wxMessageBox(crea::std2wx(*result),_T("Create Folder - Error!"),wxOK | wxICON_ERROR);
416           return;
417         }
418       ((wxCDMMainFrame*)this->GetParent())->RefreshProject();
419       wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
420       newEvent->SetClientData(folderC);
421       wxPostEvent(this->GetParent(), *newEvent);
422       wxMessageBox(crea::std2wx("The folder was successfully created"),_T("Create Folder - Success"),wxOK | wxICON_INFORMATION);
423     }
424   else
425     {
426       wxMessageBox(crea::std2wx("No name specified"),_T("Create Folder - Error!"),wxOK | wxICON_ERROR);
427     }
428 }
429
430 void wxCDMLibraryDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
431 {
432   std::string* result;
433   if(!this->library->OpenCMakeListsFile(result))
434     wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
435
436   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
437
438   if(this->library->GetCMakeLists() != NULL)
439     {
440       newEvent->SetClientData(this->library->GetCMakeLists());
441       newEvent->SetId(0);
442       wxPostEvent(this->GetParent(), *newEvent);
443     }
444
445   event.Skip();
446 }
447
448 void wxCDMLibraryDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
449 {
450   std::string* result;
451   if(!this->library->OpenInFileExplorer(result))
452     wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
453 }
454
455 void wxCDMLibraryDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event)
456 {
457   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED);
458
459   if(this->library->GetCMakeLists() != NULL)
460     {
461       newEvent->SetClientData(this->library->GetCMakeLists());
462       newEvent->SetId(0);
463       wxPostEvent(this->GetParent(), *newEvent);
464     }
465   event.Skip();
466 }
467
468 void wxCDMLibraryDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event)
469 {
470   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
471
472   if(this->library->GetCMakeLists() != NULL)
473     {
474       newEvent->SetClientData(this->library->GetCMakeLists());
475       newEvent->SetId(0);
476       wxPostEvent(this->GetParent(), *newEvent);
477     }
478   event.Skip();
479 }