X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FcreaDevManagerLib%2FwxCDMLibDescriptionPanel.cpp;h=d31f2b2ba51f399fdd306e3d6e8588085510ecfd;hb=311bdcc514f85386f3bbbef9ff6a88bf69fd930f;hp=524e64f5ecb4ed95a03e56c6c2e6aa52816550d2;hpb=fa7a450d70363d66912675f9de918e7c8bb012b6;p=crea.git diff --git a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp index 524e64f..d31f2b2 100644 --- a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp @@ -129,6 +129,8 @@ void wxCDMLibDescriptionPanel::CreateControls() actionsPanelSizer->Add(createLibrarybt, 0, wxALL, 5); wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")); editCMakebt->SetToolTip(wxT("Open the system default text editor to edit the Lib's CMakeLists.txt file.")); + editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibDescriptionPanel::OnCMakeMouseEnter,NULL,this); + editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibDescriptionPanel::OnCMakeMouseExit,NULL,this); actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5); wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Libraries Folder")); openFolderbt->SetToolTip(wxT("Open the lib folder in the file explorer.")); @@ -182,6 +184,16 @@ void wxCDMLibDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) std::string* result; 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); + + if(this->lib->GetCMakeLists() != NULL) + { + int CMId = this->lib->GetCMakeLists()->GetId(); + newEvent->SetInt(CMId); + newEvent->SetId(0); + wxPostEvent(this->GetParent(), *newEvent); + } } void wxCDMLibDescriptionPanel::OnLnkLibrarySelect(wxHyperlinkEvent& event) @@ -263,3 +275,31 @@ void wxCDMLibDescriptionPanel::OnMouseExit(wxMouseEvent& event) wxPostEvent(this->GetParent(), *newEvent); event.Skip(); } + +void wxCDMLibDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event) +{ + wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED); + + if(this->lib->GetCMakeLists() != NULL) + { + int CMId = this->lib->GetCMakeLists()->GetId(); + newEvent->SetInt(CMId); + newEvent->SetId(0); + wxPostEvent(this->GetParent(), *newEvent); + } + event.Skip(); +} + +void wxCDMLibDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event) +{ + wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED); + + if(this->lib->GetCMakeLists() != NULL) + { + int CMId = this->lib->GetCMakeLists()->GetId(); + newEvent->SetInt(CMId); + newEvent->SetId(0); + wxPostEvent(this->GetParent(), *newEvent); + } + event.Skip(); +}