X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FwxCDMLibDescriptionPanel.cpp;h=551d12cea78d9ce5cf6200a00efbc919132ee9b8;hb=f4451b0dfa9bfa593ada3e9462570b6ca250f0d7;hp=56c2615cc8edacf2b8e719427b7517acedc848da;hpb=11150e550ff03ee658e90cda4b475b4c24da0a7f;p=crea.git diff --git a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp index 56c2615..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); } } @@ -218,12 +218,11 @@ void wxCDMLibDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) if(!this->lib->OpenCMakeListsFile(result)) wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR); - wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED); + wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED); 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_LIST_ITEM_DESELECTED); - newEvent1->SetInt(libraryId); + wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED); + 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); } @@ -280,19 +279,19 @@ void wxCDMLibDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event) void wxCDMLibDescriptionPanel::OnMouseEnter(wxMouseEvent& event) { - wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED); + 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(); @@ -300,19 +299,19 @@ void wxCDMLibDescriptionPanel::OnMouseEnter(wxMouseEvent& event) void wxCDMLibDescriptionPanel::OnMouseExit(wxMouseEvent& event) { - wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED); + 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(); @@ -320,12 +319,11 @@ void wxCDMLibDescriptionPanel::OnMouseExit(wxMouseEvent& event) void wxCDMLibDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event) { - wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED); + wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED); 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); } @@ -334,12 +332,11 @@ void wxCDMLibDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event) void wxCDMLibDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event) { - wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED); + wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LISTBOX_SELECTED); 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); }