]> Creatis software - crea.git/commitdiff
Feature #1711
authorDaniel Gonzalez <daniel.gonzalez@creatis.insa-lyon.fr>
Tue, 15 Jan 2013 10:59:19 +0000 (11:59 +0100)
committerDaniel Gonzalez <daniel.gonzalez@creatis.insa-lyon.fr>
Tue, 15 Jan 2013 10:59:19 +0000 (11:59 +0100)
CreaDevManager application implementation

-Breadcrumbs implemented in all children views.

45 files changed:
lib/creaDevManagerLib/modelCDMAppli.cpp
lib/creaDevManagerLib/modelCDMAppli.h
lib/creaDevManagerLib/modelCDMApplication.cpp
lib/creaDevManagerLib/modelCDMApplication.h
lib/creaDevManagerLib/modelCDMBlackBox.cpp
lib/creaDevManagerLib/modelCDMBlackBox.h
lib/creaDevManagerLib/modelCDMCMakeListsFile.cpp
lib/creaDevManagerLib/modelCDMCMakeListsFile.h
lib/creaDevManagerLib/modelCDMFile.cpp
lib/creaDevManagerLib/modelCDMFile.h
lib/creaDevManagerLib/modelCDMFolder.cpp
lib/creaDevManagerLib/modelCDMFolder.h
lib/creaDevManagerLib/modelCDMIProjectTreeNode.cpp
lib/creaDevManagerLib/modelCDMIProjectTreeNode.h
lib/creaDevManagerLib/modelCDMLib.cpp
lib/creaDevManagerLib/modelCDMLib.h
lib/creaDevManagerLib/modelCDMLibrary.cpp
lib/creaDevManagerLib/modelCDMLibrary.h
lib/creaDevManagerLib/modelCDMMain.cpp
lib/creaDevManagerLib/modelCDMPackage.cpp
lib/creaDevManagerLib/modelCDMPackage.h
lib/creaDevManagerLib/modelCDMPackageSrc.cpp
lib/creaDevManagerLib/modelCDMPackageSrc.h
lib/creaDevManagerLib/modelCDMProject.cpp
lib/creaDevManagerLib/modelCDMProject.h
lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.h
lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.h
lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.h
lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.h
lib/creaDevManagerLib/wxCDMFileDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMFileDescriptionPanel.h
lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.h
lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMLibDescriptionPanel.h
lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.h
lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp
lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.h
lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp
lib/creaDevManagerLib/wxCDMPackageManagerPanel.h

index 417392792399e8024b7eed70ae5b7101c762f655..7669853356dd585c5e5a207abb3c7e82e1706221 100644 (file)
@@ -46,9 +46,10 @@ modelCDMAppli::modelCDMAppli()
 {
 }
 
-modelCDMAppli::modelCDMAppli(const std::string& path, const std::string& name, const int& level)
+modelCDMAppli::modelCDMAppli(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level)
 {
   std::cout << "creating appli\n";
+  this->parent = parent;
   this->type = wxDIR_DIRS;
   this->name = name;
   this->level = level;
@@ -71,13 +72,13 @@ modelCDMAppli::modelCDMAppli(const std::string& path, const std::string& name, c
 
           if(stdfileName != "template_appli" && stdfileName != "template_wx_appli")
             {
-              modelCDMApplication* application = new modelCDMApplication(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              modelCDMApplication* application = new modelCDMApplication(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->applications.push_back(application);
               this->children.push_back(application);
             }
           else
             {
-              modelCDMFolder* folder = new modelCDMFolder(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              modelCDMFolder* folder = new modelCDMFolder(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(folder);
             }
 
@@ -92,13 +93,13 @@ modelCDMAppli::modelCDMAppli(const std::string& path, const std::string& name, c
           //if CMakeLists, create CMakeLists
           if(stdfileName == "CMakeLists.txt")
             {
-              this->CMakeLists = new modelCDMCMakeListsFile(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              this->CMakeLists = new modelCDMCMakeListsFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(this->CMakeLists);
             }
           //if is an unknown file, create file
           else
             {
-              this->children.push_back(new modelCDMFile(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
+              this->children.push_back(new modelCDMFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
             }
 
           cont = dir.GetNext(&fileName);
@@ -156,7 +157,7 @@ modelCDMApplication* modelCDMAppli::CreateApplication(
     }
 
   //add application to model
-  modelCDMApplication* application = new modelCDMApplication(this->path + CDMUtilities::SLASH + name, name, this->level + 1);
+  modelCDMApplication* application = new modelCDMApplication(this, this->path + CDMUtilities::SLASH + name, name, this->level + 1);
   this->applications.push_back(application);
   this->children.push_back(application);
 
@@ -203,7 +204,7 @@ const bool modelCDMAppli::Refresh(std::string*& result)
                 }
               if(!found)
                 {
-                  modelCDMApplication* application= new modelCDMApplication(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMApplication* application= new modelCDMApplication(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->applications.push_back(application);
                   this->children.push_back(application);
                 }
@@ -225,7 +226,7 @@ const bool modelCDMAppli::Refresh(std::string*& result)
                 }
               if(!found)
                 {
-                  modelCDMFolder* folder= new modelCDMFolder(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMFolder* folder= new modelCDMFolder(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(folder);
                 }
             }
@@ -242,7 +243,7 @@ const bool modelCDMAppli::Refresh(std::string*& result)
             {
               if (this->CMakeLists == NULL)
                 {
-                  this->CMakeLists = new modelCDMCMakeListsFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  this->CMakeLists = new modelCDMCMakeListsFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(this->CMakeLists);
                 }
               else
@@ -270,7 +271,7 @@ const bool modelCDMAppli::Refresh(std::string*& result)
 
               if(!found)
                 {
-                  modelCDMFile* file = new modelCDMFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMFile* file = new modelCDMFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(file);
                 }
             }
index 5d378b9e83519e8ebe913dd894c84c7396f9fd47..d5df81e501b70672da32cbbc8a91d43ad3a8e6a3 100644 (file)
@@ -45,7 +45,7 @@ class modelCDMAppli : public modelCDMFolder
 {
 public:
   modelCDMAppli();
-  modelCDMAppli(const std::string& path, const std::string& name = "appli", const int& level = 1);
+  modelCDMAppli(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name = "appli", const int& level = 1);
   ~modelCDMAppli();
 
   const std::vector<modelCDMApplication*>& GetApplications() const;
index d88e25704411fce97eea9a2d519c334ff837f12e..19cc293cd8543dca53f9a74e2fdb8d5ac8ce6566 100644 (file)
@@ -46,9 +46,10 @@ modelCDMApplication::modelCDMApplication()
   mainFile = NULL;
 }
 
-modelCDMApplication::modelCDMApplication(const std::string& path, const std::string& name, const int& level)
+modelCDMApplication::modelCDMApplication(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level)
 {
   std::cout << "creating application: " + path + "\n";
+  this->parent = parent;
   this->mainFile = NULL;
   //folder name
   this->name = name;
@@ -104,7 +105,7 @@ modelCDMApplication::modelCDMApplication(const std::string& path, const std::str
         {
           std::string stdfileName = crea::wx2std(fileName);
 
-          modelCDMFolder* folder = new modelCDMFolder(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+          modelCDMFolder* folder = new modelCDMFolder(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
           this->folders.push_back(folder);
           this->children.push_back(folder);
 
@@ -119,13 +120,13 @@ modelCDMApplication::modelCDMApplication(const std::string& path, const std::str
           //if CMakeLists, create CMakeLists
           if(stdfileName == "CMakeLists.txt")
             {
-              this->CMakeLists = new modelCDMCMakeListsFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              this->CMakeLists = new modelCDMCMakeListsFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(this->CMakeLists);
             }
           //if is an unknown file, create file
           else
             {
-              modelCDMFile* file = new modelCDMFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              modelCDMFile* file = new modelCDMFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               std::string extension = stdfileName.substr(stdfileName.size()-4);
               if (mainFile == NULL && (extension == ".cxx" || extension == ".cpp"))
                 {
@@ -224,7 +225,7 @@ modelCDMFolder* modelCDMApplication::CreateFolder(const std::string& name, std::
       result = new std::string("Error executing: " + command + ".");
       return NULL;
     }
-  modelCDMFolder* folder = new modelCDMFolder(path + CDMUtilities::SLASH + name, name, level + 1);
+  modelCDMFolder* folder = new modelCDMFolder(this, path + CDMUtilities::SLASH + name, name, level + 1);
   this->folders.push_back(folder);
   this->children.push_back(folder);
 
@@ -302,7 +303,7 @@ const bool modelCDMApplication::Refresh(std::string*& result)
             }
           if(!found)
             {
-              modelCDMFolder* folder = new modelCDMFolder(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              modelCDMFolder* folder = new modelCDMFolder(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->folders.push_back(folder);
               this->children.push_back(folder);
             }
@@ -319,7 +320,7 @@ const bool modelCDMApplication::Refresh(std::string*& result)
             {
               if (this->CMakeLists == NULL)
                 {
-                  this->CMakeLists = new modelCDMCMakeListsFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  this->CMakeLists = new modelCDMCMakeListsFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(this->CMakeLists);
                 }
               else
@@ -368,7 +369,7 @@ const bool modelCDMApplication::Refresh(std::string*& result)
 
               if(!found)
                 {
-                  modelCDMFile* file = new modelCDMFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMFile* file = new modelCDMFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
 
                   std::string extension = stdfileName.substr(stdfileName.size()-4);
                   if (mainFile == NULL && (extension == ".cxx" || extension == ".cpp"))
index 98399487cba8a683d36adfe83a3d99fb4175de5a..4935676ef0ee3c3c814e5bdec2d11923ba39d1c5 100644 (file)
@@ -45,7 +45,7 @@ class modelCDMApplication : public modelCDMFolder
 {
 public:
   modelCDMApplication();
-  modelCDMApplication(const std::string& path, const std::string& name, const int& level = 2);
+  modelCDMApplication(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level = 2);
   ~modelCDMApplication();
 
   const std::string& GetExecutableName() const;
index daec9d4b8bf864997ad72cec4e5df6e2c2813619..c92c6777725e724c3729b679b9cfebeb8eb4c5d2 100644 (file)
@@ -47,9 +47,10 @@ modelCDMBlackBox::modelCDMBlackBox()
   this->header = NULL;
 }
 
-modelCDMBlackBox::modelCDMBlackBox(const std::string& path, const std::string& name, const int& level)
+modelCDMBlackBox::modelCDMBlackBox(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level)
 {
   std::cout << "creating black box: " + name + " in " + path + "\n";
+  this->parent = parent;
   this->name = name;
   this->path = path;
   this->level = level;
index c58b16739dbbe887fea211dc7ffcc1a22393d4c7..ff8ed18b212537d782d6ced0161624c8b554fdc3 100644 (file)
@@ -43,7 +43,7 @@ class modelCDMBlackBox : public modelCDMFolder
 {
 public:
   modelCDMBlackBox();
-  modelCDMBlackBox(const std::string& path, const std::string& name, const int& level = 1);
+  modelCDMBlackBox(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level = 1);
   ~modelCDMBlackBox();
 
   const std::string& GetNameBlackBox() const;
index 72b1cdf4378bdc7d379065177cf09811a698e7b6..2dc48b478d29cdaac5926dc1655e42bcad209e79 100644 (file)
@@ -45,9 +45,10 @@ modelCDMCMakeListsFile::modelCDMCMakeListsFile()
 {
 }
 
-modelCDMCMakeListsFile::modelCDMCMakeListsFile(const std::string& path, const std::string& name, const int& level)
+modelCDMCMakeListsFile::modelCDMCMakeListsFile(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level)
 {
   std::cout << "creating cmakelist file: " + path + "\n";
+  this->parent = parent;
   this->children.clear();
   this->level = level;
   this->type = wxDIR_FILES;
index 65f034fb86b3b6bd22888392ba84f32496ad58d6..ac9ce71123258571c7b45219a6503cf35f10321b 100644 (file)
@@ -41,7 +41,7 @@ class modelCDMCMakeListsFile : public modelCDMFile
 {
 public:
   modelCDMCMakeListsFile();
-  modelCDMCMakeListsFile(const std::string& path, const std::string& name = "CMakeLists.txt", const int& level = 1);
+  modelCDMCMakeListsFile(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name = "CMakeLists.txt", const int& level = 1);
   ~modelCDMCMakeListsFile();
 
   bool OpenFile(std::string*& result);
index 3f92ffe9b29a2a81e43b41db285c0860092ff0be..dcafc8e1c8e0995babff83ef93376d0e6d294f69 100644 (file)
@@ -44,9 +44,10 @@ modelCDMFile::modelCDMFile()
 {
 }
 
-modelCDMFile::modelCDMFile(const std::string& path, const std::string& name, const int& level)
+modelCDMFile::modelCDMFile(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level)
 {
   std::cout << "creating file: " + path + "\n";
+  this->parent = parent;
   this->children.clear();
   this->level = level;
   this->name = name;
index f521608ea8060ee4eeefd6ed1138cce60d8f2009..3f03f29ac7e444e3eabd5e6c0db1454dfd017e0c 100644 (file)
@@ -44,7 +44,7 @@ class modelCDMFile : public modelCDMIProjectTreeNode
 {
 public:
   modelCDMFile();
-  modelCDMFile(const std::string& path, const std::string& name, const int& level = 3);
+  modelCDMFile(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level = 3);
   ~modelCDMFile();
 
   bool OpenFile(std::string* & result, const std::string& command = "");
index c97b129d005da0033615ff9221ed2040899788e5..ca83e0550eb114af6075c73e0e98d51631004350 100644 (file)
@@ -47,10 +47,11 @@ modelCDMFolder::modelCDMFolder()
   this->CMakeLists = NULL;
 }
 
-modelCDMFolder::modelCDMFolder(const std::string& path, const std::string& name, const int& level)
+modelCDMFolder::modelCDMFolder(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level)
 {
   std::cout << "creating folder: " + path + "\n";
   //set attributes
+  this->parent = parent;
   this->children.clear();
   this->level = level;
   this->CMakeLists = NULL;
@@ -71,7 +72,7 @@ modelCDMFolder::modelCDMFolder(const std::string& path, const std::string& name,
           std::string stdfileName = crea::wx2std(fileName);
 
           //if is an unknown folder, create folder
-          modelCDMFolder* folder = new modelCDMFolder(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+          modelCDMFolder* folder = new modelCDMFolder(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
           this->children.push_back(folder);
           this->folders.push_back(folder);
 
@@ -86,12 +87,12 @@ modelCDMFolder::modelCDMFolder(const std::string& path, const std::string& name,
           //if CMakeLists, create CMakeLists
           if(stdfileName == "CMakeLists.txt")
             {
-              this->CMakeLists = new modelCDMCMakeListsFile(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              this->CMakeLists = new modelCDMCMakeListsFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(this->CMakeLists);
             }
           else
             {
-              this->children.push_back(new modelCDMFile(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
+              this->children.push_back(new modelCDMFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
             }
           //if is an unknown file, create file
           cont = dir.GetNext(&fileName);
@@ -125,8 +126,8 @@ bool modelCDMFolder::CreateClass(const std::string& name)
       }
     else
       {
-        this->children.push_back(new modelCDMFile(this->path + CDMUtilities::SLASH + name + ".h", name + ".h", this->level + 1));
-        this->children.push_back(new modelCDMFile(this->path + CDMUtilities::SLASH + name + ".cpp", name + ".cpp", this->level + 1));
+        this->children.push_back(new modelCDMFile(this, this->path + CDMUtilities::SLASH + name + ".h", name + ".h", this->level + 1));
+        this->children.push_back(new modelCDMFile(this, this->path + CDMUtilities::SLASH + name + ".cpp", name + ".cpp", this->level + 1));
         this->SortChildren();
         return true;
       }
@@ -141,7 +142,7 @@ modelCDMFolder* modelCDMFolder::CreateFolder(const std::string& name, std::strin
       result = new std::string("Error executing: " + command + ".");
       return NULL;
     }
-  modelCDMFolder* folder = new modelCDMFolder(path + CDMUtilities::SLASH + name, name, level + 1);
+  modelCDMFolder* folder = new modelCDMFolder(this, path + CDMUtilities::SLASH + name, name, level + 1);
   this->folders.push_back(folder);
   this->children.push_back(folder);
 
@@ -199,7 +200,7 @@ const bool modelCDMFolder::Refresh(std::string*& result)
             }
           if(!found)
             {
-              modelCDMFolder* folder = new modelCDMFolder(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              modelCDMFolder* folder = new modelCDMFolder(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->folders.push_back(folder);
               this->children.push_back(folder);
             }
@@ -216,7 +217,7 @@ const bool modelCDMFolder::Refresh(std::string*& result)
             {
               if (this->CMakeLists == NULL)
                 {
-                  this->CMakeLists = new modelCDMCMakeListsFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  this->CMakeLists = new modelCDMCMakeListsFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(this->CMakeLists);
                 }
               else
@@ -245,7 +246,7 @@ const bool modelCDMFolder::Refresh(std::string*& result)
 
               if(!found)
                 {
-                  modelCDMFile* file = new modelCDMFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMFile* file = new modelCDMFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(file);
                 }
             }
index 07565009b1e5b3bf01bb0ba14b4d1da608312dfd..e3c8afc67e0c32f81b084755ca7386659fea82ec 100644 (file)
@@ -45,7 +45,7 @@ class modelCDMFolder : public modelCDMIProjectTreeNode
 {
 public:
   modelCDMFolder();
-  modelCDMFolder(const std::string& path, const std::string& name, const int& level = 3);
+  modelCDMFolder(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level = 3);
   ~modelCDMFolder();
 
   modelCDMCMakeListsFile* GetCMakeLists() const;
index fb02b7134175771239231defaec764f14c20461f..e7edd2bcc80766b6e3fa01a1c529e55931074137 100644 (file)
@@ -109,6 +109,24 @@ const int& modelCDMIProjectTreeNode::GetLevel() const
   return this->level;
 }
 
+modelCDMIProjectTreeNode* modelCDMIProjectTreeNode::GetParent() const
+{
+  return this->parent;
+}
+
+std::vector<modelCDMIProjectTreeNode*> modelCDMIProjectTreeNode::GetParents() const
+{
+  std::vector<modelCDMIProjectTreeNode*> family;
+  modelCDMIProjectTreeNode* someFamily = this->parent;
+  while(someFamily != NULL)
+    {
+      family.push_back(someFamily);
+      someFamily = someFamily->GetParent();
+    }
+  return family;
+
+}
+
 const std::vector<modelCDMIProjectTreeNode*>& modelCDMIProjectTreeNode::GetChildren() const
 {
   return this->children;
index 6d5c680f0dfca9b6c3336062a8a53f78690028f2..eca8088c93c981b6d3bb4d9453b9207c3952d435 100644 (file)
@@ -52,6 +52,8 @@ public:
   const std::string& GetName() const;
   const unsigned char& GetType() const;
   const int& GetLevel() const;
+  modelCDMIProjectTreeNode* GetParent() const;
+  std::vector<modelCDMIProjectTreeNode*> GetParents() const;
   const std::vector<modelCDMIProjectTreeNode*>& GetChildren() const;
   const int& GetLength();
   void SetId(const wxTreeItemId& id);
@@ -68,6 +70,7 @@ protected:
   unsigned char type;
   int level;
   int length;
+  modelCDMIProjectTreeNode* parent;
   std::vector<modelCDMIProjectTreeNode*> children;
 
 };
index 16211eed4ade6c269d87e23b93971cda679d397a..a040ae8b05ce283062bbb253792d723a4ea40001 100644 (file)
@@ -45,9 +45,10 @@ modelCDMLib::modelCDMLib()
 {
 }
 
-modelCDMLib::modelCDMLib(const std::string& path, const std::string& name, const int& level)
+modelCDMLib::modelCDMLib(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level)
 {
   std::cout << "creating lib\n";
+  this->parent = parent;
   this->type = wxDIR_DIRS;
   this->name = name;
   this->level = level;
@@ -72,13 +73,13 @@ modelCDMLib::modelCDMLib(const std::string& path, const std::string& name, const
 
           if(stdfileName != "template_lib")
             {
-              modelCDMLibrary* library = new modelCDMLibrary(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              modelCDMLibrary* library = new modelCDMLibrary(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->libraries.push_back(library);
               this->children.push_back(library);
             }
           else
             {
-              modelCDMFolder* folder = new modelCDMFolder(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              modelCDMFolder* folder = new modelCDMFolder(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(folder);
             }
 
@@ -93,13 +94,13 @@ modelCDMLib::modelCDMLib(const std::string& path, const std::string& name, const
           //if CMakeLists, create CMakeLists
           if(stdfileName == "CMakeLists.txt")
             {
-              this->CMakeLists = new modelCDMCMakeListsFile(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              this->CMakeLists = new modelCDMCMakeListsFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(this->CMakeLists);
             }
           //if is an unknown file, create file
           else
             {
-              this->children.push_back(new modelCDMFile(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
+              this->children.push_back(new modelCDMFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
             }
 
           cont = dir.GetNext(&fileName);
@@ -156,7 +157,7 @@ modelCDMLibrary* modelCDMLib::CreateLibrary(
     }
 
   //add library to model
-  modelCDMLibrary* library = new modelCDMLibrary(this->path + CDMUtilities::SLASH + name, name, this->level + 1);
+  modelCDMLibrary* library = new modelCDMLibrary(this, this->path + CDMUtilities::SLASH + name, name, this->level + 1);
   this->libraries.push_back(library);
   this->children.push_back(library);
 
@@ -205,7 +206,7 @@ const bool modelCDMLib::Refresh(std::string*& result)
                 }
               if(!found)
                 {
-                  modelCDMLibrary* library = new modelCDMLibrary(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMLibrary* library = new modelCDMLibrary(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->libraries.push_back(library);
                   this->children.push_back(library);
                 }
@@ -226,7 +227,7 @@ const bool modelCDMLib::Refresh(std::string*& result)
                 }
               if(!found)
                 {
-                  modelCDMFolder* folder= new modelCDMFolder(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMFolder* folder= new modelCDMFolder(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(folder);
                 }
             }
@@ -243,7 +244,7 @@ const bool modelCDMLib::Refresh(std::string*& result)
             {
               if (this->CMakeLists == NULL)
                 {
-                  this->CMakeLists = new modelCDMCMakeListsFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  this->CMakeLists = new modelCDMCMakeListsFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(this->CMakeLists);
                 }
               else
@@ -271,7 +272,7 @@ const bool modelCDMLib::Refresh(std::string*& result)
 
               if(!found)
                 {
-                  modelCDMFile* file = new modelCDMFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMFile* file = new modelCDMFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(file);
                 }
             }
index 59d11964afa0b8550c995a421c14f7891090658f..49722b10b4d3618604a19625575a5bf21d0e0d29 100644 (file)
@@ -45,7 +45,7 @@ class modelCDMLib : public modelCDMFolder
 {
 public:
   modelCDMLib();
-  modelCDMLib(const std::string& path, const std::string& name = "lib", const int& level = 1);
+  modelCDMLib(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name = "lib", const int& level = 1);
   ~modelCDMLib();
 
   const std::vector<modelCDMLibrary*>& GetLibraries() const;
index 1964e882c02b6ab3192b5978c7c9139403200db6..3e47717084a83704c810d283af8337df36b9eedf 100644 (file)
@@ -45,9 +45,10 @@ modelCDMLibrary::modelCDMLibrary()
 {
 }
 
-modelCDMLibrary::modelCDMLibrary(const std::string& path, const std::string& name, const int& level)
+modelCDMLibrary::modelCDMLibrary(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level)
 {
   std::cout << "creating library: " + path + "\n";
+  this->parent = parent;
   //folder name
   this->name = name;
   //path
@@ -104,7 +105,7 @@ modelCDMLibrary::modelCDMLibrary(const std::string& path, const std::string& nam
         {
           std::string stdfileName = crea::wx2std(fileName);
 
-          modelCDMFolder* folder = new modelCDMFolder(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+          modelCDMFolder* folder = new modelCDMFolder(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
           this->folders.push_back(folder);
           this->children.push_back(folder);
 
@@ -119,13 +120,13 @@ modelCDMLibrary::modelCDMLibrary(const std::string& path, const std::string& nam
           //if CMakeLists, create CMakeLists
           if(stdfileName == "CMakeLists.txt")
             {
-              this->CMakeLists = new modelCDMCMakeListsFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              this->CMakeLists = new modelCDMCMakeListsFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(this->CMakeLists);
             }
           //if is an unknown file, create file
           else
             {
-              this->children.push_back(new modelCDMFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
+              this->children.push_back(new modelCDMFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
             }
 
           cont = dir.GetNext(&fileName);
@@ -199,7 +200,7 @@ modelCDMFolder* modelCDMLibrary::CreateFolder(const std::string& name, std::stri
         result = new std::string("Error executing: " + command + ".");
         return NULL;
       }
-    modelCDMFolder* folder = new modelCDMFolder(path + CDMUtilities::SLASH + name, name, level + 1);
+    modelCDMFolder* folder = new modelCDMFolder(this, path + CDMUtilities::SLASH + name, name, level + 1);
     this->folders.push_back(folder);
     this->children.push_back(folder);
 
@@ -275,7 +276,7 @@ const bool modelCDMLibrary::Refresh(std::string*& result)
             }
           if(!found)
             {
-              modelCDMFolder* folder = new modelCDMFolder(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              modelCDMFolder* folder = new modelCDMFolder(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->folders.push_back(folder);
               this->children.push_back(folder);
             }
@@ -292,7 +293,7 @@ const bool modelCDMLibrary::Refresh(std::string*& result)
             {
               if (this->CMakeLists == NULL)
                 {
-                  this->CMakeLists = new modelCDMCMakeListsFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  this->CMakeLists = new modelCDMCMakeListsFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(this->CMakeLists);
                 }
               else
@@ -320,7 +321,7 @@ const bool modelCDMLibrary::Refresh(std::string*& result)
 
               if(!found)
                 {
-                  modelCDMFile* file = new modelCDMFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMFile* file = new modelCDMFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(file);
                 }
             }
index 728b5c93970703cccb7b833a1e85924dc5943914..fb3b7d9224bd1a81907d4d9eb8af06105bc0fdac 100644 (file)
@@ -44,7 +44,7 @@ class modelCDMLibrary : public modelCDMFolder
 {
 public:
   modelCDMLibrary();
-  modelCDMLibrary(const std::string& path, const std::string& name, const int& level = 2);
+  modelCDMLibrary(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level = 2);
   ~modelCDMLibrary();
 
   const std::string& GetNameLibrary() const;
index 7537c467087aa819e3d804f167e574ada9dddbe0..e856fd2bae2f847f2d318a55bee08a3679283cfc 100644 (file)
@@ -139,7 +139,7 @@ bool modelCDMMain::CreateProject(
         return false;
     }
 
-  this->project = new modelCDMProject(nomDirectory, name);
+  this->project = new modelCDMProject(NULL, nomDirectory, name);
 
 #endif
 
@@ -234,11 +234,11 @@ bool modelCDMMain::OpenProject(
         {
           std::cout << ", and built in: " << pathBuild << std::endl;
 
-          this->project = new modelCDMProject(pathSource, words[words.size()-1], pathBuild);
+          this->project = new modelCDMProject(NULL, pathSource, words[words.size()-1], pathBuild);
         }
       else
         {
-          this->project = new modelCDMProject(pathSource, words[words.size()-1]);
+          this->project = new modelCDMProject(NULL, pathSource, words[words.size()-1]);
         }
     }
   else
index cd24c04f04b8df0e69bc3f90c22e9a9dcd1a6b41..093d610aff00757e6789523772ab6fb0d6025d4a 100644 (file)
@@ -46,9 +46,10 @@ modelCDMPackage::modelCDMPackage()
   this->src = NULL;
 }
 
-modelCDMPackage::modelCDMPackage(const std::string& path, const std::string& name, const int& level)
+modelCDMPackage::modelCDMPackage(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level)
 {
   std::cout << "creating package: " + path + "\n";
+  this->parent = parent;
   this->type = wxDIR_DIRS;
   this->name = name;
   //Get Package Name
@@ -139,12 +140,12 @@ modelCDMPackage::modelCDMPackage(const std::string& path, const std::string& nam
           //if src, check for black boxes
           if(stdfileName == "src")
             {
-              this->src = new modelCDMPackageSrc(path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              this->src = new modelCDMPackageSrc(this, path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(this->src);
             }
           else
             {
-              this->children.push_back(new modelCDMFolder(path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
+              this->children.push_back(new modelCDMFolder(this, path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
             }
 
           cont = dir.GetNext(&fileName);
@@ -159,12 +160,12 @@ modelCDMPackage::modelCDMPackage(const std::string& path, const std::string& nam
           //if CMakeLists, create CMakeLists
           if(stdfileName == "CMakeLists.txt")
             {
-              this->CMakeLists = new modelCDMCMakeListsFile(path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              this->CMakeLists = new modelCDMCMakeListsFile(this, path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(this->CMakeLists);
             }
           else
             {
-              this->children.push_back(new modelCDMFile(path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
+              this->children.push_back(new modelCDMFile(this, path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
             }
           //if is an unknown file, create file
           cont = dir.GetNext(&fileName);
@@ -473,7 +474,7 @@ const bool modelCDMPackage::Refresh(std::string*& result)
                 }
               else
                 {
-                  this->src = new modelCDMPackageSrc(path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level +1);
+                  this->src = new modelCDMPackageSrc(this, path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level +1);
                   this->children.push_back(this->src);
                 }
             }
@@ -494,7 +495,7 @@ const bool modelCDMPackage::Refresh(std::string*& result)
                 }
               if(!found)
                 {
-                  modelCDMFolder* folder = new modelCDMFolder(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMFolder* folder = new modelCDMFolder(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(folder);
                 }
             }
@@ -512,7 +513,7 @@ const bool modelCDMPackage::Refresh(std::string*& result)
             {
               if (this->CMakeLists == NULL)
                 {
-                  this->CMakeLists = new modelCDMCMakeListsFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  this->CMakeLists = new modelCDMCMakeListsFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(this->CMakeLists);
                 }
               else
@@ -540,7 +541,7 @@ const bool modelCDMPackage::Refresh(std::string*& result)
 
               if(!found)
                 {
-                  modelCDMFile* file = new modelCDMFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMFile* file = new modelCDMFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(file);
                 }
             }
index 67e69577ee3ef572f13cf82b74f838b1708cd173..de1b0a9a6d855f1e98da4233a64ec7ef04a0fc45 100644 (file)
@@ -45,7 +45,7 @@ class modelCDMPackage : public modelCDMFolder
 {
 public:
   modelCDMPackage();
-  modelCDMPackage(const std::string& path, const std::string& name, const int& level = 1);
+  modelCDMPackage(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level = 1);
   ~modelCDMPackage();
 
   const std::string& GetNamePackage() const;
index 6aa9c5355b663cc738f4221fad49449750f7c549..44481877708dc5c62c1be8440ca7852709b09943 100644 (file)
@@ -47,9 +47,10 @@ modelCDMPackageSrc::modelCDMPackageSrc()
   this->CMakeLists = NULL;
 }
 
-modelCDMPackageSrc::modelCDMPackageSrc(const std::string& path, const std::string& name, const int& level)
+modelCDMPackageSrc::modelCDMPackageSrc(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const int& level)
 {
   std::cout << "creating package src: " + path + "\n";
+  this->parent = parent;
   //set attributes
   this->children.clear();
   this->level = level;
@@ -70,7 +71,7 @@ modelCDMPackageSrc::modelCDMPackageSrc(const std::string& path, const std::strin
           std::string stdfileName = crea::wx2std(fileName);
 
           //if is an unknown folder, create folder
-          this->children.push_back(new modelCDMFolder(path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
+          this->children.push_back(new modelCDMFolder(this, path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
 
           cont = dir.GetNext(&fileName);
         }
@@ -79,7 +80,7 @@ modelCDMPackageSrc::modelCDMPackageSrc(const std::string& path, const std::strin
       if (cont)
         {
           std::string stdfileName = crea::wx2std(fileName);
-          this->CMakeLists = new modelCDMCMakeListsFile(path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+          this->CMakeLists = new modelCDMCMakeListsFile(this, path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
           this->children.push_back(this->CMakeLists);
         }
 
@@ -91,15 +92,15 @@ modelCDMPackageSrc::modelCDMPackageSrc(const std::string& path, const std::strin
 
           if(stdfileName.substr(0,2) == "bb")
             {
-              file = new modelCDMFile(path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              file = new modelCDMFile(this, path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(file);
-              modelCDMBlackBox* blackBox = new modelCDMBlackBox(path, stdfileName.substr(2,stdfileName.size()-4), level + 1);
+              modelCDMBlackBox* blackBox = new modelCDMBlackBox(this, path, stdfileName.substr(2,stdfileName.size()-4), level + 1);
               blackBox->SetHeaderFile(file);
               wxDir dir2(crea::std2wx(path));
               cont = dir2.GetFirst(&fileName, crea::std2wx(stdfileName.substr(0,stdfileName.size()-2) + ".cxx"), wxDIR_FILES);
               if (cont)
                 {
-                  file = new modelCDMFile(path + CDMUtilities::SLASH + crea::wx2std(fileName), crea::wx2std(fileName), this->level + 1);
+                  file = new modelCDMFile(this, path + CDMUtilities::SLASH + crea::wx2std(fileName), crea::wx2std(fileName), this->level + 1);
                   this->children.push_back(file);
                   blackBox->SetSourceFile(file);
                 }
@@ -237,20 +238,20 @@ modelCDMBlackBox* modelCDMPackageSrc::CreateBlackBox(
       if (cont)
         {
           std::string stdfileName = crea::wx2std(fileName);
-          header = new modelCDMFile(this->path + stdfileName, stdfileName, this->level+1);
+          header = new modelCDMFile(this, this->path + stdfileName, stdfileName, this->level+1);
         }
       cont = dir.GetFirst(&fileName, crea::std2wx("bb"+package+bbName+".cxx"), wxDIR_FILES);
       if (cont)
         {
           std::string stdfileName = crea::wx2std(fileName);
-          source = new modelCDMFile(this->path + stdfileName, stdfileName, this->level+1);
+          source = new modelCDMFile(this, this->path + stdfileName, stdfileName, this->level+1);
         }
     }
   //if source and header exist
   if (header != NULL && source != NULL)
     {
       //create black box
-      modelCDMBlackBox* blackBox = new modelCDMBlackBox(this->path, package+bbName);
+      modelCDMBlackBox* blackBox = new modelCDMBlackBox(this, this->path, package+bbName);
 
       //associate header and source
       blackBox->SetHeaderFile(header);
@@ -308,7 +309,7 @@ const bool modelCDMPackageSrc::Refresh(std::string*& result)
             }
           if(!found)
             {
-              modelCDMFolder* folder = new modelCDMFolder(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              modelCDMFolder* folder = new modelCDMFolder(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(folder);
             }
           cont = dir.GetNext(&fileName);
@@ -324,7 +325,7 @@ const bool modelCDMPackageSrc::Refresh(std::string*& result)
             {
               if (this->CMakeLists == NULL)
                 {
-                  this->CMakeLists = new modelCDMCMakeListsFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  this->CMakeLists = new modelCDMCMakeListsFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(this->CMakeLists);
                 }
               else
@@ -352,7 +353,7 @@ const bool modelCDMPackageSrc::Refresh(std::string*& result)
 
               if(!found)
                 {
-                  modelCDMFile* file = new modelCDMFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMFile* file = new modelCDMFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(file);
                 }
             }
@@ -375,7 +376,7 @@ const bool modelCDMPackageSrc::Refresh(std::string*& result)
 
               if (!found)
                 {
-                  modelCDMBlackBox* blackBox = new modelCDMBlackBox(path, stdfileName.substr(2,stdfileName.size()-4), level + 1);
+                  modelCDMBlackBox* blackBox = new modelCDMBlackBox(this, path, stdfileName.substr(2,stdfileName.size()-4), level + 1);
                   this->blackBoxes.push_back(blackBox);
                 }
 
index bb799c394b13909c116e90169412b3b1fdde0d84..e86e7a48adb7ab0ebdaccb71e161332796e70768 100644 (file)
@@ -45,7 +45,7 @@ class modelCDMPackageSrc : public modelCDMFolder
 {
 public:
   modelCDMPackageSrc();
-  modelCDMPackageSrc(const std::string& path, const std::string& name = "src", const int& level = 3);
+  modelCDMPackageSrc(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name = "src", const int& level = 3);
   ~modelCDMPackageSrc();
 
   const std::vector<modelCDMBlackBox*>& GetBlackBoxes() const;
index 00d846edddb9372371639799572bd94b8ae1504f..50f6cc24373699ddd13a1fd8113b4daa23edad6b 100644 (file)
@@ -54,12 +54,14 @@ modelCDMProject::modelCDMProject()
 }
 
 modelCDMProject::modelCDMProject(
+    modelCDMIProjectTreeNode* parent,
     const std::string& path,
     const std::string& name,
     const std::string& buildPath
 )
 {
   std::cout << "creating project: " + name + " in " + path + "\n";
+  this->parent = parent;
   this->path = CDMUtilities::fixPath(path);
   //open makelists file
   std::string pathFixed(CDMUtilities::fixPath(path));
@@ -157,26 +159,26 @@ modelCDMProject::modelCDMProject(
           //if appli, create appli
           if(stdfileName == "appli")
             {
-              this->appli = new modelCDMAppli(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              this->appli = new modelCDMAppli(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(this->appli);
             }
           //if lib, create lib
           else if(stdfileName == "lib")
             {
-              this->lib = new modelCDMLib(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              this->lib = new modelCDMLib(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(this->lib);
             }
           //if package , create package
           else if(stdfileName.size() > 9 && stdfileName.substr(0,5) == "bbtk_" && stdfileName.substr(stdfileName.size()-4,4) == "_PKG")
             {
-              modelCDMPackage* package = new modelCDMPackage(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              modelCDMPackage* package = new modelCDMPackage(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->packages.push_back(package);
               this->children.push_back(package);
             }
           //if is an unknown folder, create folder
           else
             {
-              this->children.push_back(new modelCDMFolder(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
+              this->children.push_back(new modelCDMFolder(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
             }
 
           cont = dir.GetNext(&fileName);
@@ -190,12 +192,12 @@ modelCDMProject::modelCDMProject(
           //if CMakeLists, create CMakeLists
           if(stdfileName == "CMakeLists.txt")
             {
-              this->CMakeLists = new modelCDMCMakeListsFile(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+              this->CMakeLists = new modelCDMCMakeListsFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
               this->children.push_back(this->CMakeLists);
             }
           else
             {
-              this->children.push_back(new modelCDMFile(pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
+              this->children.push_back(new modelCDMFile(this, pathFixed + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1));
             }
           //if is an unknown file, create file
           cont = dir.GetNext(&fileName);
@@ -366,7 +368,7 @@ modelCDMIProjectTreeNode* modelCDMProject::CreatePackage(
     }
 
   //add library to model
-  modelCDMPackage* package = new modelCDMPackage(this->path + CDMUtilities::SLASH + "bbtk_" + nameFixed + "_PKG", "bbtk_" + nameFixed + "_PKG", this->level + 1);
+  modelCDMPackage* package = new modelCDMPackage(this, this->path + CDMUtilities::SLASH + "bbtk_" + nameFixed + "_PKG", "bbtk_" + nameFixed + "_PKG", this->level + 1);
   this->packages.push_back(package);
   this->children.push_back(package);
 
@@ -516,7 +518,7 @@ const bool modelCDMProject::Refresh(std::string*& result)
             {
               if (this->appli == NULL)
                 {
-                  this->appli = new modelCDMAppli(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  this->appli = new modelCDMAppli(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(this->appli);
                 }
               else
@@ -532,7 +534,7 @@ const bool modelCDMProject::Refresh(std::string*& result)
             {
               if (this->lib == NULL)
                 {
-                  this->lib = new modelCDMLib(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  this->lib = new modelCDMLib(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(this->lib);
                 }
               else
@@ -562,7 +564,7 @@ const bool modelCDMProject::Refresh(std::string*& result)
                 }
               if(!found)
                 {
-                  modelCDMPackage* package = new modelCDMPackage(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMPackage* package = new modelCDMPackage(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->packages.push_back(package);
                   this->children.push_back(package);
                 }
@@ -585,7 +587,7 @@ const bool modelCDMProject::Refresh(std::string*& result)
 
               if(!found)
                 {
-                  modelCDMFolder* folder = new modelCDMFolder(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMFolder* folder = new modelCDMFolder(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(folder);
                 }
             }
@@ -603,7 +605,7 @@ const bool modelCDMProject::Refresh(std::string*& result)
             {
               if (this->CMakeLists == NULL)
                 {
-                  this->CMakeLists = new modelCDMCMakeListsFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  this->CMakeLists = new modelCDMCMakeListsFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(this->CMakeLists);
                 }
               else
@@ -631,7 +633,7 @@ const bool modelCDMProject::Refresh(std::string*& result)
 
               if(!found)
                 {
-                  modelCDMFile* file = new modelCDMFile(this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
+                  modelCDMFile* file = new modelCDMFile(this, this->path + CDMUtilities::SLASH + stdfileName, stdfileName, this->level + 1);
                   this->children.push_back(file);
                 }
             }
index b2a2a11a44498c5d39242cd35409f23fa95e4b2c..e4ab0ca9d5557db2a847d3630ff3d7b10eac2161 100644 (file)
@@ -61,7 +61,7 @@ public:
    * @param path The source path.
    * @param buildPath The build path. By default it's an empty string.
    */
-  modelCDMProject(const std::string& path, const std::string& name, const std::string& buildPath = "");
+  modelCDMProject(modelCDMIProjectTreeNode* parent, const std::string& path, const std::string& name, const std::string& buildPath = "");
 
   /**
    * Destructor.
index ec0dc0486fdca8d3e9a4d5766a53fa5e40565d11..109e9db8497a434572ef9a48b681b63c0c884c03 100644 (file)
@@ -44,7 +44,7 @@
 #include "images/ApIcon64.xpm"
 
 BEGIN_EVENT_TABLE(wxCDMAppliDescriptionPanel, wxPanel)
-EVT_BUTTON(ID_BUTTON_PREV, wxCDMAppliDescriptionPanel::OnBtnReturn)
+EVT_HYPERLINK(ID_BUTTON_PREV, wxCDMAppliDescriptionPanel::OnBtnReturn)
 EVT_HYPERLINK(ID_LINK_SELECT_APPLICATION, wxCDMAppliDescriptionPanel::OnLnkApplicationSelect)
 EVT_BUTTON(ID_BUTTON_CREATE_APPLICATION, wxCDMAppliDescriptionPanel::OnBtnCreateApplication)
 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMAppliDescriptionPanel::OnBtnEditCMakeLists)
@@ -88,10 +88,21 @@ void wxCDMAppliDescriptionPanel::CreateControls()
 {
   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
 
-  //Link to return
-  wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project"));
-  returnbt->SetToolTip(wxT("Return to the active project description."));
-  sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5);
+  //Links to return
+  wxBoxSizer *linksSizer = new wxBoxSizer(wxHORIZONTAL);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->appli->GetParents();
+  for (int i = 0; i < parents.size(); i++)
+    {
+      wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()));
+      returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + "."));
+      linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5);
+      if (i < parents.size()-1)
+        {
+          linksSizer->Add(new wxStaticText(this,wxID_ANY, wxT("/")), 0, wxALIGN_CENTER, 0);
+        }
+    }
+  sizer->Add(linksSizer, 0, wxALIGN_CENTER | wxALL, 5);
+
   //Header
   wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
   {
@@ -244,12 +255,21 @@ void wxCDMAppliDescriptionPanel::OnLnkApplicationSelect(wxHyperlinkEvent& event)
   wxPostEvent(this->GetParent(), *newEvent);
 }
 
-void wxCDMAppliDescriptionPanel::OnBtnReturn(wxCommandEvent& event)
+void wxCDMAppliDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
 {
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
-  newEvent->SetInt(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetId());
-  newEvent->SetId(0);
-  wxPostEvent(this->GetParent(), *newEvent);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->appli->GetParents();
+  std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
+  //std::cout << parentURL << std::endl;
+  for (int i = 0; i < parents.size(); i++)
+    {
+      if (parents[i]->GetPath() == parentURL)
+        {
+          wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
+          newEvent->SetInt(parents[i]->GetId());
+          newEvent->SetId(0);
+          wxPostEvent(this->GetParent(), *newEvent);
+        }
+    }
 }
 
 void wxCDMAppliDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
index 6e350a02c9fde28b05d10c39257c826da444cfe8..2a1a9fe8ca46cb8a027b373860ff911b46520a39 100644 (file)
@@ -77,7 +77,7 @@ protected:
   void OnBtnCreateApplication(wxCommandEvent& event);
   void OnBtnEditCMakeLists(wxCommandEvent& event);
   void OnLnkApplicationSelect(wxHyperlinkEvent& event);
-  void OnBtnReturn(wxCommandEvent& event);
+  void OnBtnReturn(wxHyperlinkEvent& event);
   void OnBtnOpenFolder(wxCommandEvent& event);
 
   void OnMouseEnter(wxMouseEvent& event);
index 60fbdf64ac1541a7c166bbd65ada113fbf492acd..ff3d20726534d7615b47f9d209a8f6b0bc0038e2 100644 (file)
@@ -43,8 +43,8 @@
 #include "images/AIcon64.xpm"
 
 BEGIN_EVENT_TABLE(wxCDMApplicationDescriptionPanel, wxPanel)
-EVT_BUTTON(ID_BUTTON_PREV, wxCDMApplicationDescriptionPanel::OnBtnReturn)
 EVT_BUTTON(ID_BUTTON_SET_NAME, wxCDMApplicationDescriptionPanel::OnBtnSetExeName)
+EVT_HYPERLINK(ID_BUTTON_PREV, wxCDMApplicationDescriptionPanel::OnBtnReturn)
 EVT_BUTTON(ID_BUTTON_CREATE_CLASS, wxCDMApplicationDescriptionPanel::OnBtnCreateClass)
 EVT_BUTTON(ID_BUTTON_CREATE_FOLDER, wxCDMApplicationDescriptionPanel::OnBtnCreateFolder)
 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMApplicationDescriptionPanel::OnBtnEditCMakeLists)
@@ -89,10 +89,20 @@ void wxCDMApplicationDescriptionPanel::CreateControls()
 {
   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
 
-  //Link to return
-  wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project"));
-  returnbt->SetToolTip(wxT("Return to the active project description."));
-  sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5);
+  //Links to return
+  wxBoxSizer *linksSizer = new wxBoxSizer(wxHORIZONTAL);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->application->GetParents();
+  for (int i = 0; i < parents.size(); i++)
+    {
+      wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()));
+      returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + "."));
+      linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5);
+      if (i < parents.size()-1)
+        {
+          linksSizer->Add(new wxStaticText(this,wxID_ANY, wxT("/")), 0, wxALIGN_CENTER, 0);
+        }
+    }
+  sizer->Add(linksSizer, 0, wxALIGN_CENTER | wxALL, 5);
 
   //Header
   wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
@@ -188,12 +198,22 @@ void wxCDMApplicationDescriptionPanel::CreateControls()
     }
 }
 
-void wxCDMApplicationDescriptionPanel::OnBtnReturn(wxCommandEvent& event)
+void wxCDMApplicationDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
 {
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
-  newEvent->SetInt(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetId());
-  newEvent->SetId(0);
-  wxPostEvent(this->GetParent(), *newEvent);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->application->GetParents();
+  std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
+  //std::cout << parentURL << std::endl;
+  for (int i = 0; i < parents.size(); i++)
+    {
+      if (parents[i]->GetPath() == parentURL)
+        {
+          wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
+          newEvent->SetInt(parents[i]->GetId());
+          newEvent->SetId(0);
+          wxPostEvent(this->GetParent(), *newEvent);
+        }
+    }
+
 }
 
 void wxCDMApplicationDescriptionPanel::OnBtnSetExeName(wxCommandEvent& event)
index 995d2be5939a2f09bcd24410c21b57063540ac06..823272b7b28b2903c04b95c935b4fb99b5eacb8a 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <creaWx.h>
 #include <wx/panel.h>
+#include <wx/hyperlink.h>
 
 #include "modelCDMApplication.h"
 
@@ -74,7 +75,7 @@ private:
 
   //handlers
 protected:
-  void OnBtnReturn(wxCommandEvent& event);
+  void OnBtnReturn(wxHyperlinkEvent& event);
   void OnBtnSetExeName(wxCommandEvent& event);
   void OnBtnCreateClass(wxCommandEvent& event);
   void OnBtnCreateFolder(wxCommandEvent& event);
index 006ca3d195dab5669122aa07fa6a8169eadf0181..6db4e2b2d0ef53ea0592d9a2c39f1996cbef58a8 100644 (file)
@@ -42,7 +42,7 @@
 #include "images/BBIcon64.xpm"
 
 BEGIN_EVENT_TABLE(wxCDMBlackBoxDescriptionPanel, wxPanel)
-EVT_BUTTON(ID_BUTTON_PREV, wxCDMBlackBoxDescriptionPanel::OnBtnReturn)
+EVT_HYPERLINK(ID_BUTTON_PREV, wxCDMBlackBoxDescriptionPanel::OnBtnReturn)
 EVT_BUTTON(ID_BUTTON_SET_AUTHOR, wxCDMBlackBoxDescriptionPanel::OnBtnSetAuthor)
 EVT_BUTTON(ID_BUTTON_SET_DESCRIPTION, wxCDMBlackBoxDescriptionPanel::OnBtnSetDescription)
 EVT_BUTTON(ID_BUTTON_SET_CATEGORY, wxCDMBlackBoxDescriptionPanel::OnBtnSetCategories)
@@ -88,10 +88,20 @@ void wxCDMBlackBoxDescriptionPanel::CreateControls()
 {
   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
 
-  //Link to return
-  wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project"));
-  returnbt->SetToolTip(wxT("Return to the active project description."));
-  sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5);
+  //Links to return
+  wxBoxSizer *linksSizer = new wxBoxSizer(wxHORIZONTAL);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->blackBox->GetParents();
+  for (int i = 0; i < parents.size(); i++)
+    {
+      wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()));
+      returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + "."));
+      linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5);
+      if (i < parents.size()-1)
+        {
+          linksSizer->Add(new wxStaticText(this,wxID_ANY, wxT("/")), 0, wxALIGN_CENTER, 0);
+        }
+    }
+  sizer->Add(linksSizer, 0, wxALIGN_CENTER | wxALL, 5);
 
   //Header
   wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
@@ -195,12 +205,22 @@ void wxCDMBlackBoxDescriptionPanel::CreateControls()
     }
 }
 
-void wxCDMBlackBoxDescriptionPanel::OnBtnReturn(wxCommandEvent& event)
+void wxCDMBlackBoxDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
 {
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
-  newEvent->SetInt(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetId());
-  newEvent->SetId(0);
-  wxPostEvent(this->GetParent(), *newEvent);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->blackBox->GetParents();
+    std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
+    //std::cout << parentURL << std::endl;
+    for (int i = 0; i < parents.size(); i++)
+      {
+        if (parents[i]->GetPath() == parentURL)
+          {
+            wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
+            newEvent->SetInt(parents[i]->GetId());
+            newEvent->SetId(0);
+            wxPostEvent(this->GetParent(), *newEvent);
+          }
+      }
+
 }
 
 void wxCDMBlackBoxDescriptionPanel::OnBtnSetAuthor(wxCommandEvent& event)
index c4be2fb6076593d369b8d5579d61ae676df473d2..27c8dab2bc959f789120abacedb0781087cd29e4 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <creaWx.h>
 #include <wx/panel.h>
+#include <wx/hyperlink.h>
 
 #include "modelCDMBlackBox.h"
 
@@ -76,7 +77,7 @@ private:
 
   //handlers
 protected:
-  void OnBtnReturn(wxCommandEvent& event);
+  void OnBtnReturn(wxHyperlinkEvent& event);
   void OnBtnSetAuthor(wxCommandEvent& event);
   void OnBtnSetDescription(wxCommandEvent& event);
   void OnBtnSetCategories(wxCommandEvent& event);
index 565a861b867e1aa8c88aad45977512c6fab9bb63..b5ee3628c4503c5dbda5e0782cd130723b151c1f 100644 (file)
@@ -40,7 +40,7 @@
 #include "images/CMIcon64.xpm"
 
 BEGIN_EVENT_TABLE(wxCDMCMakeListsDescriptionPanel, wxPanel)
-EVT_BUTTON(ID_BUTTON_PREV, wxCDMCMakeListsDescriptionPanel::OnBtnReturn)
+EVT_HYPERLINK(ID_BUTTON_PREV, wxCDMCMakeListsDescriptionPanel::OnBtnReturn)
 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMCMakeListsDescriptionPanel::OnBtnOpenInEditor)
 EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMCMakeListsDescriptionPanel::OnBtnOpenFolder)
 END_EVENT_TABLE()
@@ -82,10 +82,21 @@ void wxCDMCMakeListsDescriptionPanel::CreateControls()
 {
   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
 
-  //Link to return
-  wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project"));
-  returnbt->SetToolTip(wxT("Return to the active project description."));
-  sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5);
+  //Links to return
+  wxBoxSizer *linksSizer = new wxBoxSizer(wxHORIZONTAL);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->cMakeLists->GetParents();
+  for (int i = 0; i < parents.size(); i++)
+    {
+      wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()));
+      returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + "."));
+      linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5);
+      if (i < parents.size()-1)
+        {
+          linksSizer->Add(new wxStaticText(this,wxID_ANY, wxT("/")), 0, wxALIGN_CENTER, 0);
+        }
+    }
+  sizer->Add(linksSizer, 0, wxALIGN_CENTER | wxALL, 5);
+
   //Header
   wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
   {
@@ -128,12 +139,21 @@ void wxCDMCMakeListsDescriptionPanel::CreateControls()
   sizer->SetSizeHints(this);
 }
 
-void wxCDMCMakeListsDescriptionPanel::OnBtnReturn(wxCommandEvent& event)
+void wxCDMCMakeListsDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
 {
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
-  newEvent->SetInt(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetId());
-  newEvent->SetId(0);
-  wxPostEvent(this->GetParent(), *newEvent);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->cMakeLists->GetParents();
+  std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
+  //std::cout << parentURL << std::endl;
+  for (int i = 0; i < parents.size(); i++)
+    {
+      if (parents[i]->GetPath() == parentURL)
+        {
+          wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
+          newEvent->SetInt(parents[i]->GetId());
+          newEvent->SetId(0);
+          wxPostEvent(this->GetParent(), *newEvent);
+        }
+    }
 }
 
 void wxCDMCMakeListsDescriptionPanel::OnBtnOpenInEditor(wxCommandEvent& event)
index b37d338b07c3cb0ba35d88b812f7bc7c63992bde..67ac0ccd623bd3aaa213701fb0d8e8171ca366e1 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <creaWx.h>
 #include <wx/panel.h>
+#include <wx/hyperlink.h>
 
 #include "modelCDMCMakeListsFile.h"
 
@@ -73,7 +74,7 @@ private:
 
   //handlers
 protected:
-  void OnBtnReturn(wxCommandEvent& event);
+  void OnBtnReturn(wxHyperlinkEvent& event);
   void OnBtnOpenInEditor(wxCommandEvent& event);
   void OnBtnOpenFolder(wxCommandEvent& event);
 };
index 9e01585cc2083c27431bffc9b5f25f835dc6617e..dad7ea8fa1f2a4d5ef3877c4f639aeded552c979 100644 (file)
@@ -42,7 +42,7 @@
 #include "images/FlIcon64.xpm"
 
 BEGIN_EVENT_TABLE(wxCDMFileDescriptionPanel, wxPanel)
-EVT_BUTTON(ID_BUTTON_PREV, wxCDMFileDescriptionPanel::OnBtnReturn)
+EVT_HYPERLINK(ID_BUTTON_PREV, wxCDMFileDescriptionPanel::OnBtnReturn)
 EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMFileDescriptionPanel::OnBtnOpenFolder)
 EVT_BUTTON(ID_BUTTON_OPEN_COMMAND, wxCDMFileDescriptionPanel::OnBtnOpenWithCommand)
 END_EVENT_TABLE()
@@ -84,10 +84,20 @@ void wxCDMFileDescriptionPanel::CreateControls()
 {
   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
 
-  //Link to return
-  wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project"));
-  returnbt->SetToolTip(wxT("Return to the active project description."));
-  sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5);
+  //Links to return
+  wxBoxSizer *linksSizer = new wxBoxSizer(wxHORIZONTAL);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->file->GetParents();
+  for (int i = 0; i < parents.size(); i++)
+    {
+      wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()));
+      returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + "."));
+      linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5);
+      if (i < parents.size()-1)
+        {
+          linksSizer->Add(new wxStaticText(this,wxID_ANY, wxT("/")), 0, wxALIGN_CENTER, 0);
+        }
+    }
+  sizer->Add(linksSizer, 0, wxALIGN_CENTER | wxALL, 5);
 
   //Header
   wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
@@ -163,12 +173,21 @@ void wxCDMFileDescriptionPanel::CreateControls()
   sizer->SetSizeHints(this);
 }
 
-void wxCDMFileDescriptionPanel::OnBtnReturn(wxCommandEvent& event)
+void wxCDMFileDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
 {
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
-  newEvent->SetInt(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetId());
-  newEvent->SetId(0);
-  wxPostEvent(this->GetParent(), *newEvent);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->file->GetParents();
+  std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
+  //std::cout << parentURL << std::endl;
+  for (int i = 0; i < parents.size(); i++)
+    {
+      if (parents[i]->GetPath() == parentURL)
+        {
+          wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
+          newEvent->SetInt(parents[i]->GetId());
+          newEvent->SetId(0);
+          wxPostEvent(this->GetParent(), *newEvent);
+        }
+    }
 }
 
 void wxCDMFileDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
index dd4e3664930710c7d637a80c8a93daf3c47497cb..01ad44436009bee277d8c5cb91ae8d610d857723 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <creaWx.h>
 #include <wx/panel.h>
+#include <wx/hyperlink.h>
 
 #include "modelCDMFile.h"
 
@@ -74,7 +75,7 @@ private:
 
   //handlers
 protected:
-  void OnBtnReturn(wxCommandEvent& event);
+  void OnBtnReturn(wxHyperlinkEvent& event);
   void OnBtnOpenFolder(wxCommandEvent& event);
   void OnBtnOpenWithCommand(wxCommandEvent& event);
 
index e0669cfc00718a79804cce55a63022a16188f2de..19627edd7663ddb4d9a88a6005ebebf3c4d7bf9d 100644 (file)
@@ -41,7 +41,7 @@
 #include "images/FdIcon64.xpm"
 
 BEGIN_EVENT_TABLE(wxCDMFolderDescriptionPanel, wxPanel)
-EVT_BUTTON(ID_BUTTON_PREV, wxCDMFolderDescriptionPanel::OnBtnReturn)
+EVT_HYPERLINK(ID_BUTTON_PREV, wxCDMFolderDescriptionPanel::OnBtnReturn)
 EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMFolderDescriptionPanel::OnBtnOpenInExplorer)
 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMFolderDescriptionPanel::OnBtnEditCMakeLists)
 EVT_BUTTON(ID_BUTTON_CREATE_CLASS, wxCDMFolderDescriptionPanel::OnBtnCreateClass)
@@ -85,10 +85,20 @@ void wxCDMFolderDescriptionPanel::CreateControls()
 {
   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
 
-  //Link to return
-  wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project"));
-  returnbt->SetToolTip(wxT("Return to the active project description."));
-  sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5);
+  //Links to return
+  wxBoxSizer *linksSizer = new wxBoxSizer(wxHORIZONTAL);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->folder->GetParents();
+  for (int i = 0; i < parents.size(); i++)
+    {
+      wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()));
+      returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + "."));
+      linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5);
+      if (i < parents.size()-1)
+        {
+          linksSizer->Add(new wxStaticText(this,wxID_ANY, wxT("/")), 0, wxALIGN_CENTER, 0);
+        }
+    }
+  sizer->Add(linksSizer, 0, wxALIGN_CENTER | wxALL, 5);
 
   //Header
   wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
@@ -146,12 +156,21 @@ void wxCDMFolderDescriptionPanel::CreateControls()
   sizer->SetSizeHints(this);
 }
 
-void wxCDMFolderDescriptionPanel::OnBtnReturn(wxCommandEvent& event)
+void wxCDMFolderDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
 {
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
-  newEvent->SetInt(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetId());
-  newEvent->SetId(0);
-  wxPostEvent(this->GetParent(), *newEvent);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->folder->GetParents();
+  std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
+  //std::cout << parentURL << std::endl;
+  for (int i = 0; i < parents.size(); i++)
+    {
+      if (parents[i]->GetPath() == parentURL)
+        {
+          wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
+          newEvent->SetInt(parents[i]->GetId());
+          newEvent->SetId(0);
+          wxPostEvent(this->GetParent(), *newEvent);
+        }
+    }
 }
 
 void wxCDMFolderDescriptionPanel::OnBtnOpenInExplorer(wxCommandEvent& event)
index e273114db8d0aa726b95f915d70cf46bb68f8a73..b4f60832548292b64a95217ccd261fcf6fe523a3 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <creaWx.h>
 #include <wx/panel.h>
+#include <wx/hyperlink.h>
 
 #include "modelCDMFolder.h"
 
@@ -73,7 +74,7 @@ private:
 
   //handlers
 protected:
-  void OnBtnReturn(wxCommandEvent& event);
+  void OnBtnReturn(wxHyperlinkEvent& event);
   void OnBtnEditCMakeLists(wxCommandEvent& event);
   void OnBtnCreateClass(wxCommandEvent& event);
   void OnBtnCreateFolder(wxCommandEvent& event);
index 6167c17ac1fa2a17253d453e531ae2dae3bc25c7..56c2615cc8edacf2b8e719427b7517acedc848da 100644 (file)
@@ -42,7 +42,7 @@
 #include "images/LbIcon64.xpm"
 
 BEGIN_EVENT_TABLE(wxCDMLibDescriptionPanel, wxPanel)
-EVT_BUTTON(ID_BUTTON_PREV, wxCDMLibDescriptionPanel::OnBtnReturn)
+EVT_HYPERLINK(ID_BUTTON_PREV, wxCDMLibDescriptionPanel::OnBtnReturn)
 EVT_HYPERLINK(ID_LINK_SELECT_LIBRARY, wxCDMLibDescriptionPanel::OnLnkLibrarySelect)
 EVT_BUTTON(ID_BUTTON_CREATE_LIBRARY, wxCDMLibDescriptionPanel::OnBtnCreateLibrary)
 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMLibDescriptionPanel::OnBtnEditCMakeLists)
@@ -86,10 +86,21 @@ void wxCDMLibDescriptionPanel::CreateControls()
 {
   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
 
-  //Link to return
-  wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project"));
-  returnbt->SetToolTip(wxT("Return to the active project description."));
-  sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5);
+  //Links to return
+  wxBoxSizer *linksSizer = new wxBoxSizer(wxHORIZONTAL);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->lib->GetParents();
+  for (int i = 0; i < parents.size(); i++)
+    {
+      wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()));
+      returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + "."));
+      linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5);
+      if (i < parents.size()-1)
+        {
+          linksSizer->Add(new wxStaticText(this,wxID_ANY, wxT("/")), 0, wxALIGN_CENTER, 0);
+        }
+    }
+  sizer->Add(linksSizer, 0, wxALIGN_CENTER | wxALL, 5);
+
   //Header
   wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
   {
@@ -243,12 +254,21 @@ void wxCDMLibDescriptionPanel::OnLnkLibrarySelect(wxHyperlinkEvent& event)
 
 }
 
-void wxCDMLibDescriptionPanel::OnBtnReturn(wxCommandEvent& event)
+void wxCDMLibDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
 {
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
-  newEvent->SetInt(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetId());
-  newEvent->SetId(0);
-  wxPostEvent(this->GetParent(), *newEvent);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->lib->GetParents();
+  std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
+  //std::cout << parentURL << std::endl;
+  for (int i = 0; i < parents.size(); i++)
+    {
+      if (parents[i]->GetPath() == parentURL)
+        {
+          wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
+          newEvent->SetInt(parents[i]->GetId());
+          newEvent->SetId(0);
+          wxPostEvent(this->GetParent(), *newEvent);
+        }
+    }
 }
 
 void wxCDMLibDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
index bcf23ff1bde79b452d0ec5c55ad68227040dac54..dca3cea77ff703c43ed5e4bab730583200ede1c9 100644 (file)
@@ -77,7 +77,7 @@ protected:
   void OnBtnCreateLibrary(wxCommandEvent& event);
   void OnBtnEditCMakeLists(wxCommandEvent& event);
   void OnLnkLibrarySelect(wxHyperlinkEvent& event);
-  void OnBtnReturn(wxCommandEvent& event);
+  void OnBtnReturn(wxHyperlinkEvent& event);
   void OnBtnOpenFolder(wxCommandEvent& event);
 
   void OnMouseEnter(wxMouseEvent& event);
index 8d72c28b8d47034d7b8cee0f4b4357bf02770296..f24d4d46581b77113666bd6d8e11b38612a087fd 100644 (file)
@@ -43,7 +43,7 @@
 #include "images/LIcon64.xpm"
 
 BEGIN_EVENT_TABLE(wxCDMLibraryDescriptionPanel, wxPanel)
-EVT_BUTTON(ID_BUTTON_PREV, wxCDMLibraryDescriptionPanel::OnBtnReturn)
+EVT_HYPERLINK(ID_BUTTON_PREV, wxCDMLibraryDescriptionPanel::OnBtnReturn)
 EVT_BUTTON(ID_BUTTON_SET_NAME, wxCDMLibraryDescriptionPanel::OnBtnSetExeName)
 EVT_BUTTON(ID_BUTTON_CREATE_CLASS, wxCDMLibraryDescriptionPanel::OnBtnCreateClass)
 EVT_BUTTON(ID_BUTTON_CREATE_FOLDER, wxCDMLibraryDescriptionPanel::OnBtnCreateFolder)
@@ -88,10 +88,21 @@ void wxCDMLibraryDescriptionPanel::CreateControls()
 {
   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
 
-  //Link to return
-  wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project"));
-  returnbt->SetToolTip(wxT("Return to the active project description."));
-  sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5);
+  //Links to return
+  wxBoxSizer *linksSizer = new wxBoxSizer(wxHORIZONTAL);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->library->GetParents();
+  for (int i = 0; i < parents.size(); i++)
+    {
+      wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()));
+      returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + "."));
+      linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5);
+      if (i < parents.size()-1)
+        {
+          linksSizer->Add(new wxStaticText(this,wxID_ANY, wxT("/")), 0, wxALIGN_CENTER, 0);
+        }
+    }
+  sizer->Add(linksSizer, 0, wxALIGN_CENTER | wxALL, 5);
+
   //Header
   wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
   {
@@ -175,12 +186,21 @@ void wxCDMLibraryDescriptionPanel::CreateControls()
     }
 }
 
-void wxCDMLibraryDescriptionPanel::OnBtnReturn(wxCommandEvent& event)
+void wxCDMLibraryDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
 {
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
-  newEvent->SetInt(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetId());
-  newEvent->SetId(0);
-  wxPostEvent(this->GetParent(), *newEvent);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->library->GetParents();
+    std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
+    //std::cout << parentURL << std::endl;
+    for (int i = 0; i < parents.size(); i++)
+      {
+        if (parents[i]->GetPath() == parentURL)
+          {
+            wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
+            newEvent->SetInt(parents[i]->GetId());
+            newEvent->SetId(0);
+            wxPostEvent(this->GetParent(), *newEvent);
+          }
+      }
 }
 
 void wxCDMLibraryDescriptionPanel::OnBtnSetExeName(wxCommandEvent& event)
index c6c60e3ae7f5c78e8c977f561e045aa36259af30..66e3063c002e7d2e10a514ed7375202ff3056b05 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <creaWx.h>
 #include <wx/panel.h>
+#include <wx/hyperlink.h>
 
 #include "modelCDMLibrary.h"
 
@@ -74,7 +75,7 @@ private:
 
   //handlers
 protected:
-  void OnBtnReturn(wxCommandEvent& event);
+  void OnBtnReturn(wxHyperlinkEvent& event);
   void OnBtnSetExeName(wxCommandEvent& event);
   void OnBtnCreateClass(wxCommandEvent& event);
   void OnBtnCreateFolder(wxCommandEvent& event);
index d4348fa152fe9d4956fc3bf61d049d391550afa0..12b915276c1a6a7a81c219a799a2525af4188d10 100644 (file)
@@ -49,7 +49,7 @@
 
 
 BEGIN_EVENT_TABLE(wxCDMPackageDescriptionPanel, wxPanel)
-EVT_BUTTON(ID_BUTTON_PREV, wxCDMPackageDescriptionPanel::OnBtnReturn)
+EVT_HYPERLINK(ID_BUTTON_PREV, wxCDMPackageDescriptionPanel::OnBtnReturn)
 EVT_BUTTON(ID_BUTTON_SET_AUTHOR, wxCDMPackageDescriptionPanel::OnBtnSetAuthor)
 EVT_BUTTON(ID_BUTTON_SET_VERSION, wxCDMPackageDescriptionPanel::OnBtnSetVersion)
 EVT_BUTTON(ID_BUTTON_SET_DESCRIPTION, wxCDMPackageDescriptionPanel::OnBtnSetDescription)
@@ -96,10 +96,20 @@ void wxCDMPackageDescriptionPanel::CreateControls()
 {
   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
 
-  //Link to return
-  wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project"));
-  returnbt->SetToolTip(wxT("Return to the active project description."));
-  sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5);
+  //Links to return
+  wxBoxSizer *linksSizer = new wxBoxSizer(wxHORIZONTAL);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->package->GetParents();
+  for (int i = 0; i < parents.size(); i++)
+    {
+      wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()));
+      returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + "."));
+      linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5);
+      if (i < parents.size()-1)
+        {
+          linksSizer->Add(new wxStaticText(this,wxID_ANY, wxT("/")), 0, wxALIGN_CENTER, 0);
+        }
+    }
+  sizer->Add(linksSizer, 0, wxALIGN_CENTER | wxALL, 5);
 
   //Header
   wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
@@ -233,12 +243,21 @@ void wxCDMPackageDescriptionPanel::CreateControls()
     }
 }
 
-void wxCDMPackageDescriptionPanel::OnBtnReturn(wxCommandEvent& event)
+void wxCDMPackageDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
 {
-  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
-  newEvent->SetInt(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetId());
-  newEvent->SetId(0);
-  wxPostEvent(this->GetParent(), *newEvent);
+  std::vector<modelCDMIProjectTreeNode*> parents = this->package->GetParents();
+  std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
+  //std::cout << parentURL << std::endl;
+  for (int i = 0; i < parents.size(); i++)
+    {
+      if (parents[i]->GetPath() == parentURL)
+        {
+          wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
+          newEvent->SetInt(parents[i]->GetId());
+          newEvent->SetId(0);
+          wxPostEvent(this->GetParent(), *newEvent);
+        }
+    }
 }
 
 void wxCDMPackageDescriptionPanel::OnBtnSetAuthor(wxCommandEvent& event)
index 2f9d9377ce7e3f2943a9ba0abe5b4836d277c672..1601f041460fa903349b2495a57ee4a0e1418d31 100644 (file)
@@ -77,7 +77,7 @@ private:
 
   //handlers
 protected:
-  void OnBtnReturn(wxCommandEvent& event);
+  void OnBtnReturn(wxHyperlinkEvent& event);
 
   void OnBtnSetAuthor(wxCommandEvent& event);
   void OnBtnSetVersion(wxCommandEvent& event);
index a888f8bcce35c53106f6217a5d94a1df48a51f97..cc6b9fcf4d6b0033b9d6c8f8c7df71f69c908d99 100644 (file)
@@ -43,7 +43,7 @@
 #include "images/PkIcon64.xpm"
 
 BEGIN_EVENT_TABLE(wxCDMPackageManagerPanel, wxPanel)
-EVT_BUTTON(ID_BUTTON_PREV, wxCDMPackageManagerPanel::OnBtnReturn)
+EVT_HYPERLINK(ID_BUTTON_PREV, wxCDMPackageManagerPanel::OnBtnReturn)
 EVT_HYPERLINK(ID_LINK_SELECT_PACKAGE, wxCDMPackageManagerPanel::OnLnkPackageSelect)
 EVT_BUTTON(ID_BUTTON_CREATE_PACKAGE, wxCDMPackageManagerPanel::OnBtnCreatePackage)
 EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_TOOL_CLICKED, wxCDMPackageManagerPanel::OnBtnCreatePackage)
@@ -89,9 +89,9 @@ void wxCDMPackageManagerPanel::CreateControls()
   wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
 
   //Link to return
-  wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project"));
-  returnbt->SetToolTip(wxT("Return to the active project description."));
-  sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5);
+  wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(this->project->GetName()), crea::std2wx(this->project->GetPath()));
+  returnLnk->SetToolTip(wxT("Return to the active project description."));
+  sizer->Add(returnLnk, 0, wxALIGN_CENTER | wxALL, 5);
 
   //Header
   wxBoxSizer* headerSizer = new wxBoxSizer(wxHORIZONTAL);
@@ -172,7 +172,7 @@ modelCDMProject* wxCDMPackageManagerPanel::GetProject() const
   return this->project;
 }
 
-void wxCDMPackageManagerPanel::OnBtnReturn(wxCommandEvent& event)
+void wxCDMPackageManagerPanel::OnBtnReturn(wxHyperlinkEvent& event)
 {
   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
   newEvent->SetInt(project->GetId());
index 7c59cea4bd1f2cc0727d472a450f9fb8f64d4734..899086827d3d596528172dbc4c5cb51f60dceef6 100644 (file)
@@ -79,7 +79,7 @@ private:
 
   //handlers
 protected:
-  void OnBtnReturn(wxCommandEvent& event);
+  void OnBtnReturn(wxHyperlinkEvent& event);
   void OnLnkPackageSelect(wxHyperlinkEvent& event);
   void OnBtnCreatePackage(wxCommandEvent& event);
   void OnBtnEditCMakeLists(wxCommandEvent& event);