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"
51 #include "wxCDMProjectActionsPanel.h"
52 #include "wxCDMNewProjectDialog.h"
55 BEGIN_EVENT_TABLE(wxCDMMainFrame, wxFrame)
56 EVT_MENU(ID_MENU_NEW_PROJECT, wxCDMMainFrame::OnMenuNewProject)
57 EVT_MENU(ID_MENU_OPEN_PROJECT, wxCDMMainFrame::OnMenuOpenProject)
58 EVT_MENU(ID_MENU_OPEN_RECENT, wxCDMMainFrame::OnMenuOpenRecent)
59 EVT_MENU(ID_MENU_CLOSE_PROJECT, wxCDMMainFrame::OnMenuCloseProject)
60 EVT_MENU(ID_MENU_CLOSE_ALL_PROJECTS, wxCDMMainFrame::OnMenuCloseAllProjects)
61 EVT_MENU(ID_MENU_EXPORT_HIERARCHY, wxCDMMainFrame::OnMenuExportHierarchy)
62 EVT_MENU(ID_MENU_EXIT, wxCDMMainFrame::OnMenuExit)
63 EVT_MENU(ID_MENU_REFRESH_PROJECT, wxCDMMainFrame::OnMenuRefreshProject)
64 EVT_MENU(ID_MENU_CUT, wxCDMMainFrame::OnMenuMenuCut)
65 EVT_MENU(ID_MENU_COPY, wxCDMMainFrame::OnMenuMenuCopy)
66 EVT_MENU(ID_MENU_PASTE, wxCDMMainFrame::OnMenuMenuPaste)
67 EVT_MENU(ID_MENU_DELETE, wxCDMMainFrame::OnMenuMenuDelete)
68 EVT_MENU(ID_MENU_SELECT_ALL, wxCDMMainFrame::OnMenuSelectAll)
69 EVT_MENU(ID_MENU_SELECT_NONE, wxCDMMainFrame::OnMenuSelectNone)
70 EVT_MENU(ID_MENU_EVENT_LOG, wxCDMMainFrame::OnMenuEventLog)
71 EVT_MENU(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxCDMMainFrame::OnMenuBBTKGraphicalEditor)
72 EVT_MENU(ID_MENU_MINITOOLS, wxCDMMainFrame::OnMenuMiniTools)
73 EVT_MENU(ID_MENU_CODE_EDITOR, wxCDMMainFrame::OnMenuCodeEditor)
74 EVT_MENU(ID_MENU_COMMAND_LINE, wxCDMMainFrame::OnMenuCommandLine)
75 EVT_MENU(ID_MENU_HELP, wxCDMMainFrame::OnMenuHelp)
76 EVT_MENU(ID_MENU_REPORT_BUG, wxCDMMainFrame::OnMenuReportBug)
77 EVT_MENU(ID_MENU_ABOUT_CREADEVMANAGER, wxCDMMainFrame::OnMenuAboutCreaDevManager)
78 EVT_MENU(ID_MENU_ABOUT_CREATIS, wxCDMMainFrame::OnMenuAboutCreatis)
79 EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCDMMainFrame::OnMenuNewProject)
80 EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMMainFrame::OnMenuOpenProject)
81 EVT_TREE_SEL_CHANGED(ID_TREE_PROJECTS, wxCDMMainFrame::OnTreeSelectionChanged)
82 EVT_COMMAND(wxID_ANY, wxEVT_DISPLAY_CHANGED, wxCDMMainFrame::OnCreationComplete)
85 wxCDMMainFrame::wxCDMMainFrame(
88 const wxString& caption,
94 Create(parent, id, caption, pos, size, style);
97 wxCDMMainFrame::~wxCDMMainFrame()
102 bool wxCDMMainFrame::Create(
105 const wxString& caption,
111 wxFrame::Create(parent, id, caption, pos, size, style);
112 this->model = new modelCDMMain();
118 void wxCDMMainFrame::RefreshProject()
121 std::cout << "refreshing project" << std::endl;
122 this->model->RefreshProject(result);
123 std::cout << "rebuilding project tree" << std::endl;
124 this->tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
127 void wxCDMMainFrame::CreateMenus()
129 wxMenuBar* menuBar = new wxMenuBar;
132 menu_File = new wxMenu();
133 menu_File->Append(ID_MENU_NEW_PROJECT, wxT("&New Project..."));
134 menu_File->Append(ID_MENU_OPEN_PROJECT, wxT("&Open Project..."));
135 menu_File->Append(ID_MENU_OPEN_RECENT, wxT("Open &Recent"));
136 menu_File->AppendSeparator();
137 menu_File->Append(ID_MENU_CLOSE_PROJECT, wxT("&Close Project"));
138 menu_File->Append(ID_MENU_CLOSE_ALL_PROJECTS, wxT("C&lose All Projects"));
139 menu_File->AppendSeparator();
140 menu_File->Append(ID_MENU_EXPORT_HIERARCHY, wxT("&Export Project Hierarchy..."));
141 menu_File->AppendSeparator();
142 menu_File->Append(ID_MENU_EXIT, wxT("E&xit"));
144 menuBar->Append(menu_File, wxT("&File"));
147 menu_Edit = new wxMenu();
148 menu_Edit->Append(ID_MENU_REFRESH_PROJECT, wxT("&Refresh Project"));
149 menu_Edit->AppendSeparator();
150 menu_Edit->Append(ID_MENU_CUT, wxT("Cu&t"));
151 menu_Edit->Append(ID_MENU_COPY, wxT("&Copy"));
152 menu_Edit->Append(ID_MENU_PASTE, wxT("&Paste"));
153 menu_Edit->AppendSeparator();
154 menu_Edit->Append(ID_MENU_DELETE, wxT("&Delete"));
155 menu_Edit->Append(ID_MENU_SELECT_ALL, wxT("Select &All"));
156 menu_Edit->Append(ID_MENU_SELECT_NONE, wxT("Ca&ncel Selection"));
158 menuBar->Append(menu_Edit, wxT("&Edit"));
161 menu_Tools = new wxMenu();
162 menu_Tools->Append(ID_MENU_EVENT_LOG, wxT("Event &Log"));
163 menu_Tools->Append(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxT("BBTK &Graphical Editor"));
164 menu_Tools->Append(ID_MENU_MINITOOLS, wxT("&MiniTools"));
165 menu_Tools->Append(ID_MENU_CODE_EDITOR, wxT("&Code Editor"));
166 menu_Tools->Append(ID_MENU_COMMAND_LINE, wxT("&Command Line"));
168 menuBar->Append(menu_Tools, wxT("&Tools"));
171 menu_Help = new wxMenu();
172 menu_Help->Append(ID_MENU_HELP, wxT("&Help"));
173 menu_Help->Append(ID_MENU_REPORT_BUG, wxT("Report &Bug"));
174 menu_Help->Append(ID_MENU_ABOUT_CREADEVMANAGER, wxT("&About CreaDevManager"));
175 menu_Help->Append(ID_MENU_ABOUT_CREATIS, wxT("A&bout CREATIS"));
177 menuBar->Append(menu_Help, wxT("&Help"));
182 wxStatusBar* statusBar = new wxStatusBar(this, ID_STATUS_BAR, wxST_SIZEGRIP);
183 statusBar->SetFieldsCount(1);
184 SetStatusBar(statusBar);
188 void wxCDMMainFrame::CreateControls()
191 auiManager.SetManagedWindow(this);
194 tree_Projects = new wxCDMProjectsTreeCtrl(
199 wxTR_HAS_BUTTONS | wxTR_AQUA_BUTTONS
201 tree_Projects->SetMinSize(wxSize(200,200));
203 panel_Properties = new wxCDMMainDescriptionPanel(
205 ID_WINDOW_PROPERTIES,
206 wxT("Description Panel"),
216 auiManager.AddPane(tree_Projects, wxLEFT, wxT("Projects Tree"));
217 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
220 auiManager.GetPane(tree_Projects).CloseButton(false).MaximizeButton(true);
225 void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event)
229 wxCDMNewProjectDialog* dialog = new wxCDMNewProjectDialog(this);
231 userResponse = dialog->ShowModal();
233 if(userResponse == wxID_FORWARD)
236 if(this->model->GetProject() != NULL)
238 if(!this->model->CloseProject(result))
240 std::cout << "error closing project: " << *result << std::endl;
241 wxMessageBox(crea::std2wx(*result),_T("New Project - Error!"),wxOK | wxICON_ERROR);
247 if(!this->model->CreateProject(
248 crea::wx2std(dialog->GetProjectName()),
249 crea::wx2std(dialog->GetProjectLocation()),
251 crea::wx2std(dialog->GetPackageAuthor()),
252 crea::wx2std(dialog->GetPackageDescription())
255 std::cout << "error opening project: " << *result << std::endl;
256 wxMessageBox(crea::std2wx(*result),_T("New Project - Error!"),wxOK | wxICON_ERROR);
261 //populate tree control
262 tree_Projects->BuildTree(this->model->GetModelElements(),this->model->GetProject());
263 tree_Projects->SelectItem(this->model->GetProject()->GetId());
265 //change description panel
266 if(this->panel_Properties != NULL)
268 auiManager.DetachPane(this->panel_Properties);
269 this->panel_Properties->Destroy();
272 this->panel_Properties = new wxCDMProjectDescriptionPanel(
274 this->model->GetProject(),
275 ID_WINDOW_PROPERTIES,
276 wxT("Description Panel"),
280 //show projectactions panel
281 if(this->panel_ProjectActions != NULL)
283 auiManager.DetachPane(this->panel_Properties);
284 this->panel_ProjectActions->Destroy();
287 panel_ProjectActions = new wxCDMProjectActionsPanel(
289 ID_WINDOW_PROJ_ACTIONS,
290 wxT("Project Actions Panel"),
295 panel_ProjectActions->SetMinSize(wxSize(500, 100));
298 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
299 auiManager.AddPane(panel_ProjectActions, wxBOTTOM, wxT("Project Actions"));
303 wxMessageBox(_T("New Project created!"),_T("New Project - Success!"), wxOK | wxICON_INFORMATION);
308 void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event)
312 long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
313 wxDirDialog* FD = new wxDirDialog(this, wxT("Select the project directory"), wxT(""), style);
314 long userResponse = FD->ShowModal();
315 if(userResponse == wxID_OK)
317 std::string path = crea::wx2std (FD->GetPath());
321 std::cout << "Selection to open: " << path << std::endl;
325 if(this->model->GetProject() != NULL)
327 std::cout << "Project not null, closing it" << std::endl;
328 if(!this->model->CloseProject(result))
330 std::cout << "error closing project: " << *result << std::endl;
331 wxMessageBox(crea::std2wx(result->c_str()),_T("New Project - Error!"),wxOK | wxICON_ERROR);
337 if (!this->model->OpenProject(path, result))
339 std::cout << "error opening project: " << *result << std::endl;
340 wxMessageBox( crea::std2wx(result->c_str()), wxT("Open Project - Error"), wxICON_ERROR);
345 std::cout << "building ui" << std::endl;
348 //populate tree control
349 tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
350 tree_Projects->SelectItem(this->model->GetProject()->GetId());
352 //change description panel
353 if(this->panel_Properties != NULL)
355 auiManager.DetachPane(this->panel_Properties);
356 this->panel_Properties->Destroy();
359 this->panel_Properties = new wxCDMProjectDescriptionPanel(
361 this->model->GetProject(),
362 ID_WINDOW_PROPERTIES,
363 wxT("Description Panel"),
369 //change project's actions panel
370 if(this->panel_ProjectActions!= NULL)
372 auiManager.DetachPane(this->panel_ProjectActions);
373 this->panel_ProjectActions->Destroy();
375 panel_ProjectActions = new wxCDMProjectActionsPanel(
377 ID_WINDOW_PROJ_ACTIONS,
378 wxT("Project Actions Panel"),
383 panel_ProjectActions->SetMinSize(wxSize(500, 100));
386 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
387 auiManager.AddPane(panel_ProjectActions, wxBOTTOM, wxT("Project Actions"));
394 void wxCDMMainFrame::OnMenuOpenRecent(wxCommandEvent& event)
396 std::cerr << "Event OnMenuOpenRecent not implemented" << std::endl;
399 void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event)
401 std::cout << "closing project" << std::endl;
403 if(!this->model->CloseProject(result))
405 std::cout << "error closing project: " << *result << std::endl;
406 wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
409 tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
411 if(this->panel_Properties != NULL)
413 auiManager.DetachPane(this->panel_Properties);
414 this->panel_Properties->Destroy();
416 if(this->panel_ProjectActions != NULL)
418 auiManager.DetachPane(this->panel_ProjectActions);
419 this->panel_ProjectActions->Destroy();
422 this->panel_Properties = new wxCDMMainDescriptionPanel(
424 ID_WINDOW_PROPERTIES,
425 wxT("Description Panel"),
431 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
436 void wxCDMMainFrame::OnMenuCloseAllProjects(wxCommandEvent& event)
438 std::cerr << "Event OnMenuCloseAllProjects closing only one project" << std::endl;
440 if(!this->model->CloseProject(result))
442 std::cout << "error closing project: " << *result << std::endl;
443 wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
445 tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
447 if(this->panel_Properties != NULL)
449 auiManager.DetachPane(this->panel_Properties);
450 this->panel_Properties->Destroy();
452 if(this->panel_ProjectActions != NULL)
454 auiManager.DetachPane(this->panel_ProjectActions);
455 this->panel_ProjectActions->Destroy();
458 this->panel_Properties = new wxCDMMainDescriptionPanel(
460 ID_WINDOW_PROPERTIES,
461 wxT("Description Panel"),
467 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
472 void wxCDMMainFrame::OnMenuExportHierarchy(wxCommandEvent& event)
474 std::cerr << "Event OnMenuExportHierarchy not implemented" << std::endl;
477 void wxCDMMainFrame::OnMenuExit(wxCommandEvent& event)
479 std::cout << "Closing CreaDevManager..." << std::endl;
481 if(!this->model->CloseProject(result))
483 std::cout << "error closing project: " << *result << std::endl;
484 wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
486 tree_Projects->BuildTree(this->model->GetModelElements(), this->model->GetProject());
488 if(this->panel_Properties != NULL)
490 auiManager.DetachPane(this->panel_Properties);
491 this->panel_Properties->Destroy();
493 if(this->panel_ProjectActions != NULL)
495 auiManager.DetachPane(this->panel_ProjectActions);
496 this->panel_ProjectActions->Destroy();
499 this->panel_Properties = new wxCDMMainDescriptionPanel(
501 ID_WINDOW_PROPERTIES,
502 wxT("Description Panel"),
512 void wxCDMMainFrame::OnMenuRefreshProject(wxCommandEvent& event)
515 if(!model->RefreshProject(result))
517 wxMessageBox( crea::std2wx(result->c_str()), wxT("Refresh Project - Error"), wxICON_ERROR);
519 //TODO: Show possible problems in CMakeLists files
522 void wxCDMMainFrame::OnMenuMenuCut(wxCommandEvent& event)
524 std::cerr << "Event OnMenuMenuCut not implemented" << std::endl;
527 void wxCDMMainFrame::OnMenuMenuCopy(wxCommandEvent& event)
529 std::cerr << "Event OnMenuMenuCopy not implemented" << std::endl;
532 void wxCDMMainFrame::OnMenuMenuPaste(wxCommandEvent& event)
534 std::cerr << "Event OnMenuMenuPaste not implemented" << std::endl;
537 void wxCDMMainFrame::OnMenuMenuDelete(wxCommandEvent& event)
539 std::cerr << "Event OnMenuMenuDelete not implemented" << std::endl;
542 void wxCDMMainFrame::OnMenuSelectAll(wxCommandEvent& event)
544 std::cerr << "Event OnMenuSelectAll not implemented" << std::endl;
547 void wxCDMMainFrame::OnMenuSelectNone(wxCommandEvent& event)
549 std::cerr << "Event OnMenuSelectNone not implemented" << std::endl;
554 void wxCDMMainFrame::OnMenuEventLog(wxCommandEvent& event)
556 std::cerr << "Event OnMenuEventLog not implemented" << std::endl;
559 void wxCDMMainFrame::OnMenuBBTKGraphicalEditor(wxCommandEvent& event)
561 std::cerr << "Event OnMenuBBTKGraphicalEditor not implemented" << std::endl;
564 void wxCDMMainFrame::OnMenuMiniTools(wxCommandEvent& event)
566 std::cerr << "Event OnMenuMiniTools not implemented" << std::endl;
569 void wxCDMMainFrame::OnMenuCodeEditor(wxCommandEvent& event)
571 std::cerr << "Event OnMenuCodeEditor not implemented" << std::endl;
574 void wxCDMMainFrame::OnMenuCommandLine(wxCommandEvent& event)
576 std::cerr << "Event OnMenuCommandLine not implemented" << std::endl;
581 void wxCDMMainFrame::OnMenuHelp(wxCommandEvent& event)
583 std::cerr << "Event OnMenuHelp not implemented" << std::endl;
586 void wxCDMMainFrame::OnMenuReportBug(wxCommandEvent& event)
588 std::cerr << "Event OnMenuReportBug not implemented" << std::endl;
591 void wxCDMMainFrame::OnMenuAboutCreaDevManager(wxCommandEvent& event)
593 std::cerr << "Event OnMenuAboutCreaDevManager not implemented" << std::endl;
596 void wxCDMMainFrame::OnMenuAboutCreatis(wxCommandEvent& event)
598 std::cerr << "Event OnMenuAboutCreatis not implemented" << std::endl;
602 void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
604 std::cout << "New Tree Selection" << std::endl;
605 //get selected element
606 wxTreeItemId elementId = event.GetItem();
608 //get element from model
609 modelCDMIProjectTreeNode* element = this->model->GetModelElements()[elementId];
610 std::cout << "Tree Selection: " << element->GetName() << std::endl;
612 //TODO get element type
614 modelCDMProject* elementProject = dynamic_cast<modelCDMProject*>(element);
615 if(elementProject != NULL)
618 //create element description
619 wxCDMProjectDescriptionPanel* description = new wxCDMProjectDescriptionPanel(
622 ID_WINDOW_PROPERTIES,
623 wxT("Description Panel"),
629 if(this->panel_Properties!= NULL)
631 this->panel_Properties->Hide();
632 this->panel_Properties->Destroy();
633 auiManager.DetachPane(this->panel_Properties);
636 this->panel_Properties = description;
637 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
643 modelCDMAppli* elementAppli = dynamic_cast<modelCDMAppli*>(element);
644 if(elementAppli != NULL)
646 //create element description
647 wxCDMAppliDescriptionPanel* description = new wxCDMAppliDescriptionPanel(
650 ID_WINDOW_PROPERTIES,
651 wxT("Description Panel"),
657 if(this->panel_Properties!= NULL)
659 this->panel_Properties->Hide();
660 this->panel_Properties->Destroy();
661 auiManager.DetachPane(this->panel_Properties);
664 this->panel_Properties = description;
665 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
671 modelCDMApplication* elementApplication = dynamic_cast<modelCDMApplication*>(element);
672 if(elementApplication != NULL)
674 //create element description
675 wxCDMApplicationDescriptionPanel* description = new wxCDMApplicationDescriptionPanel(
678 ID_WINDOW_PROPERTIES,
679 wxT("Description Panel"),
685 if(this->panel_Properties!= NULL)
687 this->panel_Properties->Hide();
688 this->panel_Properties->Destroy();
689 auiManager.DetachPane(this->panel_Properties);
693 this->panel_Properties = description;
694 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
700 modelCDMLib* elementLib = dynamic_cast<modelCDMLib*>(element);
701 if(elementLib != NULL)
703 //create element description
704 wxCDMLibDescriptionPanel* description = new wxCDMLibDescriptionPanel(
707 ID_WINDOW_PROPERTIES,
708 wxT("Description Panel"),
714 if(this->panel_Properties!= NULL)
716 this->panel_Properties->Hide();
717 this->panel_Properties->Destroy();
718 auiManager.DetachPane(this->panel_Properties);
722 this->panel_Properties = description;
723 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
729 modelCDMLibrary* elementLibrary = dynamic_cast<modelCDMLibrary*>(element);
730 if(elementLibrary != NULL)
732 //create element description
733 wxCDMLibraryDescriptionPanel* description = new wxCDMLibraryDescriptionPanel(
736 ID_WINDOW_PROPERTIES,
737 wxT("Description Panel"),
743 if(this->panel_Properties!= NULL)
745 auiManager.DetachPane(this->panel_Properties);
746 this->panel_Properties->Hide();
747 this->panel_Properties->Destroy();
751 this->panel_Properties = description;
752 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
758 modelCDMPackage* elementPackage = dynamic_cast<modelCDMPackage*>(element);
759 if(elementPackage != NULL)
761 //create element description
762 wxCDMPackageDescriptionPanel* description = new wxCDMPackageDescriptionPanel(
765 ID_WINDOW_PROPERTIES,
766 wxT("Description Panel"),
772 if(this->panel_Properties!= NULL)
774 this->panel_Properties->Hide();
775 this->panel_Properties->Destroy();
776 auiManager.DetachPane(this->panel_Properties);
780 this->panel_Properties = description;
781 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
787 modelCDMBlackBox* elementBlackBox = dynamic_cast<modelCDMBlackBox*>(element);
788 if(elementBlackBox != NULL)
790 //create element description
791 wxCDMBlackBoxDescriptionPanel* description = new wxCDMBlackBoxDescriptionPanel(
794 ID_WINDOW_PROPERTIES,
795 wxT("Description Panel"),
801 if(this->panel_Properties!= NULL)
803 this->panel_Properties->Hide();
804 this->panel_Properties->Destroy();
805 auiManager.DetachPane(this->panel_Properties);
809 this->panel_Properties = description;
810 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
816 modelCDMCMakeListsFile* elementCMakeLists = dynamic_cast<modelCDMCMakeListsFile*>(element);
817 if(elementCMakeLists != NULL)
819 //create element description
820 wxCDMCMakeListsDescriptionPanel* description = new wxCDMCMakeListsDescriptionPanel(
823 ID_WINDOW_PROPERTIES,
824 wxT("Description Panel"),
830 if(this->panel_Properties!= NULL)
832 this->panel_Properties->Hide();
833 this->panel_Properties->Destroy();
834 auiManager.DetachPane(this->panel_Properties);
838 this->panel_Properties = description;
839 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
845 modelCDMFolder* elementFolder = dynamic_cast<modelCDMFolder*>(element);
846 if(elementFolder != NULL)
848 //create element description
849 wxCDMFolderDescriptionPanel* description = new wxCDMFolderDescriptionPanel(
852 ID_WINDOW_PROPERTIES,
853 wxT("Description Panel"),
859 if(this->panel_Properties!= NULL)
861 this->panel_Properties->Hide();
862 this->panel_Properties->Destroy();
863 auiManager.DetachPane(this->panel_Properties);
867 this->panel_Properties = description;
868 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
874 modelCDMFile* elementFile = dynamic_cast<modelCDMFile*>(element);
875 if(elementFile != NULL)
877 //create element description
878 wxCDMFileDescriptionPanel* description = new wxCDMFileDescriptionPanel(
881 ID_WINDOW_PROPERTIES,
882 wxT("Description Panel"),
888 if(this->panel_Properties!= NULL)
890 this->panel_Properties->Hide();
891 this->panel_Properties->Destroy();
892 auiManager.DetachPane(this->panel_Properties);
896 this->panel_Properties = description;
897 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
904 //create element description
905 wxCDMMainDescriptionPanel* description = new wxCDMMainDescriptionPanel(
907 ID_WINDOW_PROPERTIES,
908 wxT("Description Panel"),
914 if(this->panel_Properties!= NULL)
916 this->panel_Properties->Hide();
917 this->panel_Properties->Destroy();
918 auiManager.DetachPane(this->panel_Properties);
922 this->panel_Properties = description;
923 auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
930 void wxCDMMainFrame::OnCreationComplete(wxCommandEvent& event)
932 std::cout << "inMainFrame " << event.GetInt() << std::endl;
933 this->tree_Projects->SelectItem(event.GetInt());