From: Daniel Gonzalez Date: Mon, 3 Dec 2012 10:31:58 +0000 (+0100) Subject: Feature #1711 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=5dc4f3d992f59df3b049458a00d8d3071f434a50;p=crea.git Feature #1711 CreaDevManager application implementation Showing slected items' description panels. --- diff --git a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp index 0bb1df3..6910c32 100644 --- a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp @@ -35,7 +35,7 @@ #include "wxCDMAppliDescriptionPanel.h" #include "creaDevManagerIds.h" -#include "images/PrIcon.xpm" +#include "images/ApIcon.xpm" BEGIN_EVENT_TABLE(wxCDMAppliDescriptionPanel, wxPanel) EVT_MENU(ID_BUTTON_CREATE_APPLICATION, wxCDMAppliDescriptionPanel::OnBtnCreateApplication) @@ -83,7 +83,7 @@ void wxCDMAppliDescriptionPanel::CreateControls() sizer->Add(new wxStaticText(this, -1, _("Applications")),0, wxALIGN_CENTER, 0); //Image - sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(PrIcon)),0, wxALIGN_CENTER, 0); + sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(ApIcon)),0, wxALIGN_CENTER, 0); //Actions wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions")); diff --git a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp index 0070024..0aaa346 100644 --- a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp @@ -35,7 +35,7 @@ #include "wxCDMApplicationDescriptionPanel.h" #include "creaDevManagerIds.h" -#include "images/PrIcon.xpm" +#include "images/AIcon.xpm" BEGIN_EVENT_TABLE(wxCDMApplicationDescriptionPanel, wxPanel) EVT_MENU(ID_BUTTON_CREATE_FOLDER, wxCDMApplicationDescriptionPanel::OnBtnCreateFolder) @@ -83,7 +83,7 @@ void wxCDMApplicationDescriptionPanel::CreateControls() sizer->Add(new wxStaticText(this, -1, _("Project")),0, wxALIGN_CENTER, 0); //Image - sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(PrIcon)),0, wxALIGN_CENTER, 0); + sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(AIcon)),0, wxALIGN_CENTER, 0); //Project Name sizer->Add(new wxStaticText(this, -1, crea::std2wx(this->application->GetNameApplication())),0, wxALIGN_CENTER, 0); diff --git a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp index c9dd6bc..cdefeed 100644 --- a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp @@ -35,7 +35,7 @@ #include "wxCDMLibDescriptionPanel.h" #include "creaDevManagerIds.h" -#include "images/PrIcon.xpm" +#include "images/LbIcon.xpm" BEGIN_EVENT_TABLE(wxCDMLibDescriptionPanel, wxPanel) EVT_MENU(ID_BUTTON_CREATE_LIBRARY, wxCDMLibDescriptionPanel::OnBtnCreateLibrary) @@ -83,7 +83,7 @@ void wxCDMLibDescriptionPanel::CreateControls() sizer->Add(new wxStaticText(this, -1, _("Libraries")),0, wxALIGN_CENTER, 0); //Image - sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(PrIcon)),0, wxALIGN_CENTER, 0); + sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(LbIcon)),0, wxALIGN_CENTER, 0); //Actions wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions")); diff --git a/lib/creaDevManagerLib/wxCDMMainFrame.cpp b/lib/creaDevManagerLib/wxCDMMainFrame.cpp index d8ffea1..5538fa7 100755 --- a/lib/creaDevManagerLib/wxCDMMainFrame.cpp +++ b/lib/creaDevManagerLib/wxCDMMainFrame.cpp @@ -37,6 +37,13 @@ #include "creaDevManagerIds.h" #include "wxCDMMainDescriptionPanel.h" #include "wxCDMProjectDescriptionPanel.h" +#include "wxCDMAppliDescriptionPanel.h" +#include "wxCDMApplicationDescriptionPanel.h" +#include "wxCDMLibDescriptionPanel.h" +#include "wxCDMLibraryDescriptionPanel.h" +#include "wxCDMPackageDescriptionPanel.h" +#include "wxCDMBlackBoxDescriptionPanel.h" + #include "wxCDMProjectActionsPanel.h" #include "wxCDMNewProjectDialog.h" @@ -587,9 +594,234 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) std::cout << "Tree Selection: " << element->GetName() << std::endl; //TODO get element type - //TODO create element description - //TODO delete old view - //TODO set new view + //project + modelCDMProject* elementProject = dynamic_cast(element); + if(elementProject != NULL) + { + + //create element description + wxCDMProjectDescriptionPanel* description = new wxCDMProjectDescriptionPanel( + this, + elementProject, + ID_WINDOW_PROPERTIES, + wxT("Description Panel"), + wxDefaultPosition, + wxSize(300, 400), + 0 + ); + //delete old view + if(this->panel_Properties!= NULL) + { + this->panel_Properties->Hide(); + this->panel_Properties->Destroy(); + auiManager.DetachPane(this->panel_Properties); + } + //set new view + this->panel_Properties = description; + auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties")); + auiManager.Update(); + event.Skip(); + return; + } + //appli + modelCDMAppli* elementAppli = dynamic_cast(element); + if(elementAppli != NULL) + { + //create element description + wxCDMAppliDescriptionPanel* description = new wxCDMAppliDescriptionPanel( + this, + elementAppli, + ID_WINDOW_PROPERTIES, + wxT("Description Panel"), + wxDefaultPosition, + wxSize(300, 400), + 0 + ); + //delete old view + if(this->panel_Properties!= NULL) + { + this->panel_Properties->Hide(); + this->panel_Properties->Destroy(); + auiManager.DetachPane(this->panel_Properties); + } + //set new view + this->panel_Properties = description; + auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties")); + auiManager.Update(); + event.Skip(); + return; + } + //application + modelCDMApplication* elementApplication = dynamic_cast(element); + if(elementApplication != NULL) + { + //create element description + wxCDMApplicationDescriptionPanel* description = new wxCDMApplicationDescriptionPanel( + this, + elementApplication, + ID_WINDOW_PROPERTIES, + wxT("Description Panel"), + wxDefaultPosition, + wxSize(300, 400), + 0 + ); + //delete old view + if(this->panel_Properties!= NULL) + { + this->panel_Properties->Hide(); + this->panel_Properties->Destroy(); + auiManager.DetachPane(this->panel_Properties); + + } + //set new view + this->panel_Properties = description; + auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties")); + auiManager.Update(); + event.Skip(); + return; + } + //lib + modelCDMLib* elementLib = dynamic_cast(element); + if(elementLib != NULL) + { + //create element description + wxCDMLibDescriptionPanel* description = new wxCDMLibDescriptionPanel( + this, + elementLib, + ID_WINDOW_PROPERTIES, + wxT("Description Panel"), + wxDefaultPosition, + wxSize(300, 400), + 0 + ); + //delete old view + if(this->panel_Properties!= NULL) + { + this->panel_Properties->Hide(); + this->panel_Properties->Destroy(); + auiManager.DetachPane(this->panel_Properties); + + } + //set new view + this->panel_Properties = description; + auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties")); + auiManager.Update(); + event.Skip(); + return; + } + //library + modelCDMLibrary* elementLibrary = dynamic_cast(element); + if(elementLibrary != NULL) + { + //create element description + wxCDMLibraryDescriptionPanel* description = new wxCDMLibraryDescriptionPanel( + this, + elementLibrary, + ID_WINDOW_PROPERTIES, + wxT("Description Panel"), + wxDefaultPosition, + wxSize(300, 400), + 0 + ); + //delete old view + if(this->panel_Properties!= NULL) + { + this->panel_Properties->Hide(); + this->panel_Properties->Destroy(); + auiManager.DetachPane(this->panel_Properties); + + } + //set new view + this->panel_Properties = description; + auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties")); + auiManager.Update(); + event.Skip(); + return; + } + //package + modelCDMPackage* elementPackage = dynamic_cast(element); + if(elementPackage != NULL) + { + //create element description + wxCDMPackageDescriptionPanel* description = new wxCDMPackageDescriptionPanel( + this, + elementPackage, + ID_WINDOW_PROPERTIES, + wxT("Description Panel"), + wxDefaultPosition, + wxSize(300, 400), + 0 + ); + //delete old view + if(this->panel_Properties!= NULL) + { + this->panel_Properties->Hide(); + this->panel_Properties->Destroy(); + auiManager.DetachPane(this->panel_Properties); + + } + //set new view + this->panel_Properties = description; + auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties")); + auiManager.Update(); + event.Skip(); + return; + } + //black box + modelCDMBlackBox* elementBlackBox = dynamic_cast(element); + if(elementBlackBox != NULL) + { + //create element description + wxCDMBlackBoxDescriptionPanel* description = new wxCDMBlackBoxDescriptionPanel( + this, + elementBlackBox, + ID_WINDOW_PROPERTIES, + wxT("Description Panel"), + wxDefaultPosition, + wxSize(300, 400), + 0 + ); + //delete old view + if(this->panel_Properties!= NULL) + { + this->panel_Properties->Hide(); + this->panel_Properties->Destroy(); + auiManager.DetachPane(this->panel_Properties); + + } + //set new view + this->panel_Properties = description; + auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties")); + auiManager.Update(); + event.Skip(); + return; + } + //TODO: CMakeLists + //TODO: folder + //TODO: file + //TODO: main + //create element description + wxCDMMainDescriptionPanel* description = new wxCDMMainDescriptionPanel( + this, + ID_WINDOW_PROPERTIES, + wxT("Description Panel"), + wxDefaultPosition, + wxSize(300, 400), + 0 + ); + //delete old view + if(this->panel_Properties!= NULL) + { + this->panel_Properties->Hide(); + this->panel_Properties->Destroy(); + auiManager.DetachPane(this->panel_Properties); + + } + //set new view + this->panel_Properties = description; + auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties")); + auiManager.Update(); event.Skip(); + return; }