]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / wxCDMLibDescriptionPanel.cpp
index 524e64f5ecb4ed95a03e56c6c2e6aa52816550d2..d31f2b2ba51f399fdd306e3d6e8588085510ecfd 100644 (file)
@@ -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();
+}