]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / wxCDMLibDescriptionPanel.cpp
index d05245bf3106e955630db646046bacec48907412..551d12cea78d9ce5cf6200a00efbc919132ee9b8 100644 (file)
@@ -207,7 +207,7 @@ void wxCDMLibDescriptionPanel::OnBtnCreateLibrary(wxCommandEvent& event)
       ((wxCDMMainFrame*)this->GetParent())->RefreshProject();
 
       wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
-      newEvent->SetInt(library->GetId());
+      newEvent->SetClientData(library);
       wxPostEvent(this->GetParent(), *newEvent);
     }
 }
@@ -222,8 +222,7 @@ void wxCDMLibDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
 
   if(this->lib->GetCMakeLists() != NULL)
     {
-      int CMId = this->lib->GetCMakeLists()->GetId();
-      newEvent->SetInt(CMId);
+      newEvent->SetClientData(this->lib->GetCMakeLists());
       newEvent->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent);
     }
@@ -231,24 +230,24 @@ void wxCDMLibDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
 
 void wxCDMLibDescriptionPanel::OnLnkLibrarySelect(wxHyperlinkEvent& event)
 {
-  int libraryId = 0;
+  modelCDMLibrary* theLibrary = NULL;
   std::vector<modelCDMLibrary*> libraries = this->lib->GetLibraries();
   for (int i = 0; i < libraries.size(); i++)
     {
       if(libraries[i]->GetName() == crea::wx2std(event.GetURL()))
         {
-          libraryId = libraries[i]->GetId();
+          theLibrary = libraries[i];
           break;
         }
     }
 
   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
-  newEvent->SetInt(libraryId);
+  newEvent->SetClientData(theLibrary);
   newEvent->SetId(0);
   wxPostEvent(this->GetParent(), *newEvent);
 
   wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
-  newEvent1->SetInt(libraryId);
+  newEvent1->SetClientData(theLibrary);
   newEvent1->SetId(0);
   wxPostEvent(this->GetParent(), *newEvent1);
 
@@ -264,7 +263,7 @@ void wxCDMLibDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
       if (parents[i]->GetPath() == parentURL)
         {
           wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
-          newEvent->SetInt(parents[i]->GetId());
+          newEvent->SetClientData(parents[i]);
           newEvent->SetId(0);
           wxPostEvent(this->GetParent(), *newEvent);
         }
@@ -282,17 +281,17 @@ void wxCDMLibDescriptionPanel::OnMouseEnter(wxMouseEvent& event)
 {
   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED);
   std::string LibName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
-  int lbId = 0;
+  modelCDMLibrary* theLibrary = NULL;
   std::vector<modelCDMLibrary*> libraries = this->lib->GetLibraries();
   for (int i = 0; i < libraries.size(); i++)
     {
       if(libraries[i]->GetName() == LibName)
         {
-          lbId = libraries[i]->GetId();
+          theLibrary = libraries[i];
           break;
         }
     }
-  newEvent->SetInt(lbId);
+  newEvent->SetClientData(theLibrary);
   newEvent->SetId(0);
   wxPostEvent(this->GetParent(), *newEvent);
   event.Skip();
@@ -302,17 +301,17 @@ void wxCDMLibDescriptionPanel::OnMouseExit(wxMouseEvent& event)
 {
   wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED);
   std::string LibName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
-  int lbId = 0;
+  modelCDMLibrary* theLibrary = NULL;
   std::vector<modelCDMLibrary*> libraries = this->lib->GetLibraries();
   for (int i = 0; i < libraries.size(); i++)
     {
       if(libraries[i]->GetName() == LibName)
         {
-          lbId = libraries[i]->GetId();
+          theLibrary = libraries[i];
           break;
         }
     }
-  newEvent->SetInt(lbId);
+  newEvent->SetClientData(theLibrary);
   newEvent->SetId(0);
   wxPostEvent(this->GetParent(), *newEvent);
   event.Skip();
@@ -324,8 +323,7 @@ void wxCDMLibDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event)
 
   if(this->lib->GetCMakeLists() != NULL)
     {
-      int CMId = this->lib->GetCMakeLists()->GetId();
-      newEvent->SetInt(CMId);
+      newEvent->SetClientData(this->lib->GetCMakeLists());
       newEvent->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent);
     }
@@ -338,8 +336,7 @@ void wxCDMLibDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event)
 
   if(this->lib->GetCMakeLists() != NULL)
     {
-      int CMId = this->lib->GetCMakeLists()->GetId();
-      newEvent->SetInt(CMId);
+      newEvent->SetClientData(this->lib->GetCMakeLists());
       newEvent->SetId(0);
       wxPostEvent(this->GetParent(), *newEvent);
     }