]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / wxCDMProjectDescriptionPanel.cpp
index e49e2899feaa4375c5264feec4bb603fd7ceeabd..4f60890fbb3c092baab61176e531fdbb52f8ca9b 100644 (file)
@@ -177,6 +177,8 @@ void wxCDMProjectDescriptionPanel::CreateControls()
     {
       wxButton* libMgrbt = new wxButton(actionsPanel, ID_BUTTON_GOTO_LIB_MANAGER, _T("Library Manager"));
       libMgrbt->SetToolTip(wxT("Find the current available libraries into this project. You can also create new Libraries in this section as well as edit the lib folder's CMakeLists.txt file."));
+      libMgrbt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnLibMouseEnter,NULL,this);
+      libMgrbt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnLibMouseExit,NULL,this);
       actionsPanelSizer->Add(libMgrbt, 0, wxALL, 5);
     }
   // appli manager
@@ -185,11 +187,15 @@ void wxCDMProjectDescriptionPanel::CreateControls()
     {
       wxButton* appliMgrbt = new wxButton(actionsPanel, ID_BUTTON_GOTO_APPLI_MANAGER, _T("Application Manager"));
       appliMgrbt->SetToolTip(wxT("Find the current available applications into this project. You can also create new Applications in this section as well as edit the appli folder's CMakeLists.txt file."));
+      appliMgrbt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnAppliMouseEnter,NULL,this);
+      appliMgrbt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnAppliMouseExit,NULL,this);
       actionsPanelSizer->Add(appliMgrbt, 0, wxALL, 5);
     }
   // edit CMakeLists file
   wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
   editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt file of this project."));
+  editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnCMakeMouseEnter,NULL,this);
+  editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnCMakeMouseExit,NULL,this);
   actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5);
 
   //SetPanel sizer and box
@@ -220,6 +226,17 @@ void wxCDMProjectDescriptionPanel::OnBtnManageLibraries(wxCommandEvent& event)
   newEvent->SetId(1);
   newEvent->SetString(wxT("manage_libraries"));
   wxPostEvent(this->GetParent(), *newEvent);
+
+  wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+  if(this->project->GetLib() != NULL)
+    {
+      int CMId = this->project->GetLib()->GetId();
+      newEvent1->SetInt(CMId);
+      newEvent1->SetId(0);
+      wxPostEvent(this->GetParent(), *newEvent1);
+    }
+
   event.Skip();
 }
 
@@ -229,6 +246,17 @@ void wxCDMProjectDescriptionPanel::OnBtnManageApplications(wxCommandEvent& event
   newEvent->SetId(1);
   newEvent->SetString(wxT("manage_applications"));
   wxPostEvent(this->GetParent(), *newEvent);
+
+  wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+    if(this->project->GetAppli() != NULL)
+      {
+        int CMId = this->project->GetAppli()->GetId();
+        newEvent1->SetInt(CMId);
+        newEvent1->SetId(0);
+        wxPostEvent(this->GetParent(), *newEvent1);
+      }
+
   event.Skip();
 }
 
@@ -237,6 +265,16 @@ void wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
   std::string* result;
   if(!this->project->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->project->GetCMakeLists() != NULL)
+    {
+      int CMId = this->project->GetCMakeLists()->GetId();
+      newEvent->SetInt(CMId);
+      newEvent->SetId(0);
+      wxPostEvent(this->GetParent(), *newEvent);
+    }
 }
 
 void
@@ -257,11 +295,10 @@ wxCDMProjectDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
 {
   std::string* result;
   if(!this->project->OpenInFileExplorer(result))
-    wxMessageBox(crea::std2wx(*result),_T("Open File - Error!"),wxOK | wxICON_ERROR);
+    wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
 }
 
-void
-wxCDMProjectDescriptionPanel::OnBtnSetVersion(wxCommandEvent& event)
+void wxCDMProjectDescriptionPanel::OnBtnSetVersion(wxCommandEvent& event)
 {
   //TODO: implement method
   std::cerr << "Event OnBtnSetVersion not implemented" << std::endl;
@@ -290,3 +327,87 @@ wxCDMProjectDescriptionPanel::OnBtnSetVersion(wxCommandEvent& event)
   this->versionDatetc->SetLabel(crea::std2wx(this->project->GetVersionDate()));
 
 }
+
+void wxCDMProjectDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event)
+{
+  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+  if(this->project->GetCMakeLists() != NULL)
+    {
+      int CMId = this->project->GetCMakeLists()->GetId();
+      newEvent->SetInt(CMId);
+      newEvent->SetId(0);
+      wxPostEvent(this->GetParent(), *newEvent);
+    }
+  event.Skip();
+}
+
+void wxCDMProjectDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event)
+{
+  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+  if(this->project->GetCMakeLists() != NULL)
+    {
+      int CMId = this->project->GetCMakeLists()->GetId();
+      newEvent->SetInt(CMId);
+      newEvent->SetId(0);
+      wxPostEvent(this->GetParent(), *newEvent);
+    }
+  event.Skip();
+}
+
+void wxCDMProjectDescriptionPanel::OnAppliMouseEnter(wxMouseEvent& event)
+{
+  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+  std::cout << "entra appli " << this->project->GetAppli()->GetCMakeLists();
+  if(this->project->GetAppli() != NULL)
+    {
+      int AppId = this->project->GetAppli()->GetId();
+      newEvent->SetInt(AppId);
+      newEvent->SetId(0);
+      wxPostEvent(this->GetParent(), *newEvent);
+    }
+  event.Skip();
+}
+
+void wxCDMProjectDescriptionPanel::OnAppliMouseExit(wxMouseEvent& event)
+{
+  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+  if(this->project->GetAppli() != NULL)
+    {
+      int AppId = this->project->GetAppli()->GetId();
+      newEvent->SetInt(AppId);
+      newEvent->SetId(0);
+      wxPostEvent(this->GetParent(), *newEvent);
+    }
+  event.Skip();
+}
+
+void wxCDMProjectDescriptionPanel::OnLibMouseEnter(wxMouseEvent& event)
+{
+  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+  if(this->project->GetLib() != NULL)
+    {
+      int LbId = this->project->GetLib()->GetId();
+      newEvent->SetInt(LbId);
+      newEvent->SetId(0);
+      wxPostEvent(this->GetParent(), *newEvent);
+    }
+  event.Skip();
+}
+
+void wxCDMProjectDescriptionPanel::OnLibMouseExit(wxMouseEvent& event)
+{
+  wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+  if(this->project->GetLib() != NULL)
+    {
+      int LbId = this->project->GetLib()->GetId();
+      newEvent->SetInt(LbId);
+      newEvent->SetId(0);
+      wxPostEvent(this->GetParent(), *newEvent);
+    }
+  event.Skip();
+}