+
+ //get selected element
+ wxTreeItemId elementId = event.GetItem();
+ //std::cout << "Tree Selection id: " << elementId.m_pItem << this->actualTreeItem.m_pItem << std::endl;
+ //elementId.IsOk() && this->tree_Projects->IsSelected(elementId)
+ if(elementId.IsOk() && this->actualTreeItem != elementId)
+ {
+
+ //std::cout << "Valid tree selection id: " << elementId.m_pItem << std::endl;
+ //get element from model
+ modelCDMIProjectTreeNode* element = this->model->GetModelElements()[elementId];
+
+ if (element == NULL)
+ return;
+ std::cout << "Tree Selection: " << element->GetName() << std::endl;
+
+ //std::stringstream ss;
+ //ss << this->actualTreeItem.m_pItem << ":" << event.GetOldItem().m_pItem << " --> " << elementId.m_pItem;
+ //wxMessageBox( wxT("Tree Selection id: " + ss.str() + " by " + element->GetName()), wxT("Refresh Project - Error"), wxICON_ERROR);
+ this->actualTreeItem = elementId;
+
+ //get element type
+ //project
+ modelCDMProject* elementProject = dynamic_cast<modelCDMProject*>(element);
+ wxPanel* description;
+ if(elementProject != NULL)
+ {
+ //create element description
+ description = new wxCDMProjectDescriptionPanel(
+ this,
+ elementProject,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ 0
+#else
+ wxSHOW_SB_ALWAYS | wxVSCROLL
+#endif
+ );
+
+ } else {
+ //appli
+ modelCDMAppli* elementAppli = dynamic_cast<modelCDMAppli*>(element);
+ if(elementAppli != NULL)
+ {
+ //create element description
+ description = new wxCDMAppliDescriptionPanel(
+ this,
+ elementAppli,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ 0
+#else
+ wxSHOW_SB_ALWAYS | wxVSCROLL
+#endif
+ );
+
+ } else {
+ //application
+ modelCDMApplication* elementApplication = dynamic_cast<modelCDMApplication*>(element);
+ if(elementApplication != NULL)
+ {
+ //create element description
+ description = new wxCDMApplicationDescriptionPanel(
+ this,
+ elementApplication,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ 0
+#else
+ wxSHOW_SB_ALWAYS | wxVSCROLL
+#endif
+ );
+ } else {
+ //lib
+ modelCDMLib* elementLib = dynamic_cast<modelCDMLib*>(element);
+ if(elementLib != NULL)
+ {
+ //create element description
+ description = new wxCDMLibDescriptionPanel(
+ this,
+ elementLib,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ 0
+#else
+ wxSHOW_SB_ALWAYS | wxVSCROLL
+#endif
+ );
+ } else {
+ //library
+ modelCDMLibrary* elementLibrary = dynamic_cast<modelCDMLibrary*>(element);
+ if(elementLibrary != NULL)
+ {
+ //create element description
+ description = new wxCDMLibraryDescriptionPanel(
+ this,
+ elementLibrary,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ 0
+#else
+ wxSHOW_SB_ALWAYS | wxVSCROLL
+#endif
+ );
+ } else {
+ //package
+ modelCDMPackage* elementPackage = dynamic_cast<modelCDMPackage*>(element);
+ if(elementPackage != NULL)
+ {
+ //create element description
+ description = new wxCDMPackageDescriptionPanel(
+ this,
+ elementPackage,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 100),
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ 0
+#else
+ wxSHOW_SB_ALWAYS | wxVSCROLL
+#endif
+ );
+
+
+ } else {
+ //black box
+ modelCDMBlackBox* elementBlackBox = dynamic_cast<modelCDMBlackBox*>(element);
+ if(elementBlackBox != NULL)
+ {
+ //create element description
+ description = new wxCDMBlackBoxDescriptionPanel(
+ this,
+ elementBlackBox,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ 0
+#else
+ wxSHOW_SB_ALWAYS | wxVSCROLL
+#endif
+ );
+ } else {
+ //CMakeLists
+ modelCDMCMakeListsFile* elementCMakeLists = dynamic_cast<modelCDMCMakeListsFile*>(element);
+ if(elementCMakeLists != NULL)
+ {
+ //create element description
+ description = new wxCDMCMakeListsDescriptionPanel(
+ this,
+ elementCMakeLists,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ 0
+#else
+ wxSHOW_SB_ALWAYS | wxVSCROLL
+#endif
+ );
+ } else {
+ //CodeFile
+ modelCDMCodeFile* elementCodeFile = dynamic_cast<modelCDMCodeFile*>(element);
+ if(elementCodeFile != NULL)
+ {
+ //create element description
+ description = new wxCDMCodeFileDescriptionPanel(
+ this,
+ elementCodeFile,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ 0
+#else
+ wxSHOW_SB_ALWAYS | wxVSCROLL
+#endif
+ );
+ } else {
+ //BBSFile
+ modelCDMBBSFile* elementBBSFile = dynamic_cast<modelCDMBBSFile*>(element);
+ if(elementBBSFile != NULL)
+ {
+ //create element description
+ description = new wxCDMBBSFileDescriptionPanel(
+ this,
+ elementBBSFile,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ 0
+#else
+ wxSHOW_SB_ALWAYS | wxVSCROLL
+#endif
+ );
+ } else {
+ //BBSFile
+ modelCDMBBGFile* elementBBGFile = dynamic_cast<modelCDMBBGFile*>(element);
+ if(elementBBGFile != NULL)
+ {
+ //create element description
+ description = new wxCDMBBGFileDescriptionPanel(
+ this,
+ elementBBGFile,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ 0
+#else
+ wxSHOW_SB_ALWAYS | wxVSCROLL
+#endif
+ );
+ } else {
+ //folder
+ modelCDMFolder* elementFolder = dynamic_cast<modelCDMFolder*>(element);
+ if(elementFolder != NULL)
+ {
+ //create element description
+ description = new wxCDMFolderDescriptionPanel(
+ this,
+ elementFolder,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ 0
+#else
+ wxSHOW_SB_ALWAYS | wxVSCROLL
+#endif
+ );
+ } else {
+ //file
+ modelCDMFile* elementFile = dynamic_cast<modelCDMFile*>(element);
+ if(elementFile != NULL)
+ {
+ //create element description
+ description = new wxCDMFileDescriptionPanel(
+ this,
+ elementFile,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ 0
+#else
+ wxSHOW_SB_ALWAYS | wxVSCROLL
+#endif
+ );
+ } else {
+ //main if not any
+ //create element description
+ description = new wxCDMMainDescriptionPanel(
+ this,
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(600, 400),
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+ 0
+#else
+ wxSHOW_SB_ALWAYS | wxVSCROLL
+#endif
+ );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ //delete old view
+ if(this->panel_Properties!= NULL)
+ {
+ this->panel_Properties->Hide();
+ auiManager.DetachPane(this->panel_Properties);
+ //this->panel_Properties->Destroy();
+ //this->panel_Properties = NULL;
+ }
+ //set new view
+ auiManager.AddPane(description, wxAuiPaneInfo().Center().Name(wxT("panel_Properties")).Caption(wxT("")).BestSize(600,400).CloseButton(false));
+ this->panel_Properties = description;
+
+ auiManager.Update();
+ } else {
+ event.Skip();
+ }
+
+ return;
+