2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------
29 * wxCDMApplicationDescriptionPanel.cpp
31 * Created on: Nov 27, 2012
32 * Author: Daniel Felipe Gonzalez Obando
35 #include "wxCDMApplicationDescriptionPanel.h"
37 #include "CDMUtilities.h"
38 #include "wxCDMMainFrame.h"
40 #include "wxCDMApplicationHelpDialog.h"
42 #include "creaDevManagerIds.h"
43 #include "images/AIcon64.xpm"
45 BEGIN_EVENT_TABLE(wxCDMApplicationDescriptionPanel, wxPanel)
46 EVT_BUTTON(ID_BUTTON_SET_NAME, wxCDMApplicationDescriptionPanel::OnBtnSetExeName)
47 EVT_HYPERLINK(ID_BUTTON_PREV, wxCDMApplicationDescriptionPanel::OnBtnReturn)
48 EVT_BUTTON(ID_BUTTON_CREATE_CLASS, wxCDMApplicationDescriptionPanel::OnBtnCreateClass)
49 EVT_BUTTON(ID_BUTTON_CREATE_FOLDER, wxCDMApplicationDescriptionPanel::OnBtnCreateFolder)
50 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMApplicationDescriptionPanel::OnBtnEditCMakeLists)
51 EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMApplicationDescriptionPanel::OnBtnOpenFolder)
52 EVT_BUTTON(ID_BUTTON_OPEN_CXX, wxCDMApplicationDescriptionPanel::OnBtnOpenMain)
53 EVT_CHECKBOX(ID_CHECK_INCLUDE_3RDLIBRARY, wxCDMApplicationDescriptionPanel::On3rdLibraryChBChange)
54 EVT_CHECKBOX(ID_CHECK_INCLUDE_LIBRARY, wxCDMApplicationDescriptionPanel::OnLibraryChBChange)
57 wxCDMApplicationDescriptionPanel::wxCDMApplicationDescriptionPanel(
59 modelCDMApplication* application,
61 const wxString& caption,
67 wxCDMApplicationDescriptionPanel::Create(parent, application, id, caption, pos, size, style);
70 wxCDMApplicationDescriptionPanel::~wxCDMApplicationDescriptionPanel()
74 bool wxCDMApplicationDescriptionPanel::Create(
76 modelCDMApplication* application,
78 const wxString& caption,
84 wxPanel::Create(parent, id, pos, size, style);
85 this->application = application;
87 // this part makes the scrollbars show up
88 this->FitInside(); // ask the sizer about the needed size
89 this->SetScrollRate(5, 5);
93 void wxCDMApplicationDescriptionPanel::CreateControls()
95 wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
98 wxBoxSizer *linksSizer = new wxBoxSizer(wxHORIZONTAL);
99 std::vector<modelCDMIProjectTreeNode*> parents = this->application->GetParents();
100 for (int i = 0; i < (int)(parents.size()); i++)
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);
108 linksSizer->Add(new wxStaticText(this, wxID_ANY, crea::std2wx(this->application->GetName())), 0, wxALIGN_CENTER, 0);
109 sizer->Add(linksSizer, 0, wxALIGN_CENTER | wxALL, 5);
112 wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
115 headerSizer->Add(new wxStaticBitmap(this, -1, wxBitmap(AIcon64)),0, wxALIGN_CENTER, 0);
116 wxBoxSizer* textSizer = new wxBoxSizer(wxVERTICAL);
118 textSizer->Add(new wxStaticText(this, -1, _("Application")),0, wxALIGN_LEFT, 0);
120 textSizer->Add(new wxStaticText(this, -1, crea::std2wx(this->application->GetName())),0, wxALIGN_LEFT, 0);
121 headerSizer->Add(textSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
123 sizer->Add(headerSizer, 0, wxALIGN_CENTER);
126 wxStaticBoxSizer* propertiesBox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Properties"));
127 wxPanel* propertiesPanel = new wxPanel(this);
128 wxBoxSizer* propertiesPanelSizer = new wxBoxSizer(wxVERTICAL);
130 wxFlexGridSizer* propertiesGridSizer = new wxFlexGridSizer(4, 2, 9, 15);
132 wxStaticText *pMainFile = new wxStaticText(propertiesPanel, -1, wxT("Executable Name"));
133 wxBoxSizer* pMainFilesz = new wxBoxSizer(wxHORIZONTAL);
134 this->executableNametc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(this->application->GetExecutableName()));
135 wxButton* pMainFilebt = new wxButton(propertiesPanel, ID_BUTTON_SET_NAME, wxT("Set"));
136 pMainFilebt->SetToolTip(wxT("Set the name of the executable file for the application."));
137 pMainFilesz->Add(this->executableNametc, 0, wxALIGN_CENTER_VERTICAL, 0);
138 pMainFilesz->Add(pMainFilebt, 0, wxALIGN_CENTER | wxLEFT, 10);
140 propertiesGridSizer->Add(pMainFile, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
141 propertiesGridSizer->Add(pMainFilesz, 1, wxEXPAND);
143 propertiesGridSizer->AddGrowableCol(1,1);
145 propertiesPanelSizer->Add(propertiesGridSizer, 0, wxEXPAND);
146 propertiesPanel->SetSizer(propertiesPanelSizer);
147 propertiesPanelSizer->Fit(propertiesPanel);
148 propertiesBox->Add(propertiesPanel, 0, wxEXPAND);
149 sizer->Add(propertiesBox, 0, wxEXPAND | wxALL, 10);
153 wxStaticBoxSizer* includesBox = new wxStaticBoxSizer(wxHORIZONTAL, this, wxT("&Used Libraries"));
154 includesBox->SetMinSize(250,250);
155 wxScrolledWindow* includesPanel = new wxScrolledWindow(this);
156 wxBoxSizer* includesPanelSizer = new wxBoxSizer(wxVERTICAL);
158 //Third Party Libraries
159 wxStaticText* Title1 = new wxStaticText(includesPanel, wxID_ANY, wxT("Third Party Libraries:"));
160 wxFont font = Title1->GetFont();
161 font.SetWeight(wxFONTWEIGHT_BOLD);
162 Title1->SetFont(font);
163 includesPanelSizer->Add(Title1, 0, wxEXPAND);
166 std::map<std::string, bool> inclusions = this->application->Get3rdPartyLibraries();
168 wxFlexGridSizer* includesGridSizer = new wxFlexGridSizer(inclusions.size()+1, 2, 0, 5);
170 wxStaticText* ChBTitle = new wxStaticText(
178 wxStaticText* LNmTitle = new wxStaticText(
187 includesGridSizer->Add(ChBTitle, 1, wxEXPAND);
188 includesGridSizer->Add(LNmTitle, 1, wxEXPAND);
190 for (std::map<std::string, bool>::iterator it = inclusions.begin(); it != inclusions.end(); ++it) {
191 wxCheckBox* ChBIncl = new wxCheckBox(
192 includesPanel, ID_CHECK_INCLUDE_3RDLIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
194 ChBIncl->SetToolTip(crea::std2wx("When this box is checked the " + it->first + " library is included in the project configuration for this application."));
195 ChBIncl->SetName(crea::std2wx(it->first));
196 ChBIncl->SetValue(it->second);
197 includesGridSizer->Add(ChBIncl, 1, wxEXPAND);
199 wxStaticText* LNmIncl = new wxStaticText(includesPanel, wxID_ANY, crea::std2wx(it->first));
200 includesGridSizer->Add(LNmIncl, 1, wxEXPAND);
203 includesGridSizer->AddGrowableCol(1,1);
205 includesPanelSizer->Add(includesGridSizer, 0, wxEXPAND | wxLEFT, 5);
208 wxStaticText* Title2 = new wxStaticText(includesPanel, wxID_ANY, wxT("Custom Libraries:"));
209 font = Title2->GetFont();
210 font.SetWeight(wxFONTWEIGHT_BOLD);
211 Title2->SetFont(font);
212 includesPanelSizer->Add(Title2, 0, wxEXPAND);
215 std::map<std::string, bool> inclusionsLibs = this->application->GetCustomLibraries();
217 wxFlexGridSizer* includesLibGridSizer = new wxFlexGridSizer(inclusionsLibs.size()+1, 2, 0, 5);
219 wxStaticText* ChBTitle1 = new wxStaticText(
227 wxStaticText* LNmTitle1 = new wxStaticText(
236 includesLibGridSizer->Add(ChBTitle1, 1, wxEXPAND);
237 includesLibGridSizer->Add(LNmTitle1, 1, wxEXPAND);
239 for (std::map<std::string, bool>::iterator it = inclusionsLibs.begin(); it != inclusionsLibs.end(); ++it) {
240 wxCheckBox* ChBIncl = new wxCheckBox(
241 includesPanel, ID_CHECK_INCLUDE_LIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
243 ChBIncl->SetToolTip(crea::std2wx("When this box is checked the " + it->first + " custom library is included in the project configuration for this application."));
244 ChBIncl->SetName(crea::std2wx(it->first));
245 ChBIncl->SetValue(it->second);
246 includesLibGridSizer->Add(ChBIncl, 1, wxEXPAND);
248 wxStaticText* LNmIncl = new wxStaticText(includesPanel, wxID_ANY, crea::std2wx(it->first));
249 includesLibGridSizer->Add(LNmIncl, 1, wxEXPAND);
252 includesLibGridSizer->AddGrowableCol(1,1);
254 includesPanelSizer->Add(includesLibGridSizer, 0, wxEXPAND | wxLEFT, 5);
256 includesPanel->SetSizer(includesPanelSizer);
257 includesPanelSizer->Fit(includesPanel);
259 includesPanel->FitInside();
260 includesPanel->SetScrollRate(5,5);
262 includesBox->Add(includesPanel, 1, wxEXPAND);
263 sizer -> Add(includesBox, 0, wxALL | wxEXPAND, 10);
267 //actions StaticBoxSizer
268 wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Actions"));
269 actionsBox->GetStaticBox()->SetToolTip(wxT("Create classes or edit them for this application, as well as editing the application's CMakeLists.txt file by selecting the desired action."));
271 wxPanel* actionsPanel = new wxPanel(this);
273 wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL);
275 wxFlexGridSizer* actionsGridSizer = new wxFlexGridSizer(3, 2, 9, 15);
277 wxButton* createClassbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_CLASS, _T("Create Class"));
278 createClassbt->SetToolTip(wxT("Create a new Class (.h and .cxx files)."));
279 wxButton* createFolderbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_FOLDER, _T("Create Folder"));
280 createFolderbt->SetToolTip(wxT("Create a new Folder inside the application folder."));
281 wxButton* openMainbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_CXX, _T("A. Open Main File"));
282 openMainbt->SetToolTip(wxT("Open the main file in the application folder with the default code editor."));
283 openMainbt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMApplicationDescriptionPanel::OnMainMouseEnter,NULL,this);
284 openMainbt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMApplicationDescriptionPanel::OnMainMouseExit,NULL,this);
285 wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
286 editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt file inside this application."));
287 editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMApplicationDescriptionPanel::OnCMakeMouseEnter,NULL,this);
288 editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMApplicationDescriptionPanel::OnCMakeMouseExit,NULL,this);
289 wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Application Folder"));
290 openFolderbt->SetToolTip(wxT("Open the application folder in the file explorer."));
293 actionsGridSizer->Add(openMainbt, 1, wxALL | wxEXPAND, 5);
294 actionsGridSizer->Add(openFolderbt, 1, wxALL | wxEXPAND, 5);
295 actionsGridSizer->Add(editCMakebt, 1, wxALL | wxEXPAND, 5);
296 actionsGridSizer->Add(createClassbt, 1, wxALL | wxEXPAND, 5);
297 actionsGridSizer->Add(createFolderbt, 1, wxALL | wxEXPAND, 5);
299 //SetPanel sizer and box
300 actionsGridSizer->AddGrowableCol(0,1);
301 actionsGridSizer->AddGrowableCol(1,1);
303 actionsPanelSizer->Add(actionsGridSizer, 1, wxEXPAND, 0);
304 actionsPanel->SetSizer(actionsPanelSizer);
305 actionsPanelSizer->Fit(actionsPanel);
306 actionsBox->Add(actionsPanel, 1, wxALL | wxEXPAND, 5);
307 sizer->Add(actionsBox, 0, wxEXPAND | wxALL, 10);
311 sizer->SetSizeHints(this);
313 if (((wxCDMMainFrame*)this->GetParent())->isHelp())
315 wxCDMApplicationHelpDialog* helpDialog = new wxCDMApplicationHelpDialog(this->GetParent(), this->application, wxID_ANY);
316 helpDialog->Show(true);
320 void wxCDMApplicationDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
322 std::vector<modelCDMIProjectTreeNode*> parents = this->application->GetParents();
323 std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
324 //std::cout << parentURL << std::endl;
325 for (int i = 0; i < (int)(parents.size()); i++)
327 if (parents[i]->GetPath() == parentURL)
329 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
330 newEvent->SetClientData(parents[i]);
332 wxPostEvent(this->GetParent(), *newEvent);
338 void wxCDMApplicationDescriptionPanel::OnBtnSetExeName(wxCommandEvent& event)
341 wxString versionWx = wxGetTextFromUser(
342 wxT("Enter the new executable name"),
343 wxT("Change Application Executable Name - creaDevManager"),
344 crea::std2wx(this->application->GetExecutableName())
347 std::vector<std::string> parts;
348 CDMUtilities::splitter::split(parts, crea::wx2std(versionWx), " .", CDMUtilities::splitter::no_empties);
352 if(!this->application->SetExecutableName(crea::wx2std(versionWx), result))
353 wxMessageBox(crea::std2wx(*result),_T("Change Application Executable Name - Error!"),wxOK | wxICON_ERROR);
357 wxMessageBox(crea::std2wx("No name specified"),_T("Set Application Executable Name - Error!"),wxOK | wxICON_ERROR);
359 this->executableNametc->SetLabel(crea::std2wx(this->application->GetExecutableName()));
362 void wxCDMApplicationDescriptionPanel::On3rdLibraryChBChange(wxCommandEvent& event)
364 if(this->application->Set3rdPartyLibrary(crea::wx2std(((wxCheckBox*)event.GetEventObject())->GetName()), ((wxCheckBox*)event.GetEventObject())->GetValue()))
365 ((wxCheckBox*)event.GetEventObject())->SetValue(((wxCheckBox*)event.GetEventObject())->GetValue());
367 ((wxCheckBox*)event.GetEventObject())->SetValue(!((wxCheckBox*)event.GetEventObject())->GetValue());
370 void wxCDMApplicationDescriptionPanel::OnLibraryChBChange(wxCommandEvent& event)
372 if(this->application->SetCustomLibrary(crea::wx2std(((wxCheckBox*)event.GetEventObject())->GetName()), ((wxCheckBox*)event.GetEventObject())->GetValue()))
373 ((wxCheckBox*)event.GetEventObject())->SetValue(((wxCheckBox*)event.GetEventObject())->GetValue());
375 ((wxCheckBox*)event.GetEventObject())->SetValue(!((wxCheckBox*)event.GetEventObject())->GetValue());
378 void wxCDMApplicationDescriptionPanel::OnBtnCreateClass(wxCommandEvent& event)
380 //get class name from user
381 wxTextEntryDialog* newClassDlg = new wxTextEntryDialog(
383 wxT("Please enter the new class name."),
384 wxT("New Class - creaDevManager"),
389 if (newClassDlg->ShowModal() == wxID_OK)
391 std::string className = crea::wx2std(newClassDlg->GetValue());
393 if(className.size() > 0)
395 if(!this->application->CreateClass(className))
396 wxMessageBox(crea::std2wx("Something has gone wrong with the creation of the class."),_T("New Class - Error!"),wxOK | wxICON_ERROR);
398 ((wxCDMMainFrame*)this->GetParent())->RefreshProject();
400 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
402 newEvent->SetClientData(this->application);
403 wxPostEvent(this->GetParent(), *newEvent);
405 wxMessageBox(crea::std2wx("The class has been created successfully."),_T("New Class - Success"),wxOK | wxICON_INFORMATION);
409 wxMessageBox(crea::std2wx("The new class name cannot be empty."),_T("New Class - Error!"),wxOK | wxICON_ERROR);
414 void wxCDMApplicationDescriptionPanel::OnBtnCreateFolder(wxCommandEvent& event)
417 wxString folderName = wxGetTextFromUser(
418 wxT("Enter the name of the new folder:"),
419 wxT("Create Folder - creaDevManager")
422 std::vector<std::string> parts;
423 CDMUtilities::splitter::split(parts, crea::wx2std(folderName), " /\\\"", CDMUtilities::splitter::no_empties);
427 modelCDMFolder* folderC = this->application->CreateFolder(crea::wx2std(folderName), result);
430 wxMessageBox(crea::std2wx(*result),_T("Create Folder - Error!"),wxOK | wxICON_ERROR);
433 ((wxCDMMainFrame*)this->GetParent())->RefreshProject();
434 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
435 newEvent->SetClientData(folderC);
436 wxPostEvent(this->GetParent(), *newEvent);
437 wxMessageBox(crea::std2wx("The folder was successfully created"),_T("Create Folder - Success"),wxOK | wxICON_INFORMATION);
441 wxMessageBox(crea::std2wx("No name specified"),_T("Create Folder - Error!"),wxOK | wxICON_ERROR);
445 void wxCDMApplicationDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
448 if(!this->application->OpenCMakeListsFile(result))
449 wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
451 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
453 if(this->application->GetCMakeLists() != NULL)
455 newEvent->SetClientData(this->application->GetCMakeLists());
457 wxPostEvent(this->GetParent(), *newEvent);
463 void wxCDMApplicationDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
466 if(!this->application->OpenInFileExplorer(result))
467 wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
470 void wxCDMApplicationDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event)
472 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED);
474 if(this->application->GetCMakeLists() != NULL)
476 newEvent->SetClientData(this->application->GetCMakeLists());
478 wxPostEvent(this->GetParent(), *newEvent);
483 void wxCDMApplicationDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event)
485 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
487 if(this->application->GetCMakeLists() != NULL)
489 newEvent->SetClientData(this->application->GetCMakeLists());
491 wxPostEvent(this->GetParent(), *newEvent);
496 void wxCDMApplicationDescriptionPanel::OnBtnOpenMain(wxCommandEvent& event)
498 if (this->application->GetMainFile() != NULL)
500 if (CDMUtilities::openTextEditor(this->application->GetMainFile()->GetPath()))
502 wxMessageBox(crea::std2wx("The main file couldn't be opened."),_T("Open Main File - Error!"),wxOK | wxICON_ERROR);
505 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
507 newEvent->SetClientData(this->application->GetMainFile());
509 wxPostEvent(this->GetParent(), *newEvent);
515 wxMessageBox(crea::std2wx("There is no main file or it couldn't be detected."),_T("Open Main File - Error!"),wxOK | wxICON_ERROR);
519 void wxCDMApplicationDescriptionPanel::OnMainMouseEnter(wxMouseEvent& event)
521 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED);
523 if(this->application->GetMainFile() != NULL)
525 newEvent->SetClientData(this->application->GetMainFile());
527 wxPostEvent(this->GetParent(), *newEvent);
532 void wxCDMApplicationDescriptionPanel::OnMainMouseExit(wxMouseEvent& event)
534 wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
536 if(this->application->GetMainFile() != NULL)
538 newEvent->SetClientData(this->application->GetMainFile());
540 wxPostEvent(this->GetParent(), *newEvent);