+
+ if (((wxCDMMainFrame*)this->GetParent())->isHelp())
+ {
+ wxCDMBlackBoxHelpDialog* helpDialog = new wxCDMBlackBoxHelpDialog(this->GetParent(), this->blackBox, wxID_ANY);
+ helpDialog->Show(true);
+ }
+}
+
+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 < (int)(parents.size()); i++)
+ {
+ if (parents[i]->GetPath() == parentURL)
+ {
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
+ newEvent->SetClientData(parents[i]);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ }
+
+}
+
+void wxCDMBlackBoxDescriptionPanel::OnBtnSetAuthor(wxCommandEvent& event)
+{
+ //get author from user
+ wxTextEntryDialog* authDlg = new wxTextEntryDialog(
+ this,
+ wxT("Enter the new authors name. Separate each author with a '/'."),
+ wxT("Change Black Box Author - creaDevManager"),
+ crea::std2wx(this->blackBox->GetAuthors()),
+ wxOK | wxCANCEL
+ );
+
+ if (authDlg->ShowModal() == wxID_OK)
+ {
+ std::string authorsStr = crea::wx2std(authDlg->GetValue());
+ //check name
+ if(authorsStr.size() > 0)
+ {
+ std::string* result;
+ if(!this->blackBox->SetAuthors(authorsStr, result))
+ wxMessageBox(crea::std2wx(*result),_T("Change Black Box Author - Error!"),wxOK | wxICON_ERROR);
+
+ }
+
+ this->authortc->SetLabel(crea::std2wx(this->blackBox->GetAuthors()));
+ this->authortc->GetParent()->GetSizer()->RecalcSizes();
+ }
+
+}
+
+void wxCDMBlackBoxDescriptionPanel::OnBtnSetDescription(wxCommandEvent& event)
+{
+ //get author from user
+ wxTextEntryDialog* descDlg = new wxTextEntryDialog(
+ this,
+ wxT("Edit the black box description."),
+ wxT("Change Black Box Description - creaDevManager"),
+ crea::std2wx(this->blackBox->GetDescription()),
+ wxTE_MULTILINE | wxOK | wxCANCEL
+ );
+
+ if (descDlg->ShowModal() == wxID_OK)
+ {
+ std::string descriptionStr = crea::wx2std(descDlg->GetValue());
+ //check name
+ if(descriptionStr.size() > 0)
+ {
+ std::string* result;
+ if(!this->blackBox->SetDescription(descriptionStr, result))
+ wxMessageBox(crea::std2wx(*result),_T("Change Black Box Description - Error!"),wxOK | wxICON_ERROR);
+ }
+ this->descriptiontc->SetLabel(crea::std2wx(this->blackBox->GetDescription()));
+ this->descriptiontc->GetParent()->GetSizer()->RecalcSizes();
+ }
+}
+
+void wxCDMBlackBoxDescriptionPanel::OnBtnSetCategories(wxCommandEvent& event)
+{
+ //get author from user
+ wxTextEntryDialog* catsDlg = new wxTextEntryDialog(
+ this,
+ wxT("Edit the black box categories separated by '/'."),
+ wxT("Change Black Box Categories - creaDevManager"),
+ crea::std2wx(this->blackBox->GetCategories()),
+ wxTE_MULTILINE | wxOK | wxCANCEL
+ );
+
+ if (catsDlg->ShowModal() == wxID_OK)
+ {
+ std::string categoriesStr = crea::wx2std(catsDlg->GetValue());
+ //check name
+ if(categoriesStr.size() > 0)
+ {
+ std::string* result;
+ if(!this->blackBox->SetCategories(categoriesStr, result))
+ wxMessageBox(crea::std2wx(*result),_T("Change Black Box Categories - Error!"),wxOK | wxICON_ERROR);
+ }
+ this->categoriestc->SetLabel(crea::std2wx(this->blackBox->GetCategories()));
+ this->categoriestc->GetParent()->GetSizer()->RecalcSizes();
+ }