std::string tt = "Name: " + libraries[i]->GetName() + "\n";
tt += "Location: " + libraries[i]->GetPath();
pLibrarylk->SetToolTip(crea::std2wx(tt.c_str()));
+ pLibrarylk->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibDescriptionPanel::OnMouseEnter,NULL,this);
+ pLibrarylk->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibDescriptionPanel::OnMouseExit,NULL,this);
propertiesPanelSizer -> Add(pLibrarylk, 0, wxALIGN_LEFT | wxALL, 5);
}
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."));
void wxCDMLibDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl;
- event.Skip();
+ 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)
newEvent->SetId(0);
wxPostEvent(this->GetParent(), *newEvent);
+ wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+ newEvent1->SetInt(libraryId);
+ newEvent1->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent1);
+
}
void wxCDMLibDescriptionPanel::OnBtnReturn(wxCommandEvent& event)
void wxCDMLibDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl;
+ std::string* result;
+ if(!this->lib->OpenInFileExplorer(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
+}
+
+void wxCDMLibDescriptionPanel::OnMouseEnter(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+ std::string LibName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
+ int lbId = 0;
+ std::vector<modelCDMLibrary*> libraries = this->lib->GetLibraries();
+ for (int i = 0; i < libraries.size(); i++)
+ {
+ if(libraries[i]->GetName() == LibName)
+ {
+ lbId = libraries[i]->GetId();
+ break;
+ }
+ }
+ newEvent->SetInt(lbId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ event.Skip();
+}
+
+void wxCDMLibDescriptionPanel::OnMouseExit(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+ std::string LibName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
+ int lbId = 0;
+ std::vector<modelCDMLibrary*> libraries = this->lib->GetLibraries();
+ for (int i = 0; i < libraries.size(); i++)
+ {
+ if(libraries[i]->GetName() == LibName)
+ {
+ lbId = libraries[i]->GetId();
+ break;
+ }
+ }
+ newEvent->SetInt(lbId);
+ newEvent->SetId(0);
+ 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();
}