+ {
+ //create project
+ if(this->model->GetProject() != NULL)
+ {
+ if(!this->model->CloseProject(result))
+ {
+ std::cout << "error closing project: " << *result << std::endl;
+ wxMessageBox(crea::std2wx(*result),_T("New Project - Error!"),wxOK | wxICON_ERROR);
+ event.Skip();
+ return;
+ }
+ }
+
+ if(!this->model->CreateProject(
+ crea::wx2std(dialog->GetProjectName()),
+ crea::wx2std(dialog->GetProjectLocation()),
+ result,
+ crea::wx2std(dialog->GetPackageAuthor()),
+ crea::wx2std(dialog->GetPackageDescription())
+ ))
+ {
+ std::cout << "error opening project: " << *result << std::endl;
+ wxMessageBox(crea::std2wx(*result),_T("New Project - Error!"),wxOK | wxICON_ERROR);
+ event.Skip();
+ return;
+ }
+
+ //populate tree control
+ tree_Projects->BuildTree(this->model->GetProject());
+ tree_Projects->SelectItem(this->model->GetProject()->GetId());
+
+ //change description panel
+ if(this->panel_Properties != NULL)
+ {
+ auiManager.DetachPane(this->panel_Properties);
+ this->panel_Properties->Destroy();
+ }
+
+ this->panel_Properties = new wxCDMProjectDescriptionPanel(
+ this,
+ this->model->GetProject(),
+ ID_WINDOW_PROPERTIES,
+ wxT("Description Panel"),
+ wxDefaultPosition,
+ wxSize(300, 400),
+ 0);
+ //show projectactions panel
+ if(this->panel_ProjectActions != NULL)
+ {
+ auiManager.DetachPane(this->panel_Properties);
+ this->panel_ProjectActions->Destroy();
+ }
+
+ panel_ProjectActions = new wxCDMProjectActionsPanel(
+ this,
+ ID_WINDOW_PROJ_ACTIONS,
+ wxT("Project Actions Panel"),
+ wxDefaultPosition,
+ wxSize(600,200),
+ 0
+ );
+ panel_ProjectActions->SetMinSize(wxSize(500, 100));
+
+
+ auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
+ auiManager.AddPane(panel_ProjectActions, wxBOTTOM, wxT("Project Actions"));
+
+ auiManager.Update();
+
+ wxMessageBox(_T("New Project created!"),_T("New Project - Success!"), wxOK | wxICON_INFORMATION);
+ }