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 #include "wxCDMMainFrame.h"
34 #include "wx/treectrl.h"
35 #include "wx/treebase.h"
36 #include "wx/tooltip.h"
37 #include "CDMUtilities.h"
39 #include "creaDevManagerIds.h"
40 #include "wxCDMMainDescriptionPanel.h"
41 #include "wxCDMProjectDescriptionPanel.h"
42 #include "wxCDMAppliDescriptionPanel.h"
43 #include "wxCDMApplicationDescriptionPanel.h"
44 #include "wxCDMLibDescriptionPanel.h"
45 #include "wxCDMLibraryDescriptionPanel.h"
46 #include "wxCDMPackageDescriptionPanel.h"
47 #include "wxCDMBlackBoxDescriptionPanel.h"
48 #include "wxCDMCMakeListsDescriptionPanel.h"
49 #include "wxCDMFolderDescriptionPanel.h"
50 #include "wxCDMFileDescriptionPanel.h"
51 #include "wxCDMPackageManagerPanel.h"
53 #include "wxCDMProjectActionsPanel.h"
54 #include "wxCDMNewProjectDialog.h"
57 BEGIN_EVENT_TABLE(wxCDMMainFrame, wxFrame)
58 EVT_MENU(ID_MENU_NEW_PROJECT, wxCDMMainFrame::OnMenuNewProject)
59 EVT_MENU(ID_MENU_OPEN_PROJECT, wxCDMMainFrame::OnMenuOpenProject)
60 EVT_MENU(ID_MENU_OPEN_RECENT, wxCDMMainFrame::OnMenuOpenRecent)
61 EVT_MENU(ID_MENU_CLOSE_PROJECT, wxCDMMainFrame::OnMenuCloseProject)
62 EVT_MENU(ID_MENU_CLOSE_ALL_PROJECTS, wxCDMMainFrame::OnMenuCloseAllProjects)
63 EVT_MENU(ID_MENU_EXPORT_HIERARCHY, wxCDMMainFrame::OnMenuExportHierarchy)
64 EVT_MENU(ID_MENU_EXIT, wxCDMMainFrame::OnMenuExit)
65 EVT_MENU(ID_MENU_REFRESH_PROJECT, wxCDMMainFrame::OnMenuRefreshProject)
66 EVT_MENU(ID_MENU_CUT, wxCDMMainFrame::OnMenuMenuCut)
67 EVT_MENU(ID_MENU_COPY, wxCDMMainFrame::OnMenuMenuCopy)
68 EVT_MENU(ID_MENU_PASTE, wxCDMMainFrame::OnMenuMenuPaste)
69 EVT_MENU(ID_MENU_DELETE, wxCDMMainFrame::OnMenuMenuDelete)
70 EVT_MENU(ID_MENU_SELECT_ALL, wxCDMMainFrame::OnMenuSelectAll)
71 EVT_MENU(ID_MENU_SELECT_NONE, wxCDMMainFrame::OnMenuSelectNone)
72 EVT_MENU(ID_MENU_EVENT_LOG, wxCDMMainFrame::OnMenuEventLog)
73 EVT_MENU(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxCDMMainFrame::OnMenuBBTKGraphicalEditor)
74 EVT_MENU(ID_MENU_MINITOOLS, wxCDMMainFrame::OnMenuMiniTools)
75 EVT_MENU(ID_MENU_CODE_EDITOR, wxCDMMainFrame::OnMenuCodeEditor)
76 EVT_MENU(ID_MENU_COMMAND_LINE, wxCDMMainFrame::OnMenuCommandLine)
77 EVT_MENU(ID_MENU_HELP, wxCDMMainFrame::OnMenuHelp)
78 EVT_MENU(ID_MENU_REPORT_BUG, wxCDMMainFrame::OnMenuReportBug)
79 EVT_MENU(ID_MENU_ABOUT_CREADEVMANAGER, wxCDMMainFrame::OnMenuAboutCreaDevManager)
80 EVT_MENU(ID_MENU_ABOUT_CREATIS, wxCDMMainFrame::OnMenuAboutCreatis)
81 EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCDMMainFrame::OnMenuNewProject)
82 EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMMainFrame::OnMenuOpenProject)
83 EVT_TREE_SEL_CHANGING(ID_TREE_PROJECTS, wxCDMMainFrame::OnTreeSelectionChanged)
84 EVT_COMMAND(wxID_ANY, wxEVT_DISPLAY_CHANGED, wxCDMMainFrame::OnCreationComplete)
87 wxCDMMainFrame::wxCDMMainFrame(
90 const wxString& caption,
96 Create(parent, id, caption, pos, size, style);
99 wxCDMMainFrame::~wxCDMMainFrame()
104 bool wxCDMMainFrame::Create(
107 const wxString& caption,
113 wxFrame::Create(parent, id, caption, pos, size, style);
114 this->model = new modelCDMMain();
120 modelCDMMain* wxCDMMainFrame::GetModel() const
125 void wxCDMMainFrame::RefreshProject()
128 std::cout << "refreshing project" << std::endl;
129 this->model->RefreshProject(result);
130 std::cout << "rebuilding project tree" << std::endl;
131 this->tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
134 void wxCDMMainFrame::CreateMenus()
136 wxMenuBar* menuBar = new wxMenuBar;
139 menu_File = new wxMenu();
140 menu_File->Append(ID_MENU_NEW_PROJECT, wxT("&New Project..."));
141 menu_File->Append(ID_MENU_OPEN_PROJECT, wxT("&Open Project..."));
142 menu_File->Append(ID_MENU_OPEN_RECENT, wxT("Open &Recent"));
143 menu_File->AppendSeparator();
144 menu_File->Append(ID_MENU_CLOSE_PROJECT, wxT("&Close Project"));
145 menu_File->Append(ID_MENU_CLOSE_ALL_PROJECTS, wxT("C&lose All Projects"));
146 menu_File->AppendSeparator();
147 menu_File->Append(ID_MENU_EXPORT_HIERARCHY, wxT("&Export Project Hierarchy..."));
148 menu_File->AppendSeparator();
149 menu_File->Append(ID_MENU_EXIT, wxT("E&xit"));
151 menuBar->Append(menu_File, wxT("&File"));
154 menu_Edit = new wxMenu();
155 menu_Edit->Append(ID_MENU_REFRESH_PROJECT, wxT("&Refresh Project"));
156 menu_Edit->AppendSeparator();
157 menu_Edit->Append(ID_MENU_CUT, wxT("Cu&t"));
158 menu_Edit->Append(ID_MENU_COPY, wxT("&Copy"));
159 menu_Edit->Append(ID_MENU_PASTE, wxT("&Paste"));
160 menu_Edit->AppendSeparator();
161 menu_Edit->Append(ID_MENU_DELETE, wxT("&Delete"));
162 menu_Edit->Append(ID_MENU_SELECT_ALL, wxT("Select &All"));
163 menu_Edit->Append(ID_MENU_SELECT_NONE, wxT("Ca&ncel Selection"));
165 menuBar->Append(menu_Edit, wxT("&Edit"));
168 menu_Tools = new wxMenu();
169 menu_Tools->Append(ID_MENU_EVENT_LOG, wxT("Event &Log"));
170 menu_Tools->Append(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxT("BBTK &Graphical Editor"));
171 menu_Tools->Append(ID_MENU_MINITOOLS, wxT("&MiniTools"));
172 menu_Tools->Append(ID_MENU_CODE_EDITOR, wxT("&Code Editor"));
173 menu_Tools->Append(ID_MENU_COMMAND_LINE, wxT("&Command Line"));
175 menuBar->Append(menu_Tools, wxT("&Tools"));
178 menu_Help = new wxMenu();
179 menu_Help->Append(ID_MENU_HELP, wxT("&Help"));
180 menu_Help->Append(ID_MENU_REPORT_BUG, wxT("Report &Bug"));
181 menu_Help->Append(ID_MENU_ABOUT_CREADEVMANAGER, wxT("&About CreaDevManager"));
182 menu_Help->Append(ID_MENU_ABOUT_CREATIS, wxT("A&bout CREATIS"));
184 menuBar->Append(menu_Help, wxT("&Help"));
189 wxStatusBar* statusBar = new wxStatusBar(this, ID_STATUS_BAR, wxST_SIZEGRIP);
190 statusBar->SetFieldsCount(1);
191 SetStatusBar(statusBar);
195 void wxCDMMainFrame::CreateControls()
198 auiManager.SetManagedWindow(this);
201 tree_Projects = new wxCDMProjectsTreeCtrl(
206 wxTR_HAS_BUTTONS | wxTR_AQUA_BUTTONS
209 panel_Properties = new wxCDMMainDescriptionPanel(
211 ID_WINDOW_PROPERTIES,
212 wxT("Description Panel"),
224 auiManager.AddPane(panel_Properties, wxAuiPaneInfo().BestSize(600,400).CenterPane().Name(wxT("panel_Properties")).Caption(wxT("")).CloseButton(false));
225 auiManager.AddPane(tree_Projects, wxAuiPaneInfo().Left().MinSize(300,300).BestSize(300,400).CloseButton(false).Name(wxT("tree_Projects")).Caption(wxT("Project Tree")).CloseButton(false));
227 wxString pers = auiManager.SavePerspective();
230 auiManager.LoadPerspective(pers,true);
231 wxToolTip::Enable(true);
232 wxToolTip::SetDelay(0);
237 void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event)
241 wxCDMNewProjectDialog* dialog = new wxCDMNewProjectDialog(this);
243 userResponse = dialog->ShowModal();
245 if(userResponse == wxID_FORWARD)
248 if(this->model->GetProject() != NULL)
250 if(!this->model->CloseProject(result))
252 std::cout << "error closing project: " << *result << std::endl;
253 wxMessageBox(crea::std2wx(*result),_T("New Project - Error!"),wxOK | wxICON_ERROR);
259 if(!this->model->CreateProject(
260 crea::wx2std(dialog->GetProjectName()),
261 crea::wx2std(dialog->GetProjectLocation()),
263 crea::wx2std(dialog->GetPackageAuthor()),
264 crea::wx2std(dialog->GetPackageDescription())
267 std::cout << "error opening project: " << *result << std::endl;
268 wxMessageBox(crea::std2wx(*result),_T("New Project - Error!"),wxOK | wxICON_ERROR);
273 //populate tree control
274 tree_Projects->BuildTree(this->model->GetModelElements(),this->model->GetProject());
275 tree_Projects->SelectItem(this->model->GetProject()->GetId());
277 //change description panel
278 if(this->panel_Properties != NULL)
280 auiManager.DetachPane(this->panel_Properties);
281 this->panel_Properties->Destroy();
282 this->panel_Properties = NULL;
285 this->panel_Properties = new wxCDMProjectDescriptionPanel(
287 this->model->GetProject(),
288 ID_WINDOW_PROPERTIES,
289 wxT("Description Panel"),
293 //show projectactions panel
294 if(this->panel_ProjectActions != NULL)
296 auiManager.DetachPane(this->panel_Properties);
297 this->panel_ProjectActions->Destroy();
298 this->panel_ProjectActions = NULL;
301 panel_ProjectActions = new wxCDMProjectActionsPanel(
303 ID_WINDOW_PROJ_ACTIONS,
304 wxT("Project Actions Panel"),
309 panel_ProjectActions->SetMinSize(wxSize(500, 100));
312 auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
313 auiManager.AddPane(panel_ProjectActions, wxAuiPaneInfo().Bottom().MinSize(800,50).Name(wxT("panel_ProjectActions")).Caption(wxT("General Project Actions")).BestSize(800,70).CloseButton(false));
317 wxMessageBox(_T("New Project created!"),_T("New Project - Success!"), wxOK | wxICON_INFORMATION);
322 void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event)
326 long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
327 wxDirDialog* FD = new wxDirDialog(this, wxT("Select the project directory"), wxT(""), style);
328 long userResponse = FD->ShowModal();
329 if(userResponse == wxID_OK)
331 std::string path = crea::wx2std (FD->GetPath());
335 std::cout << "Selection to open: " << path << std::endl;
339 if(this->model->GetProject() != NULL)
341 std::cout << "Project not null, closing it" << std::endl;
342 if(!this->model->CloseProject(result))
344 std::cout << "error closing project: " << *result << std::endl;
345 wxMessageBox(crea::std2wx(result->c_str()),_T("New Project - Error!"),wxOK | wxICON_ERROR);
351 if (!this->model->OpenProject(path, result))
353 std::cout << "error opening project: " << *result << std::endl;
354 wxMessageBox( crea::std2wx(result->c_str()), wxT("Open Project - Error"), wxICON_ERROR);
359 std::cout << "building ui" << std::endl;
362 //populate tree control
363 tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
364 tree_Projects->SelectItem(this->model->GetProject()->GetId());
366 //change description panel
367 if(this->panel_Properties != NULL)
369 auiManager.DetachPane(this->panel_Properties);
370 this->panel_Properties->Destroy();
371 this->panel_Properties = NULL;
374 this->panel_Properties = new wxCDMProjectDescriptionPanel(
376 this->model->GetProject(),
377 ID_WINDOW_PROPERTIES,
378 wxT("Description Panel"),
384 //change project's actions panel
385 if(this->panel_ProjectActions!= NULL)
387 auiManager.DetachPane(this->panel_ProjectActions);
388 this->panel_ProjectActions->Destroy();
389 this->panel_ProjectActions = NULL;
391 panel_ProjectActions = new wxCDMProjectActionsPanel(
393 ID_WINDOW_PROJ_ACTIONS,
394 wxT("Project Actions Panel"),
399 panel_ProjectActions->SetMinSize(wxSize(500, 100));
402 auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
403 auiManager.AddPane(panel_ProjectActions, wxAuiPaneInfo().Bottom().MinSize(800,50).Name(wxT("panel_ProjectActions")).Caption(wxT("General Project Actions")).BestSize(800,70).CloseButton(false));
410 void wxCDMMainFrame::OnMenuOpenRecent(wxCommandEvent& event)
412 std::cerr << "Event OnMenuOpenRecent not implemented" << std::endl;
415 void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event)
417 std::cout << "closing project" << std::endl;
419 if(!this->model->CloseProject(result))
421 std::cout << "error closing project: " << *result << std::endl;
422 wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
425 tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
427 if(this->panel_Properties != NULL)
429 auiManager.DetachPane(this->panel_Properties);
430 this->panel_Properties->Destroy();
431 this->panel_Properties = NULL;
433 if(this->panel_ProjectActions != NULL)
435 auiManager.DetachPane(this->panel_ProjectActions);
436 this->panel_ProjectActions->Destroy();
437 this->panel_ProjectActions = NULL;
440 this->panel_Properties = new wxCDMMainDescriptionPanel(
442 ID_WINDOW_PROPERTIES,
443 wxT("Description Panel"),
449 auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
454 void wxCDMMainFrame::OnMenuCloseAllProjects(wxCommandEvent& event)
456 std::cerr << "Event OnMenuCloseAllProjects closing only one project" << std::endl;
458 if(!this->model->CloseProject(result))
460 std::cout << "error closing project: " << *result << std::endl;
461 wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
463 tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
465 if(this->panel_Properties != NULL)
467 auiManager.DetachPane(this->panel_Properties);
468 this->panel_Properties->Destroy();
469 this->panel_Properties = NULL;
471 if(this->panel_ProjectActions != NULL)
473 auiManager.DetachPane(this->panel_ProjectActions);
474 this->panel_ProjectActions->Destroy();
475 this->panel_ProjectActions = NULL;
478 this->panel_Properties = new wxCDMMainDescriptionPanel(
480 ID_WINDOW_PROPERTIES,
481 wxT("Description Panel"),
487 auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400));
492 void wxCDMMainFrame::OnMenuExportHierarchy(wxCommandEvent& event)
494 std::cerr << "Event OnMenuExportHierarchy not implemented" << std::endl;
497 void wxCDMMainFrame::OnMenuExit(wxCommandEvent& event)
499 std::cout << "Closing CreaDevManager..." << std::endl;
501 if(this->model->GetProject() != NULL && !this->model->CloseProject(result))
503 std::cout << "error closing project: " << *result << std::endl;
504 wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
506 tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
508 if(this->panel_Properties != NULL)
510 auiManager.DetachPane(this->panel_Properties);
511 this->panel_Properties->Destroy();
512 this->panel_Properties = NULL;
515 if(this->panel_ProjectActions != NULL)
517 auiManager.DetachPane(this->panel_ProjectActions);
518 this->panel_ProjectActions->Destroy();
519 this->panel_ProjectActions = NULL;
527 void wxCDMMainFrame::OnMenuRefreshProject(wxCommandEvent& event)
530 if(!model->RefreshProject(result))
532 wxMessageBox( crea::std2wx(result->c_str()), wxT("Refresh Project - Error"), wxICON_ERROR);
534 this->tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
535 this->auiManager.Update();
536 //TODO: Show possible problems in CMakeLists files
539 void wxCDMMainFrame::OnMenuMenuCut(wxCommandEvent& event)
541 std::cerr << "Event OnMenuMenuCut not implemented" << std::endl;
544 void wxCDMMainFrame::OnMenuMenuCopy(wxCommandEvent& event)
546 std::cerr << "Event OnMenuMenuCopy not implemented" << std::endl;
549 void wxCDMMainFrame::OnMenuMenuPaste(wxCommandEvent& event)
551 std::cerr << "Event OnMenuMenuPaste not implemented" << std::endl;
554 void wxCDMMainFrame::OnMenuMenuDelete(wxCommandEvent& event)
556 std::cerr << "Event OnMenuMenuDelete not implemented" << std::endl;
559 void wxCDMMainFrame::OnMenuSelectAll(wxCommandEvent& event)
561 std::cerr << "Event OnMenuSelectAll not implemented" << std::endl;
564 void wxCDMMainFrame::OnMenuSelectNone(wxCommandEvent& event)
566 std::cerr << "Event OnMenuSelectNone not implemented" << std::endl;
571 void wxCDMMainFrame::OnMenuEventLog(wxCommandEvent& event)
573 std::cerr << "Event OnMenuEventLog not implemented" << std::endl;
576 void wxCDMMainFrame::OnMenuBBTKGraphicalEditor(wxCommandEvent& event)
578 std::cerr << "Event OnMenuBBTKGraphicalEditor not implemented" << std::endl;
581 void wxCDMMainFrame::OnMenuMiniTools(wxCommandEvent& event)
583 std::cerr << "Event OnMenuMiniTools not implemented" << std::endl;
586 void wxCDMMainFrame::OnMenuCodeEditor(wxCommandEvent& event)
588 std::cerr << "Event OnMenuCodeEditor not implemented" << std::endl;
591 void wxCDMMainFrame::OnMenuCommandLine(wxCommandEvent& event)
593 std::cerr << "Event OnMenuCommandLine not implemented" << std::endl;
598 void wxCDMMainFrame::OnMenuHelp(wxCommandEvent& event)
600 std::cerr << "Event OnMenuHelp not implemented" << std::endl;
603 void wxCDMMainFrame::OnMenuReportBug(wxCommandEvent& event)
605 std::cerr << "Event OnMenuReportBug not implemented" << std::endl;
608 void wxCDMMainFrame::OnMenuAboutCreaDevManager(wxCommandEvent& event)
610 std::cerr << "Event OnMenuAboutCreaDevManager not implemented" << std::endl;
613 void wxCDMMainFrame::OnMenuAboutCreatis(wxCommandEvent& event)
615 std::cerr << "Event OnMenuAboutCreatis not implemented" << std::endl;
619 void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
621 //get selected element
622 wxTreeItemId elementId = event.GetItem();
624 //get element from model
625 modelCDMIProjectTreeNode* element = this->model->GetModelElements()[elementId];
626 std::cout << "Tree Selection: " << element->GetName() << std::endl;
628 //TODO get element type
630 modelCDMProject* elementProject = dynamic_cast<modelCDMProject*>(element);
631 wxPanel* description;
632 if(elementProject != NULL)
634 //create element description
635 description = new wxCDMProjectDescriptionPanel(
638 ID_WINDOW_PROPERTIES,
639 wxT("Description Panel"),
649 modelCDMAppli* elementAppli = dynamic_cast<modelCDMAppli*>(element);
650 if(elementAppli != NULL)
652 //create element description
653 description = new wxCDMAppliDescriptionPanel(
656 ID_WINDOW_PROPERTIES,
657 wxT("Description Panel"),
666 modelCDMApplication* elementApplication = dynamic_cast<modelCDMApplication*>(element);
667 if(elementApplication != NULL)
669 //create element description
670 description = new wxCDMApplicationDescriptionPanel(
673 ID_WINDOW_PROPERTIES,
674 wxT("Description Panel"),
683 modelCDMLib* elementLib = dynamic_cast<modelCDMLib*>(element);
684 if(elementLib != NULL)
686 //create element description
687 description = new wxCDMLibDescriptionPanel(
690 ID_WINDOW_PROPERTIES,
691 wxT("Description Panel"),
700 modelCDMLibrary* elementLibrary = dynamic_cast<modelCDMLibrary*>(element);
701 if(elementLibrary != NULL)
703 //create element description
704 description = new wxCDMLibraryDescriptionPanel(
707 ID_WINDOW_PROPERTIES,
708 wxT("Description Panel"),
717 modelCDMPackage* elementPackage = dynamic_cast<modelCDMPackage*>(element);
718 if(elementPackage != NULL)
720 //create element description
721 description = new wxCDMPackageDescriptionPanel(
724 ID_WINDOW_PROPERTIES,
725 wxT("Description Panel"),
734 modelCDMBlackBox* elementBlackBox = dynamic_cast<modelCDMBlackBox*>(element);
735 if(elementBlackBox != NULL)
737 //create element description
738 description = new wxCDMBlackBoxDescriptionPanel(
741 ID_WINDOW_PROPERTIES,
742 wxT("Description Panel"),
751 modelCDMCMakeListsFile* elementCMakeLists = dynamic_cast<modelCDMCMakeListsFile*>(element);
752 if(elementCMakeLists != NULL)
754 //create element description
755 description = new wxCDMCMakeListsDescriptionPanel(
758 ID_WINDOW_PROPERTIES,
759 wxT("Description Panel"),
768 modelCDMFolder* elementFolder = dynamic_cast<modelCDMFolder*>(element);
769 if(elementFolder != NULL)
771 //create element description
772 description = new wxCDMFolderDescriptionPanel(
775 ID_WINDOW_PROPERTIES,
776 wxT("Description Panel"),
785 modelCDMFile* elementFile = dynamic_cast<modelCDMFile*>(element);
786 if(elementFile != NULL)
788 //create element description
789 description = new wxCDMFileDescriptionPanel(
792 ID_WINDOW_PROPERTIES,
793 wxT("Description Panel"),
803 //create element description
804 description = new wxCDMMainDescriptionPanel(
806 ID_WINDOW_PROPERTIES,
807 wxT("Description Panel"),
823 if(this->panel_Properties!= NULL)
824 this->panel_Properties->Hide();
826 auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
830 if(this->panel_Properties!= NULL)
832 auiManager.DetachPane(this->panel_Properties);
833 this->panel_Properties->Destroy();
834 this->panel_Properties = NULL;
838 this->panel_Properties = description;
839 //auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400).CloseButton(false));
846 void wxCDMMainFrame::OnCreationComplete(wxCommandEvent& event)
848 switch(event.GetId() != 0)
851 //select out old one to generate selection event
852 this->tree_Projects->SelectItem(event.GetInt(), true);
855 wxPanel* description = NULL;
856 if(event.GetString() == wxT("manage_packages"))
858 this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), false);
859 description = new wxCDMPackageManagerPanel(
861 this->model->GetProject(),
862 ID_WINDOW_PROPERTIES,
863 wxT("Description Panel"),
869 else if(event.GetString() == wxT("manage_libraries"))
871 this->tree_Projects->SelectItem(this->model->GetProject()->GetLib()->GetId(), true);
874 else if(event.GetString() == wxT("manage_applications"))
876 this->tree_Projects->SelectItem(this->model->GetProject()->GetAppli()->GetId(), true);
880 if(this->panel_Properties!= NULL)
881 this->panel_Properties->Hide();
883 auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
887 if(this->panel_Properties!= NULL)
889 auiManager.DetachPane(this->panel_Properties);
890 this->panel_Properties->Destroy();
891 this->panel_Properties = NULL;
895 this->panel_Properties = description;