wxFlexGridSizer* actionsGridSizer = new wxFlexGridSizer(2, 2, 9, 15);
wxButton* openHxxbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_HXX, _T("A. Open .h"));
+ openHxxbt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMBlackBoxDescriptionPanel::OnHxxMouseEnter,NULL,this);
+ openHxxbt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMBlackBoxDescriptionPanel::OnHxxMouseExit,NULL,this);
openHxxbt->SetToolTip(wxT("Open the .h file in the default text editor."));
actionsGridSizer->Add(openHxxbt, 1, wxALL | wxEXPAND, 5);
wxButton* openCxxbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_CXX, _T("B. Open .cxx"));
+ openCxxbt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMBlackBoxDescriptionPanel::OnCxxMouseEnter,NULL,this);
+ openCxxbt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMBlackBoxDescriptionPanel::OnCxxMouseExit,NULL,this);
openCxxbt->SetToolTip(wxT("Open the .cxx file in the default text editor."));
actionsGridSizer->Add(openCxxbt, 1, wxALL | wxEXPAND, 5);
wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("C. Open Source Folder"));
void wxCDMBlackBoxDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
{
std::vector<modelCDMIProjectTreeNode*> parents = this->blackBox->GetParents();
- std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
- //std::cout << parentURL << std::endl;
- for (int i = 0; i < parents.size(); i++)
- {
- if (parents[i]->GetPath() == parentURL)
- {
- wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
- newEvent->SetInt(parents[i]->GetId());
- newEvent->SetId(0);
- wxPostEvent(this->GetParent(), *newEvent);
- }
- }
+ std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
+ //std::cout << parentURL << std::endl;
+ for (int i = 0; i < parents.size(); i++)
+ {
+ if (parents[i]->GetPath() == parentURL)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
+ newEvent->SetInt(parents[i]->GetId());
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
}
std::string* result;
if(!this->blackBox->OpenCxx(result))
wxMessageBox(crea::std2wx(*result),_T("Open Source File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->blackBox->GetSourceFile() != NULL)
+ {
+ int CMId = this->blackBox->GetSourceFile()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+
+ event.Skip();
}
void wxCDMBlackBoxDescriptionPanel::OnBtnOpenHxx(wxCommandEvent& event)
std::string* result;
if(!this->blackBox->OpenHxx(result))
wxMessageBox(crea::std2wx(*result),_T("Open Header File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->blackBox->GetHeaderFile() != NULL)
+ {
+ int CMId = this->blackBox->GetHeaderFile()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+
+ event.Skip();
}
void wxCDMBlackBoxDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
if(!this->blackBox->OpenInFileExplorer(result))
wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
}
+
+void wxCDMBlackBoxDescriptionPanel::OnCxxMouseEnter(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(this->blackBox->GetSourceFile() != NULL)
+ {
+ int CMId = this->blackBox->GetSourceFile()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ event.Skip();
+}
+
+void wxCDMBlackBoxDescriptionPanel::OnCxxMouseExit(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->blackBox->GetSourceFile() != NULL)
+ {
+ int CMId = this->blackBox->GetSourceFile()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ event.Skip();
+}
+
+void wxCDMBlackBoxDescriptionPanel::OnHxxMouseEnter(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(this->blackBox->GetHeaderFile() != NULL)
+ {
+ int CMId = this->blackBox->GetHeaderFile()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ event.Skip();
+}
+
+void wxCDMBlackBoxDescriptionPanel::OnHxxMouseExit(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->blackBox->GetHeaderFile() != NULL)
+ {
+ int CMId = this->blackBox->GetHeaderFile()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ event.Skip();
+}