+ std::string* result;
+ if(!this->folder->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->folder->GetCMakeLists() != NULL)
+ {
+ int CMId = this->folder->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+}
+
+void wxCDMFolderDescriptionPanel::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->folder->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->SetInt(folder->GetId());
+ 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);
+ }
+ }
+}
+
+void wxCDMFolderDescriptionPanel::OnBtnCreateFolder(wxCommandEvent& event)
+{
+ //get name
+ wxString folderName = wxGetTextFromUser(
+ wxT("Enter the name of the new folder:"),
+ wxT("Create Folder - creaDevManager")
+ );
+ //check name
+ std::vector<std::string> parts;
+ CDMUtilities::splitter::split(parts, crea::wx2std(folderName), " /\\\"", CDMUtilities::splitter::no_empties);
+ if(parts.size() > 0)
+ {
+ std::string* result;
+ modelCDMFolder* folderC = this->folder->CreateFolder(crea::wx2std(folderName), result);
+ if(folderC == NULL)
+ {
+ wxMessageBox(crea::std2wx(*result),_T("Create Folder - Error!"),wxOK | wxICON_ERROR);
+ return;
+ }
+ ((wxCDMMainFrame*)this->GetParent())->RefreshProject();
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED);
+ newEvent->SetInt(folderC->GetId());
+ wxPostEvent(this->GetParent(), *newEvent);
+ wxMessageBox(crea::std2wx("The folder was successfully created"),_T("Create Folder - Success"),wxOK | wxICON_INFORMATION);
+ }
+ else
+ {
+ wxMessageBox(crea::std2wx("No name specified"),_T("Create Folder - Error!"),wxOK | wxICON_ERROR);
+ }
+}
+
+void wxCDMFolderDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(this->folder->GetCMakeLists() != NULL)
+ {
+ int CMId = this->folder->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ event.Skip();
+}
+
+void wxCDMFolderDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->folder->GetCMakeLists() != NULL)
+ {
+ int CMId = this->folder->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }