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