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 "CDMUtilities.h"
38 #include "creaDevManagerIds.h"
39 #include "wxCDMMainDescriptionPanel.h"
40 #include "wxCDMProjectDescriptionPanel.h"
41 #include "wxCDMAppliDescriptionPanel.h"
42 #include "wxCDMApplicationDescriptionPanel.h"
43 #include "wxCDMLibDescriptionPanel.h"
44 #include "wxCDMLibraryDescriptionPanel.h"
45 #include "wxCDMPackageDescriptionPanel.h"
46 #include "wxCDMBlackBoxDescriptionPanel.h"
47 #include "wxCDMCMakeListsDescriptionPanel.h"
48 #include "wxCDMFolderDescriptionPanel.h"
49 #include "wxCDMFileDescriptionPanel.h"
50 #include "wxCDMPackageManagerPanel.h"
52 #include "wxCDMProjectActionsPanel.h"
53 #include "wxCDMNewProjectDialog.h"
56 BEGIN_EVENT_TABLE(wxCDMMainFrame, wxFrame)
57 EVT_MENU(ID_MENU_NEW_PROJECT, wxCDMMainFrame::OnMenuNewProject)
58 EVT_MENU(ID_MENU_OPEN_PROJECT, wxCDMMainFrame::OnMenuOpenProject)
59 EVT_MENU(ID_MENU_OPEN_RECENT, wxCDMMainFrame::OnMenuOpenRecent)
60 EVT_MENU(ID_MENU_CLOSE_PROJECT, wxCDMMainFrame::OnMenuCloseProject)
61 EVT_MENU(ID_MENU_CLOSE_ALL_PROJECTS, wxCDMMainFrame::OnMenuCloseAllProjects)
62 EVT_MENU(ID_MENU_EXPORT_HIERARCHY, wxCDMMainFrame::OnMenuExportHierarchy)
63 EVT_MENU(ID_MENU_EXIT, wxCDMMainFrame::OnMenuExit)
64 EVT_MENU(ID_MENU_REFRESH_PROJECT, wxCDMMainFrame::OnMenuRefreshProject)
65 EVT_MENU(ID_MENU_CUT, wxCDMMainFrame::OnMenuMenuCut)
66 EVT_MENU(ID_MENU_COPY, wxCDMMainFrame::OnMenuMenuCopy)
67 EVT_MENU(ID_MENU_PASTE, wxCDMMainFrame::OnMenuMenuPaste)
68 EVT_MENU(ID_MENU_DELETE, wxCDMMainFrame::OnMenuMenuDelete)
69 EVT_MENU(ID_MENU_SELECT_ALL, wxCDMMainFrame::OnMenuSelectAll)
70 EVT_MENU(ID_MENU_SELECT_NONE, wxCDMMainFrame::OnMenuSelectNone)
71 EVT_MENU(ID_MENU_EVENT_LOG, wxCDMMainFrame::OnMenuEventLog)
72 EVT_MENU(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxCDMMainFrame::OnMenuBBTKGraphicalEditor)
73 EVT_MENU(ID_MENU_MINITOOLS, wxCDMMainFrame::OnMenuMiniTools)
74 EVT_MENU(ID_MENU_CODE_EDITOR, wxCDMMainFrame::OnMenuCodeEditor)
75 EVT_MENU(ID_MENU_COMMAND_LINE, wxCDMMainFrame::OnMenuCommandLine)
76 EVT_MENU(ID_MENU_HELP, wxCDMMainFrame::OnMenuHelp)
77 EVT_MENU(ID_MENU_REPORT_BUG, wxCDMMainFrame::OnMenuReportBug)
78 EVT_MENU(ID_MENU_ABOUT_CREADEVMANAGER, wxCDMMainFrame::OnMenuAboutCreaDevManager)
79 EVT_MENU(ID_MENU_ABOUT_CREATIS, wxCDMMainFrame::OnMenuAboutCreatis)
80 EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCDMMainFrame::OnMenuNewProject)
81 EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMMainFrame::OnMenuOpenProject)
82 EVT_TREE_SEL_CHANGING(ID_TREE_PROJECTS, wxCDMMainFrame::OnTreeSelectionChanged)
83 EVT_COMMAND(wxID_ANY, wxEVT_DISPLAY_CHANGED, wxCDMMainFrame::OnCreationComplete)
86 wxCDMMainFrame::wxCDMMainFrame(
89 const wxString& caption,
95 Create(parent, id, caption, pos, size, style);
98 wxCDMMainFrame::~wxCDMMainFrame()
103 bool wxCDMMainFrame::Create(
106 const wxString& caption,
112 wxFrame::Create(parent, id, caption, pos, size, style);
113 this->model = new modelCDMMain();
119 modelCDMMain* wxCDMMainFrame::GetModel() const
124 void wxCDMMainFrame::RefreshProject()
127 std::cout << "refreshing project" << std::endl;
128 this->model->RefreshProject(result);
129 std::cout << "rebuilding project tree" << std::endl;
130 this->tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
133 void wxCDMMainFrame::CreateMenus()
135 wxMenuBar* menuBar = new wxMenuBar;
138 menu_File = new wxMenu();
139 menu_File->Append(ID_MENU_NEW_PROJECT, wxT("&New Project..."));
140 menu_File->Append(ID_MENU_OPEN_PROJECT, wxT("&Open Project..."));
141 menu_File->Append(ID_MENU_OPEN_RECENT, wxT("Open &Recent"));
142 menu_File->AppendSeparator();
143 menu_File->Append(ID_MENU_CLOSE_PROJECT, wxT("&Close Project"));
144 menu_File->Append(ID_MENU_CLOSE_ALL_PROJECTS, wxT("C&lose All Projects"));
145 menu_File->AppendSeparator();
146 menu_File->Append(ID_MENU_EXPORT_HIERARCHY, wxT("&Export Project Hierarchy..."));
147 menu_File->AppendSeparator();
148 menu_File->Append(ID_MENU_EXIT, wxT("E&xit"));
150 menuBar->Append(menu_File, wxT("&File"));
153 menu_Edit = new wxMenu();
154 menu_Edit->Append(ID_MENU_REFRESH_PROJECT, wxT("&Refresh Project"));
155 menu_Edit->AppendSeparator();
156 menu_Edit->Append(ID_MENU_CUT, wxT("Cu&t"));
157 menu_Edit->Append(ID_MENU_COPY, wxT("&Copy"));
158 menu_Edit->Append(ID_MENU_PASTE, wxT("&Paste"));
159 menu_Edit->AppendSeparator();
160 menu_Edit->Append(ID_MENU_DELETE, wxT("&Delete"));
161 menu_Edit->Append(ID_MENU_SELECT_ALL, wxT("Select &All"));
162 menu_Edit->Append(ID_MENU_SELECT_NONE, wxT("Ca&ncel Selection"));
164 menuBar->Append(menu_Edit, wxT("&Edit"));
167 menu_Tools = new wxMenu();
168 menu_Tools->Append(ID_MENU_EVENT_LOG, wxT("Event &Log"));
169 menu_Tools->Append(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxT("BBTK &Graphical Editor"));
170 menu_Tools->Append(ID_MENU_MINITOOLS, wxT("&MiniTools"));
171 menu_Tools->Append(ID_MENU_CODE_EDITOR, wxT("&Code Editor"));
172 menu_Tools->Append(ID_MENU_COMMAND_LINE, wxT("&Command Line"));
174 menuBar->Append(menu_Tools, wxT("&Tools"));
177 menu_Help = new wxMenu();
178 menu_Help->Append(ID_MENU_HELP, wxT("&Help"));
179 menu_Help->Append(ID_MENU_REPORT_BUG, wxT("Report &Bug"));
180 menu_Help->Append(ID_MENU_ABOUT_CREADEVMANAGER, wxT("&About CreaDevManager"));
181 menu_Help->Append(ID_MENU_ABOUT_CREATIS, wxT("A&bout CREATIS"));
183 menuBar->Append(menu_Help, wxT("&Help"));
188 wxStatusBar* statusBar = new wxStatusBar(this, ID_STATUS_BAR, wxST_SIZEGRIP);
189 statusBar->SetFieldsCount(1);
190 SetStatusBar(statusBar);
194 void wxCDMMainFrame::CreateControls()
197 auiManager.SetManagedWindow(this);
200 tree_Projects = new wxCDMProjectsTreeCtrl(
205 wxTR_HAS_BUTTONS | wxTR_AQUA_BUTTONS
208 panel_Properties = new wxCDMMainDescriptionPanel(
210 ID_WINDOW_PROPERTIES,
211 wxT("Description Panel"),
223 auiManager.AddPane(panel_Properties, wxAuiPaneInfo().BestSize(600,400).CenterPane().Name(wxT("panel_Properties")).Caption(wxT("Properties")));
224 auiManager.AddPane(tree_Projects, wxAuiPaneInfo().Left().MinSize(300,300).BestSize(300,400).CloseButton(false).Name(wxT("tree_Projects")).Caption(wxT("Projects Tree")));
226 wxString pers = auiManager.SavePerspective();
229 auiManager.LoadPerspective(pers,true);
234 void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event)
238 wxCDMNewProjectDialog* dialog = new wxCDMNewProjectDialog(this);
240 userResponse = dialog->ShowModal();
242 if(userResponse == wxID_FORWARD)
245 if(this->model->GetProject() != NULL)
247 if(!this->model->CloseProject(result))
249 std::cout << "error closing project: " << *result << std::endl;
250 wxMessageBox(crea::std2wx(*result),_T("New Project - Error!"),wxOK | wxICON_ERROR);
256 if(!this->model->CreateProject(
257 crea::wx2std(dialog->GetProjectName()),
258 crea::wx2std(dialog->GetProjectLocation()),
260 crea::wx2std(dialog->GetPackageAuthor()),
261 crea::wx2std(dialog->GetPackageDescription())
264 std::cout << "error opening project: " << *result << std::endl;
265 wxMessageBox(crea::std2wx(*result),_T("New Project - Error!"),wxOK | wxICON_ERROR);
270 //populate tree control
271 tree_Projects->BuildTree(this->model->GetModelElements(),this->model->GetProject());
272 tree_Projects->SelectItem(this->model->GetProject()->GetId());
274 //change description panel
275 if(this->panel_Properties != NULL)
277 auiManager.DetachPane(this->panel_Properties);
278 this->panel_Properties->Destroy();
281 this->panel_Properties = new wxCDMProjectDescriptionPanel(
283 this->model->GetProject(),
284 ID_WINDOW_PROPERTIES,
285 wxT("Description Panel"),
289 //show projectactions panel
290 if(this->panel_ProjectActions != NULL)
292 auiManager.DetachPane(this->panel_Properties);
293 this->panel_ProjectActions->Destroy();
296 panel_ProjectActions = new wxCDMProjectActionsPanel(
298 ID_WINDOW_PROJ_ACTIONS,
299 wxT("Project Actions Panel"),
304 panel_ProjectActions->SetMinSize(wxSize(500, 100));
307 auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400));
308 auiManager.AddPane(panel_ProjectActions, wxAuiPaneInfo().Bottom().MinSize(800,50).Name(wxT("panel_ProjectActions")).Caption(wxT("Project Actions")).BestSize(800,70).CloseButton(false));
312 wxMessageBox(_T("New Project created!"),_T("New Project - Success!"), wxOK | wxICON_INFORMATION);
317 void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event)
321 long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
322 wxDirDialog* FD = new wxDirDialog(this, wxT("Select the project directory"), wxT(""), style);
323 long userResponse = FD->ShowModal();
324 if(userResponse == wxID_OK)
326 std::string path = crea::wx2std (FD->GetPath());
330 std::cout << "Selection to open: " << path << std::endl;
334 if(this->model->GetProject() != NULL)
336 std::cout << "Project not null, closing it" << std::endl;
337 if(!this->model->CloseProject(result))
339 std::cout << "error closing project: " << *result << std::endl;
340 wxMessageBox(crea::std2wx(result->c_str()),_T("New Project - Error!"),wxOK | wxICON_ERROR);
346 if (!this->model->OpenProject(path, result))
348 std::cout << "error opening project: " << *result << std::endl;
349 wxMessageBox( crea::std2wx(result->c_str()), wxT("Open Project - Error"), wxICON_ERROR);
354 std::cout << "building ui" << std::endl;
357 //populate tree control
358 tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
359 tree_Projects->SelectItem(this->model->GetProject()->GetId());
361 //change description panel
362 if(this->panel_Properties != NULL)
364 auiManager.DetachPane(this->panel_Properties);
365 this->panel_Properties->Destroy();
368 this->panel_Properties = new wxCDMProjectDescriptionPanel(
370 this->model->GetProject(),
371 ID_WINDOW_PROPERTIES,
372 wxT("Description Panel"),
378 //change project's actions panel
379 if(this->panel_ProjectActions!= NULL)
381 auiManager.DetachPane(this->panel_ProjectActions);
382 this->panel_ProjectActions->Destroy();
384 panel_ProjectActions = new wxCDMProjectActionsPanel(
386 ID_WINDOW_PROJ_ACTIONS,
387 wxT("Project Actions Panel"),
392 panel_ProjectActions->SetMinSize(wxSize(500, 100));
395 auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400));
396 auiManager.AddPane(panel_ProjectActions, wxAuiPaneInfo().Bottom().MinSize(800,50).Name(wxT("panel_ProjectActions")).Caption(wxT("Project Actions")).BestSize(800,70).CloseButton(false));
403 void wxCDMMainFrame::OnMenuOpenRecent(wxCommandEvent& event)
405 std::cerr << "Event OnMenuOpenRecent not implemented" << std::endl;
408 void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event)
410 std::cout << "closing project" << std::endl;
412 if(!this->model->CloseProject(result))
414 std::cout << "error closing project: " << *result << std::endl;
415 wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
418 tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
420 if(this->panel_Properties != NULL)
422 auiManager.DetachPane(this->panel_Properties);
423 this->panel_Properties->Destroy();
425 if(this->panel_ProjectActions != NULL)
427 auiManager.DetachPane(this->panel_ProjectActions);
428 this->panel_ProjectActions->Destroy();
431 this->panel_Properties = new wxCDMMainDescriptionPanel(
433 ID_WINDOW_PROPERTIES,
434 wxT("Description Panel"),
440 auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400));
445 void wxCDMMainFrame::OnMenuCloseAllProjects(wxCommandEvent& event)
447 std::cerr << "Event OnMenuCloseAllProjects closing only one project" << std::endl;
449 if(!this->model->CloseProject(result))
451 std::cout << "error closing project: " << *result << std::endl;
452 wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
454 tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
456 if(this->panel_Properties != NULL)
458 auiManager.DetachPane(this->panel_Properties);
459 this->panel_Properties->Destroy();
461 if(this->panel_ProjectActions != NULL)
463 auiManager.DetachPane(this->panel_ProjectActions);
464 this->panel_ProjectActions->Destroy();
467 this->panel_Properties = new wxCDMMainDescriptionPanel(
469 ID_WINDOW_PROPERTIES,
470 wxT("Description Panel"),
476 auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400));
481 void wxCDMMainFrame::OnMenuExportHierarchy(wxCommandEvent& event)
483 std::cerr << "Event OnMenuExportHierarchy not implemented" << std::endl;
486 void wxCDMMainFrame::OnMenuExit(wxCommandEvent& event)
488 std::cout << "Closing CreaDevManager..." << std::endl;
490 if(!this->model->CloseProject(result))
492 std::cout << "error closing project: " << *result << std::endl;
493 wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
495 tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
497 if(this->panel_Properties != NULL)
499 auiManager.DetachPane(this->panel_Properties);
500 this->panel_Properties->Destroy();
502 if(this->panel_ProjectActions != NULL)
504 auiManager.DetachPane(this->panel_ProjectActions);
505 this->panel_ProjectActions->Destroy();
508 this->panel_Properties = new wxCDMMainDescriptionPanel(
510 ID_WINDOW_PROPERTIES,
511 wxT("Description Panel"),
521 void wxCDMMainFrame::OnMenuRefreshProject(wxCommandEvent& event)
524 if(!model->RefreshProject(result))
526 wxMessageBox( crea::std2wx(result->c_str()), wxT("Refresh Project - Error"), wxICON_ERROR);
528 this->tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
529 this->auiManager.Update();
530 //TODO: Show possible problems in CMakeLists files
533 void wxCDMMainFrame::OnMenuMenuCut(wxCommandEvent& event)
535 std::cerr << "Event OnMenuMenuCut not implemented" << std::endl;
538 void wxCDMMainFrame::OnMenuMenuCopy(wxCommandEvent& event)
540 std::cerr << "Event OnMenuMenuCopy not implemented" << std::endl;
543 void wxCDMMainFrame::OnMenuMenuPaste(wxCommandEvent& event)
545 std::cerr << "Event OnMenuMenuPaste not implemented" << std::endl;
548 void wxCDMMainFrame::OnMenuMenuDelete(wxCommandEvent& event)
550 std::cerr << "Event OnMenuMenuDelete not implemented" << std::endl;
553 void wxCDMMainFrame::OnMenuSelectAll(wxCommandEvent& event)
555 std::cerr << "Event OnMenuSelectAll not implemented" << std::endl;
558 void wxCDMMainFrame::OnMenuSelectNone(wxCommandEvent& event)
560 std::cerr << "Event OnMenuSelectNone not implemented" << std::endl;
565 void wxCDMMainFrame::OnMenuEventLog(wxCommandEvent& event)
567 std::cerr << "Event OnMenuEventLog not implemented" << std::endl;
570 void wxCDMMainFrame::OnMenuBBTKGraphicalEditor(wxCommandEvent& event)
572 std::cerr << "Event OnMenuBBTKGraphicalEditor not implemented" << std::endl;
575 void wxCDMMainFrame::OnMenuMiniTools(wxCommandEvent& event)
577 std::cerr << "Event OnMenuMiniTools not implemented" << std::endl;
580 void wxCDMMainFrame::OnMenuCodeEditor(wxCommandEvent& event)
582 std::cerr << "Event OnMenuCodeEditor not implemented" << std::endl;
585 void wxCDMMainFrame::OnMenuCommandLine(wxCommandEvent& event)
587 std::cerr << "Event OnMenuCommandLine not implemented" << std::endl;
592 void wxCDMMainFrame::OnMenuHelp(wxCommandEvent& event)
594 std::cerr << "Event OnMenuHelp not implemented" << std::endl;
597 void wxCDMMainFrame::OnMenuReportBug(wxCommandEvent& event)
599 std::cerr << "Event OnMenuReportBug not implemented" << std::endl;
602 void wxCDMMainFrame::OnMenuAboutCreaDevManager(wxCommandEvent& event)
604 std::cerr << "Event OnMenuAboutCreaDevManager not implemented" << std::endl;
607 void wxCDMMainFrame::OnMenuAboutCreatis(wxCommandEvent& event)
609 std::cerr << "Event OnMenuAboutCreatis not implemented" << std::endl;
613 void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
615 std::cout << "New Tree Selection" << std::endl;
617 if(event.GetId() != 0)
623 //get selected element
624 wxTreeItemId elementId = event.GetItem();
626 //get element from model
627 modelCDMIProjectTreeNode* element = this->model->GetModelElements()[elementId];
628 std::cout << "Tree Selection: " << element->GetName() << std::endl;
630 //TODO get element type
632 modelCDMProject* elementProject = dynamic_cast<modelCDMProject*>(element);
633 wxPanel* description;
634 if(elementProject != NULL)
636 //create element description
637 description = new wxCDMProjectDescriptionPanel(
640 ID_WINDOW_PROPERTIES,
641 wxT("Description Panel"),
651 modelCDMAppli* elementAppli = dynamic_cast<modelCDMAppli*>(element);
652 if(elementAppli != NULL)
654 //create element description
655 description = new wxCDMAppliDescriptionPanel(
658 ID_WINDOW_PROPERTIES,
659 wxT("Description Panel"),
668 modelCDMApplication* elementApplication = dynamic_cast<modelCDMApplication*>(element);
669 if(elementApplication != NULL)
671 //create element description
672 description = new wxCDMApplicationDescriptionPanel(
675 ID_WINDOW_PROPERTIES,
676 wxT("Description Panel"),
685 modelCDMLib* elementLib = dynamic_cast<modelCDMLib*>(element);
686 if(elementLib != NULL)
688 //create element description
689 description = new wxCDMLibDescriptionPanel(
692 ID_WINDOW_PROPERTIES,
693 wxT("Description Panel"),
702 modelCDMLibrary* elementLibrary = dynamic_cast<modelCDMLibrary*>(element);
703 if(elementLibrary != NULL)
705 //create element description
706 description = new wxCDMLibraryDescriptionPanel(
709 ID_WINDOW_PROPERTIES,
710 wxT("Description Panel"),
719 modelCDMPackage* elementPackage = dynamic_cast<modelCDMPackage*>(element);
720 if(elementPackage != NULL)
722 //create element description
723 description = new wxCDMPackageDescriptionPanel(
726 ID_WINDOW_PROPERTIES,
727 wxT("Description Panel"),
736 modelCDMBlackBox* elementBlackBox = dynamic_cast<modelCDMBlackBox*>(element);
737 if(elementBlackBox != NULL)
739 //create element description
740 description = new wxCDMBlackBoxDescriptionPanel(
743 ID_WINDOW_PROPERTIES,
744 wxT("Description Panel"),
753 modelCDMCMakeListsFile* elementCMakeLists = dynamic_cast<modelCDMCMakeListsFile*>(element);
754 if(elementCMakeLists != NULL)
756 //create element description
757 description = new wxCDMCMakeListsDescriptionPanel(
760 ID_WINDOW_PROPERTIES,
761 wxT("Description Panel"),
770 modelCDMFolder* elementFolder = dynamic_cast<modelCDMFolder*>(element);
771 if(elementFolder != NULL)
773 //create element description
774 description = new wxCDMFolderDescriptionPanel(
777 ID_WINDOW_PROPERTIES,
778 wxT("Description Panel"),
787 modelCDMFile* elementFile = dynamic_cast<modelCDMFile*>(element);
788 if(elementFile != NULL)
790 //create element description
791 description = new wxCDMFileDescriptionPanel(
794 ID_WINDOW_PROPERTIES,
795 wxT("Description Panel"),
805 //create element description
806 description = new wxCDMMainDescriptionPanel(
808 ID_WINDOW_PROPERTIES,
809 wxT("Description Panel"),
825 if(this->panel_Properties!= NULL)
826 this->panel_Properties->Hide();
828 auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400));
832 if(this->panel_Properties!= NULL)
834 this->panel_Properties->Destroy();
835 auiManager.DetachPane(this->panel_Properties);
839 this->panel_Properties = description;
840 //auiManager.AddPane(panel_Properties, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400));
847 void wxCDMMainFrame::OnCreationComplete(wxCommandEvent& event)
849 std::cout << "inMainFrame id: " << event.GetId() << ", tree element: "<< event.GetInt() << std::endl;
850 switch(event.GetId() != 0)
853 this->tree_Projects->SelectItem(event.GetInt(), false);
854 this->tree_Projects->SelectItem(event.GetInt(), true);
857 wxPanel* description = NULL;
858 if(event.GetString() == wxT("manage_packages"))
860 description = new wxCDMPackageManagerPanel(
862 this->model->GetProject(),
863 ID_WINDOW_PROPERTIES,
864 wxT("Description Panel"),
870 else if(event.GetString() == wxT("manage_libraries"))
872 description = new wxCDMLibDescriptionPanel(
874 this->model->GetProject()->GetLib(),
875 ID_WINDOW_PROPERTIES,
876 wxT("Description Panel"),
882 else if(event.GetString() == wxT("manage_applications"))
884 description = new wxCDMAppliDescriptionPanel(
886 this->model->GetProject()->GetAppli(),
887 ID_WINDOW_PROPERTIES,
888 wxT("Description Panel"),
895 if(this->panel_Properties!= NULL)
896 this->panel_Properties->Hide();
898 auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("Properties")).BestSize(600,400));
902 if(this->panel_Properties!= NULL)
904 this->panel_Properties->Destroy();
905 auiManager.DetachPane(this->panel_Properties);
909 this->panel_Properties = description;