]> 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   wxPanel* includesPanel = new wxPanel(this);
157   wxBoxSizer* includesPanelSizer = new wxBoxSizer(wxVERTICAL);
158
159   //Third Party Libraries
160   wxStaticText* Title1 = new wxStaticText(includesPanel, wxID_ANY, wxT("Third Party Libraries:"));
161   wxFont font = Title1->GetFont();
162   font.SetWeight(wxFONTWEIGHT_BOLD);
163   Title1->SetFont(font);
164   includesPanelSizer->Add(Title1, 0, wxEXPAND | wxALL, 5);
165
166   //inclusion data
167   std::map<std::string, bool> inclusions = this->library->Get3rdPartyLibraries();
168   //includesGrid Sizer
169   wxFlexGridSizer* includesGridSizer = new wxFlexGridSizer(inclusions.size()+1, 2, 0, 5);
170
171   wxStaticText* ChBTitle = new wxStaticText(
172       includesPanel,
173       wxID_ANY,
174       wxT("Included"),
175       wxDefaultPosition,
176       wxDefaultSize,
177       wxALIGN_CENTER
178     );
179   wxStaticText* LNmTitle = new wxStaticText(
180       includesPanel,
181       wxID_ANY,
182       wxT("Library Name"),
183       wxDefaultPosition,
184       wxDefaultSize,
185       wxALIGN_LEFT
186     );
187
188   includesGridSizer->Add(ChBTitle, 1, wxEXPAND);
189   includesGridSizer->Add(LNmTitle, 1, wxEXPAND);
190
191   for (std::map<std::string, bool>::iterator it = inclusions.begin(); it != inclusions.end(); ++it) {
192     wxCheckBox* ChBIncl = new wxCheckBox(
193         includesPanel, ID_CHECK_INCLUDE_3RDLIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
194       );
195     ChBIncl->SetToolTip(crea::std2wx("When this box is checked the " + it->first + " library is included in the project configuration for this library."));
196     ChBIncl->SetName(crea::std2wx(it->first));
197     ChBIncl->SetValue(it->second);
198     includesGridSizer->Add(ChBIncl, 1, wxEXPAND);
199
200     wxStaticText* LNmIncl = new wxStaticText(includesPanel, wxID_ANY, crea::std2wx(it->first));
201     includesGridSizer->Add(LNmIncl, 1, wxEXPAND);
202   }
203
204   includesGridSizer->AddGrowableCol(1,1);
205
206   includesPanelSizer->Add(includesGridSizer, 1, wxEXPAND, 0);
207
208   //Custom Libraries
209   wxStaticText* Title2 = new wxStaticText(includesPanel, wxID_ANY, wxT("Custom Libraries:"));
210   font = Title2->GetFont();
211   font.SetWeight(wxFONTWEIGHT_BOLD);
212   Title2->SetFont(font);
213   includesPanelSizer->Add(Title2, 0, wxEXPAND | wxALL, 5);
214
215   //inclusion data
216   std::map<std::string, bool> inclusionsLibs = this->library->GetCustomLibraries();
217   //includesGrid Sizer
218   wxFlexGridSizer* includesLibGridSizer = new wxFlexGridSizer(inclusionsLibs.size()+1, 2, 0, 5);
219
220   wxStaticText* ChBTitle1 = new wxStaticText(
221       includesPanel,
222       wxID_ANY,
223       wxT("Included"),
224       wxDefaultPosition,
225       wxDefaultSize,
226       wxALIGN_CENTER
227     );
228   wxStaticText* LNmTitle1 = new wxStaticText(
229       includesPanel,
230       wxID_ANY,
231       wxT("Library Name"),
232       wxDefaultPosition,
233       wxDefaultSize,
234       wxALIGN_LEFT
235     );
236
237   includesLibGridSizer->Add(ChBTitle1, 1, wxEXPAND);
238   includesLibGridSizer->Add(LNmTitle1, 1, wxEXPAND);
239
240   for (std::map<std::string, bool>::iterator it = inclusionsLibs.begin(); it != inclusionsLibs.end(); ++it) {
241     wxCheckBox* ChBIncl = new wxCheckBox(
242         includesPanel, ID_CHECK_INCLUDE_LIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
243       );
244     ChBIncl->SetToolTip(crea::std2wx("When this box is checked the " + it->first + " custom library is included in the project configuration for this library."));
245     ChBIncl->SetName(crea::std2wx(it->first));
246     ChBIncl->SetValue(it->second);
247     includesLibGridSizer->Add(ChBIncl, 1, wxEXPAND);
248
249     wxStaticText* LNmIncl = new wxStaticText(includesPanel, wxID_ANY, crea::std2wx(it->first));
250     includesLibGridSizer->Add(LNmIncl, 1, wxEXPAND);
251   }
252
253   includesLibGridSizer->AddGrowableCol(1,1);
254
255   includesPanelSizer->Add(includesLibGridSizer, 1, wxEXPAND, 0);
256
257   includesPanel->SetSizer(includesPanelSizer);
258   includesPanelSizer->Fit(includesPanel);
259   includesBox->Add(includesPanel, 1, wxEXPAND);
260   sizer -> Add(includesBox, 0, wxALL | wxEXPAND, 10);
261
262
263
264   //Actions
265   wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxHORIZONTAL, this, wxT("&Actions"));
266   wxPanel* actionsPanel = new wxPanel(this);
267   wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL);
268
269   //actionsGrid Sizer
270   wxFlexGridSizer* actionsGridSizer = new wxFlexGridSizer(2, 2, 9, 15);
271
272   wxButton* createClassbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_CLASS, _T("A. Create Class"));
273   createClassbt->SetToolTip(wxT("Create a new class for this library."));
274   actionsGridSizer->Add(createClassbt, 1, wxALL | wxEXPAND, 5);
275   wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("B. Open Library Folder"));
276   openFolderbt->SetToolTip(wxT("Open the library folder in the file explorer."));
277   actionsGridSizer->Add(openFolderbt, 1, wxALL | wxEXPAND, 5);
278   wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
279   editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt of this library in the default text editor."));
280   editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibraryDescriptionPanel::OnCMakeMouseEnter,NULL,this);
281   editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibraryDescriptionPanel::OnCMakeMouseExit,NULL,this);
282   actionsGridSizer->Add(editCMakebt, 1, wxALL | wxEXPAND, 5);
283   wxButton* createFolderbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_FOLDER, _T("Create Folder"));
284   createFolderbt->SetToolTip(wxT("Create a new folder for this library."));
285   actionsGridSizer->Add(createFolderbt, 1, wxALL | wxEXPAND, 5);
286
287   actionsGridSizer->AddGrowableCol(0,1);
288   actionsGridSizer->AddGrowableCol(1,1);
289
290   actionsPanelSizer->Add(actionsGridSizer, 1, wxEXPAND, 0);
291   actionsPanel->SetSizer(actionsPanelSizer);
292   actionsPanelSizer->Fit(actionsPanel);
293   actionsBox->Add(actionsPanel, 1, wxEXPAND);
294   sizer -> Add(actionsBox, 0, wxALL | wxEXPAND, 10);
295
296   //Assign sizer
297   SetSizer(sizer);
298   sizer->SetSizeHints(this);
299
300   if (((wxCDMMainFrame*)this->GetParent())->isHelp())
301     {
302       wxCDMLibraryHelpDialog* helpDialog = new wxCDMLibraryHelpDialog(this->GetParent(), this->library, wxID_ANY);
303       helpDialog->Show(true);
304     }
305 }
306
307 void wxCDMLibraryDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
308 {
309   std::vector<modelCDMIProjectTreeNode*> parents = this->library->GetParents();
310     std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
311     //std::cout << parentURL << std::endl;
312     for (int i = 0; i < (int)(parents.size()); i++)
313       {
314         if (parents[i]->GetPath() == parentURL)
315           {
316             wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
317             newEvent->SetClientData(parents[i]);
318             newEvent->SetId(0);
319             wxPostEvent(this->GetParent(), *newEvent);
320           }
321       }
322 }
323
324 void wxCDMLibraryDescriptionPanel::OnBtnSetExeName(wxCommandEvent& event)
325 {
326   //get name
327   wxString versionWx = wxGetTextFromUser(
328       wxT("Enter the new executable name"),
329       wxT("Change Library Name - creaDevManager"),
330       crea::std2wx(this->library->GetNameLibrary())
331   );
332   //check name
333   std::vector<std::string> parts;
334   CDMUtilities::splitter::split(parts, crea::wx2std(versionWx), " .", CDMUtilities::splitter::no_empties);
335   if(parts.size() > 0)
336     {
337       std::string* result;
338       if(!this->library->SetNameLibrary(crea::wx2std(versionWx), result))
339         wxMessageBox(crea::std2wx(*result),_T("Change Library Name - Error!"),wxOK | wxICON_ERROR);
340     }
341   else
342     {
343       wxMessageBox(crea::std2wx("No name specified"),_T("Set Library Name - Error!"),wxOK | wxICON_ERROR);
344     }
345   this->libraryNametc->SetLabel(crea::std2wx(this->library->GetNameLibrary()));
346 }
347
348 void wxCDMLibraryDescriptionPanel::On3rdLibraryChBChange(wxCommandEvent& event)
349 {
350   this->library->Set3rdPartyLibrary(crea::wx2std(((wxCheckBox*)event.GetEventObject())->GetName()), ((wxCheckBox*)event.GetEventObject())->GetValue());
351 }
352
353 void wxCDMLibraryDescriptionPanel::OnLibraryChBChange(wxCommandEvent& event)
354 {
355   this->library->SetCustomLibrary(crea::wx2std(((wxCheckBox*)event.GetEventObject())->GetName()), ((wxCheckBox*)event.GetEventObject())->GetValue());
356 }
357
358 void wxCDMLibraryDescriptionPanel::OnBtnCreateClass(wxCommandEvent& event)
359 {
360   //get class name from user
361   wxTextEntryDialog* newClassDlg = new wxTextEntryDialog(
362       this,
363       wxT("Please enter the new class name."),
364       wxT("New Class - creaDevManager"),
365       wxT(""),
366       wxOK | wxCANCEL
367   );
368
369   if (newClassDlg->ShowModal() == wxID_OK)
370     {
371       std::string className = crea::wx2std(newClassDlg->GetValue());
372       //check class name
373       if(className.size() > 0)
374         {
375           if(!this->library->CreateClass(className))
376             wxMessageBox(crea::std2wx("Something has gone wrong with the creation of the class."),_T("New Class - Error!"),wxOK | wxICON_ERROR);
377
378           ((wxCDMMainFrame*)this->GetParent())->RefreshProject();
379
380           wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
381           newEvent->SetId(0);
382           newEvent->SetClientData(this->library);
383           wxPostEvent(this->GetParent(), *newEvent);
384
385           wxMessageBox(crea::std2wx("The class has been created successfully."),_T("New Class - Success"),wxOK | wxICON_INFORMATION);
386         }
387       else
388         {
389           wxMessageBox(crea::std2wx("The new class name cannot be empty."),_T("New Class - Error!"),wxOK | wxICON_ERROR);
390         }
391     }
392 }
393
394 void wxCDMLibraryDescriptionPanel::OnBtnCreateFolder(wxCommandEvent& event)
395 {
396   //get name
397   wxString folderName = wxGetTextFromUser(
398       wxT("Enter the name of the new folder:"),
399       wxT("Create Folder - creaDevManager")
400   );
401   //check name
402   std::vector<std::string> parts;
403   CDMUtilities::splitter::split(parts, crea::wx2std(folderName), " /\\\"", CDMUtilities::splitter::no_empties);
404   if(parts.size() > 0)
405     {
406       std::string* result;
407       modelCDMFolder* folderC = this->library->CreateFolder(crea::wx2std(folderName), result);
408       if(folderC == NULL)
409         {
410           wxMessageBox(crea::std2wx(*result),_T("Create Folder - Error!"),wxOK | wxICON_ERROR);
411           return;
412         }
413       ((wxCDMMainFrame*)this->GetParent())->RefreshProject();
414       wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
415       newEvent->SetClientData(folderC);
416       wxPostEvent(this->GetParent(), *newEvent);
417       wxMessageBox(crea::std2wx("The folder was successfully created"),_T("Create Folder - Success"),wxOK | wxICON_INFORMATION);
418     }
419   else
420     {
421       wxMessageBox(crea::std2wx("No name specified"),_T("Create Folder - Error!"),wxOK | wxICON_ERROR);
422     }
423 }
424
425 void wxCDMLibraryDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
426 {
427   std::string* result;
428   if(!this->library->OpenCMakeListsFile(result))
429     wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
430
431   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
432
433   if(this->library->GetCMakeLists() != NULL)
434     {
435       newEvent->SetClientData(this->library->GetCMakeLists());
436       newEvent->SetId(0);
437       wxPostEvent(this->GetParent(), *newEvent);
438     }
439
440   event.Skip();
441 }
442
443 void wxCDMLibraryDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
444 {
445   std::string* result;
446   if(!this->library->OpenInFileExplorer(result))
447     wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
448 }
449
450 void wxCDMLibraryDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event)
451 {
452   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED);
453
454   if(this->library->GetCMakeLists() != NULL)
455     {
456       newEvent->SetClientData(this->library->GetCMakeLists());
457       newEvent->SetId(0);
458       wxPostEvent(this->GetParent(), *newEvent);
459     }
460   event.Skip();
461 }
462
463 void wxCDMLibraryDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event)
464 {
465   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
466
467   if(this->library->GetCMakeLists() != NULL)
468     {
469       newEvent->SetClientData(this->library->GetCMakeLists());
470       newEvent->SetId(0);
471       wxPostEvent(this->GetParent(), *newEvent);
472     }
473   event.Skip();
474 }