]> Creatis software - crea.git/commitdiff
Feature #1711
authorDaniel Gonzalez <daniel@daniel.creatis>
Mon, 3 Dec 2012 10:31:58 +0000 (11:31 +0100)
committerDaniel Gonzalez <daniel@daniel.creatis>
Mon, 3 Dec 2012 10:31:58 +0000 (11:31 +0100)
CreaDevManager application implementation

Showing slected items' description panels.

lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMMainFrame.cpp

index 0bb1df3c727d5ba7c85c300f9f4e7f2f110aee99..6910c32298a1626287399e2b2ee2215d9642bbd4 100644 (file)
@@ -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"));
index 0070024121de67d477ec32d3901afeee2f6ff333..0aaa346da8260b4c08b342736d52b64190194b91 100644 (file)
@@ -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);
index c9dd6bc54669f5c2582d3fe553569bdd8501155f..cdefeed299e315e21309543469b58e80f95ef8f2 100644 (file)
@@ -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"));
index d8ffea1e4f50b10728a563145b306e437f4bd434..5538fa7052148011c283fce66a2d3924c78f86d2 100755 (executable)
 #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<modelCDMProject*>(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<modelCDMAppli*>(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<modelCDMApplication*>(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<modelCDMLib*>(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<modelCDMLibrary*>(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<modelCDMPackage*>(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<modelCDMBlackBox*>(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;
 
 }