actionsPanelSizer->Add(createPkgbt, 0, wxALL, 5);
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)&wxCDMPackageManagerPanel::OnCMakeMouseEnter,NULL,this);
+ editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageManagerPanel::OnCMakeMouseExit,NULL,this);
actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5);
actionsPanel->SetSizer(actionsPanelSizer);
void wxCDMPackageManagerPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnCreatePackage not implemented" << std::endl;
- event.Skip();
+ 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 wxCDMPackageManagerPanel::OnMouseEnter(wxMouseEvent& event)
event.Skip();
}
+void wxCDMPackageManagerPanel::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 wxCDMPackageManagerPanel::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();
+}
+