X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FwxCDMAppliDescriptionPanel.cpp;fp=lib%2FcreaDevManagerLib%2FwxCDMAppliDescriptionPanel.cpp;h=390af69172107bdd39b26262717276195ab93739;hb=d8222afd6508f39bd37426842667de2e431cca4a;hp=778525fe842d8b309ea8a5017bb5a4daedc904de;hpb=036496dbec6fb28a616b9fa5b4d5b80f72fb040f;p=crea.git diff --git a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp index 778525f..390af69 100644 --- a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp @@ -104,11 +104,13 @@ void wxCDMAppliDescriptionPanel::CreateControls() std::vector applications = this->appli->GetApplications(); for (int i = 0; i < applications.size(); i++) { - wxHyperlinkCtrl* pLibrarylk = new wxHyperlinkCtrl(propertiesPanel,ID_LINK_SELECT_APPLICATION, crea::std2wx(applications[i]->GetName().c_str()), crea::std2wx(applications[i]->GetName().c_str())); + wxHyperlinkCtrl* pApplicationlk = new wxHyperlinkCtrl(propertiesPanel,ID_LINK_SELECT_APPLICATION, crea::std2wx(applications[i]->GetName().c_str()), crea::std2wx(applications[i]->GetName().c_str())); std::string tt = "Name: " + applications[i]->GetName() + "\n"; tt += "Location: " + applications[i]->GetPath(); - pLibrarylk->SetToolTip(crea::std2wx(tt.c_str())); - propertiesPanelSizer -> Add(pLibrarylk, 0, wxALIGN_LEFT | wxALL, 5); + pApplicationlk->SetToolTip(crea::std2wx(tt.c_str())); + pApplicationlk->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMAppliDescriptionPanel::OnMouseEnter,NULL,this); + pApplicationlk->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMAppliDescriptionPanel::OnMouseExit,NULL,this); + propertiesPanelSizer -> Add(pApplicationlk, 0, wxALIGN_LEFT | wxALL, 5); } propertiesPanel->SetSizer(propertiesPanelSizer); @@ -196,6 +198,10 @@ void wxCDMAppliDescriptionPanel::OnLnkApplicationSelect(wxHyperlinkEvent& event) break; } } + wxCommandEvent* newEvent1 = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED); + newEvent1->SetInt(applicationId); + newEvent1->SetId(0); + wxPostEvent(this->GetParent(), *newEvent1); wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); newEvent->SetInt(applicationId); @@ -211,10 +217,50 @@ void wxCDMAppliDescriptionPanel::OnBtnReturn(wxCommandEvent& event) wxPostEvent(this->GetParent(), *newEvent); } -void -wxCDMAppliDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event) +void wxCDMAppliDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event) { //TODO: implement method std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl; event.Skip(); } + +void wxCDMAppliDescriptionPanel::OnMouseEnter(wxMouseEvent& event) +{ + wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED); + std::string AppName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL()); + int appId = 0; + std::vector applications = this->appli->GetApplications(); + for (int i = 0; i < applications.size(); i++) + { + if(applications[i]->GetName() == AppName) + { + appId = applications[i]->GetId(); + break; + } + } + newEvent->SetInt(appId); + newEvent->SetId(0); + wxPostEvent(this->GetParent(), *newEvent); + event.Skip(); +} + +void wxCDMAppliDescriptionPanel::OnMouseExit(wxMouseEvent& event) +{ + wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED); + std::string AppName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL()); + int appId = 0; + std::vector applications = this->appli->GetApplications(); + for (int i = 0; i < applications.size(); i++) + { + if(applications[i]->GetName() == AppName) + { + appId = applications[i]->GetId(); + break; + } + } + newEvent->SetInt(appId); + newEvent->SetId(0); + wxPostEvent(this->GetParent(), *newEvent); + event.Skip(); +} +