+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();
+ }
+}
+