X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FwxCDMLibDescriptionPanel.cpp;h=551d12cea78d9ce5cf6200a00efbc919132ee9b8;hb=5ff0bb2664c3cd508c1dd438666a71b8a96459c3;hp=d05245bf3106e955630db646046bacec48907412;hpb=e75a80c4a8a5d67aeb1e941f0c980a11c09cc125;p=crea.git diff --git a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp index d05245b..551d12c 100644 --- a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp @@ -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 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 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 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); }