+
+ if (((wxCDMMainFrame*)this->GetParent())->isHelp())
+ {
+ wxCDMApplicationHelpDialog* helpDialog = new wxCDMApplicationHelpDialog(this->GetParent(), this->application, wxID_ANY);
+ helpDialog->Show(true);
+ }
+}
+
+void wxCDMApplicationDescriptionPanel::OnBtnReturn(wxHyperlinkEvent& event)
+{
+ std::vector<modelCDMIProjectTreeNode*> parents = this->application->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 wxCDMApplicationDescriptionPanel::OnBtnSetExeName(wxCommandEvent& event)
+{
+ //get name
+ wxString versionWx = wxGetTextFromUser(
+ wxT("Enter the new executable name"),
+ wxT("Change Application Executable Name - creaDevManager"),
+ crea::std2wx(this->application->GetExecutableName())
+ );
+ //check name
+ std::vector<std::string> parts;
+ CDMUtilities::splitter::split(parts, crea::wx2std(versionWx), " .", CDMUtilities::splitter::no_empties);
+ if(parts.size() > 0)
+ {
+ std::string* result;
+ if(!this->application->SetExecutableName(crea::wx2std(versionWx), result))
+ wxMessageBox(crea::std2wx(*result),_T("Change Application Executable Name - Error!"),wxOK | wxICON_ERROR);
+ }
+ else
+ {
+ wxMessageBox(crea::std2wx("No name specified"),_T("Set Application Executable Name - Error!"),wxOK | wxICON_ERROR);
+ }
+ this->executableNametc->SetLabel(crea::std2wx(this->application->GetExecutableName()));
+}
+
+void wxCDMApplicationDescriptionPanel::OnBtnCreateClass(wxCommandEvent& event)
+{
+ //get class name from user
+ wxTextEntryDialog* newClassDlg = new wxTextEntryDialog(
+ this,
+ wxT("Please enter the new class name."),
+ wxT("New Class - creaDevManager"),
+ wxT(""),
+ wxOK | wxCANCEL
+ );
+
+ if (newClassDlg->ShowModal() == wxID_OK)
+ {
+ std::string className = crea::wx2std(newClassDlg->GetValue());
+ //check class name
+ if(className.size() > 0)
+ {
+ if(!this->application->CreateClass(className))
+ wxMessageBox(crea::std2wx("Something has gone wrong with the creation of the class."),_T("New Class - Error!"),wxOK | wxICON_ERROR);
+
+ ((wxCDMMainFrame*)this->GetParent())->RefreshProject();
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
+ newEvent->SetId(0);
+ newEvent->SetClientData(this->application);
+ wxPostEvent(this->GetParent(), *newEvent);
+
+ wxMessageBox(crea::std2wx("The class has been created successfully."),_T("New Class - Success"),wxOK | wxICON_INFORMATION);
+ }
+ else
+ {
+ wxMessageBox(crea::std2wx("The new class name cannot be empty."),_T("New Class - Error!"),wxOK | wxICON_ERROR);
+ }
+ }