--- /dev/null
+/*
+ * ControlCreaDevManagerMain.cpp
+ *
+ * Created on: 5/11/2012
+ * Author: daniel
+ */
+
+#include "ControlCreaDevManagerMain.h"
+#include "ModelCreaDevManagerTree.h"
+
+#include <cstdio>
+#include <fstream>
+
+ControlCreaDevManagerMain::ControlCreaDevManagerMain()
+{
+}
+
+ControlCreaDevManagerMain::~ControlCreaDevManagerMain()
+{
+}
+
+const ModelCreaDevManagerTree& ControlCreaDevManagerMain::GetActiveProjects() const
+{
+ return projectsTree;
+}
+
+bool ControlCreaDevManagerMain::LoadActiveProjects()
+{
+ // TODO LoadActiveProjects
+ std::cerr << "LoadActiveProjects unimplemented yet" << std::endl;
+ return true;
+}
+
+bool ControlCreaDevManagerMain::UpdateActiveProjects()
+{
+ // TODO UpdateActiveProjects
+ std::cerr << "UpdateActiveProjects unimplemented yet" << std::endl;
+ return true;
+}
+
+const int ControlCreaDevManagerMain::OpenProject(const std::string& actualpath)
+{
+ std::string path = actualpath;
+ std::cout << "selection path: "<< path << std::endl;
+ std::string path1 = path + "/Makefile";
+ FILE* pFile = fopen(path1.c_str(), "r");
+ if(pFile == NULL) // not the binary folder
+ {
+ std::cerr << path1 << ": file not found..." << std::endl;
+ path1 = path + "/CMakeLists.txt";
+ pFile = fopen(path1.c_str(), "r");
+ if(pFile == NULL) //not the source folder
+ {
+ std::cerr << path1 << ": file not found..." << std::endl;
+ return 1;
+ }else{//source folder
+ std::cout << "sources folder found..." << std::endl;
+ fclose(pFile);
+ }
+ }else{//binary folder
+ std::cout << "binary folder found..." << std::endl;
+ fclose(pFile);
+
+ std::ifstream readFile;
+ readFile.open(path1.c_str());
+ std::string word;
+ bool found = false;
+
+ while(!found && readFile >> word)
+ {
+ //cout << word << endl;
+ if(word == "CMAKE_SOURCE_DIR")
+ {
+ readFile >> word;
+ readFile.ignore();
+ getline(readFile, word, '\n');
+ path = word;
+ found = true;
+ }
+ }
+ readFile.close();
+
+ if(!found)
+ {
+ std::cerr << "sources not found..." << std::endl;
+
+ return 2;
+ }else{
+ pFile = fopen(path.c_str(), "r");
+ std::cout << "sources at " << path << " open = " << (pFile != NULL) << std::endl;
+ std::cout.flush();
+ }
+ }
+
+ projectsTree.addRoot(path);
+ projectsTree.populateNode(path);
+ return 0;
+}
+
+bool ControlCreaDevManagerMain::CloseProject(const std::string& projectName)
+{
+ // TODO CloseProject
+ std::cerr << "CloseProject unimplemented yet" << std::endl;
+ return true;
+}
--- /dev/null
+/*
+ * ControlCreaDevManagerMain.h
+ *
+ * Created on: 5/11/2012
+ * Author: daniel
+ */
+
+#ifndef CONTROLCREADEVMANAGERMAIN_H_
+#define CONTROLCREADEVMANAGERMAIN_H_
+
+#include <iostream>
+#include "ModelCreaDevManagerTree.h"
+
+class ControlCreaDevManagerMain
+{
+public:
+ ControlCreaDevManagerMain();
+ ~ControlCreaDevManagerMain();
+
+ const ModelCreaDevManagerTree& GetActiveProjects() const;
+ bool LoadActiveProjects();
+ bool UpdateActiveProjects();
+ const int OpenProject(const std::string& path);
+ bool CloseProject(const std::string& projectName);
+
+private:
+ ModelCreaDevManagerTree projectsTree;
+};
+
+
+
+#endif /* CONTROLCREADEVMANAGERMAIN_H_ */
--- /dev/null
+/*
+ * ControlCreaDevManagerProject.cpp
+ *
+ * Created on: 5/11/2012
+ * Author: daniel
+ */
+
+#include "ControlCreaDevManagerProject.h"
+
+#include <creaWx.h>
+#include <wx/dirdlg.h>
+#include <stdlib.h> // for getenv
+
+ControlCreaDevManagerProject::ControlCreaDevManagerProject()
+{
+ // TODO Auto-generated constructor stub
+
+}
+
+ControlCreaDevManagerProject::~ControlCreaDevManagerProject()
+{
+ // TODO Auto-generated destructor stub
+}
+
+bool ControlCreaDevManagerProject::CreateProject(const std::string& name, const std::string& dir, const std::string& author, const std::string& description)
+{
+
+#if(_WIN32)
+
+ std::string command("creaNewProject.bat ");
+ std::string command1("creaSed.exe ");
+ std::string command2("del ");
+
+ command += "\"" + dir + "\" \"" + name + "\"";
+ command1 += "\"" + dir+"\\"+name+"\\CMakeLists.txt.in\" " + "NameOfTheProject " + name + "> \"" + dir + "\\" + name + "\\CMakeLists.txt\"";
+ command2 += "\"" + dir+"\\"+name+"\\CMakeLists.txt.in\"";
+ if ( ! system ( command.c_str() ) )
+ {
+ system ( command1.c_str() );
+ system ( command2.c_str() );
+
+ // Create a Package at the same time. JPR
+ char *author = author.c_str();
+ std::string nomDirectory = dir + "\\" + name;
+ std::string nomPackageDirectory = nomDirectory + "\\" + "bbtk_" + name + "_PKG";
+ std::string bbCreatePackage("bbCreatePackage ");
+ bbCreatePackage += nomDirectory + " " + name + " " + author + " " + description;
+ system (bbCreatePackage.c_str());
+ std::string add;
+ add = "echo ADD_SUBDIRECTORY(bbtk_" + name + "_PKG) >> " + nomDirectory + "/CMakeLists.txt";
+ system(add.c_str());
+
+ wxMessageBox(_T("New Project created !"),_T("creaNewProject"), wxOK | wxICON_INFORMATION);
+ }
+ else
+ {
+ wxString err(_T("An error occured while running '"));
+ err += crea::std2wx(command) + _T("'");
+ wxMessageBox(err,_T("creaNewProject"),wxOK | wxICON_ERROR);
+ return false;
+ }
+
+// ------ LINUX / MacOS
+
+#else
+ std::string command("creaNewProject.sh ");
+ command += "\"" + dir + "\"" +" " + name;
+ std::cout << "executing " << command << std::endl;
+ if ( ! system ( command.c_str() ) )
+ {
+ //wxMessageBox(_T("New Project created !"),_T("creaNewProject"), wxOK | wxICON_INFORMATION);
+
+ std::string nomDirectory = dir + "/" + name;
+ std::string nomPackageDirectory = nomDirectory + "/" + "bbtk_" + name + "_PKG";
+
+ std::string bbCreatePackage("bbCreatePackage ");
+ bbCreatePackage += nomDirectory + " " + name + " " + author + " " + description;
+ std::cout << "executing " << bbCreatePackage << std::endl;
+ system (bbCreatePackage.c_str());
+
+ std::string add;
+ add = "echo 'ADD_SUBDIRECTORY(bbtk_" + name + "_PKG)' >> " + nomDirectory + "/CMakeLists.txt";
+ //std::cout << add << std::endl;
+ std::cout << "executing " << add << std::endl;
+ system(add.c_str());
+
+ }
+ else
+ {
+ wxString err(_T("An error occured while running '"));
+ err += crea::std2wx(command) + _T("'");
+ wxMessageBox(err,_T("creaNewProject"),wxOK | wxICON_ERROR);
+ return false;
+ }
+
+#endif
+
+ return true;
+}
--- /dev/null
+/*
+ * ControlCreaDevManagerProject.h
+ *
+ * Created on: 5/11/2012
+ * Author: daniel
+ */
+
+#ifndef CONTROLCREADEVMANAGERPROJECT_H_
+#define CONTROLCREADEVMANAGERPROJECT_H_
+
+#include <iostream>
+
+class ControlCreaDevManagerProject
+{
+public:
+ ControlCreaDevManagerProject();
+ ~ControlCreaDevManagerProject();
+ static bool CreateProject(const std::string& name, const std::string& location, const std::string& author, const std::string& description);
+};
+
+#endif /* CONTROLCREADEVMANAGERPROJECT_H_ */
path += breadcrumbs[i] + "/";
}
name = breadcrumbs[breadcrumbs.size()-1];
- this->projectRoots.push_back(ModelCreaDevManagerTreeNode(path,name,DT_DIR,0));
+
+ bool projectFound = false;
+ for (int i = 0; i < this->projectRoots.size(); i++)
+ {
+ if(this->projectRoots[i].GetName() == name)
+ projectFound = true;
+ }
+
+ if(!projectFound)
+ {
+ this->projectRoots.push_back(ModelCreaDevManagerTreeNode(path,name,DT_DIR,0));
+ }else{
+ std::cout << "already existing ";
+ }
std::cout << "project root added: " << name << " in " << path << std::endl;
}
{
}
-std::string ModelCreaDevManagerTreeNode::GetPath()
+const std::string& ModelCreaDevManagerTreeNode::GetPath() const
{
return this->_path;
}
-std::string ModelCreaDevManagerTreeNode::GetName()
+const std::string& ModelCreaDevManagerTreeNode::GetName() const
{
return this->_name;
}
-unsigned char ModelCreaDevManagerTreeNode::GetType()
+const unsigned char& ModelCreaDevManagerTreeNode::GetType() const
{
return this->_type;
}
-int ModelCreaDevManagerTreeNode::GetLevel()
+const int& ModelCreaDevManagerTreeNode::GetLevel() const
{
return this->_level;
}
-std::vector<ModelCreaDevManagerTreeNode>& ModelCreaDevManagerTreeNode::GetChildren()
+const std::vector<ModelCreaDevManagerTreeNode>& ModelCreaDevManagerTreeNode::GetChildren() const
{
return this->_children;
}
ModelCreaDevManagerTreeNode(std::string path, std::string name, unsigned char type, int level);
~ModelCreaDevManagerTreeNode();
- std::string GetPath();
- std::string GetName();
- unsigned char GetType();
- int GetLevel();
- std::vector<ModelCreaDevManagerTreeNode>& GetChildren();
+ const std::string& GetPath() const;
+ const std::string& GetName() const;
+ const unsigned char& GetType() const;
+ const int& GetLevel() const;
+ const std::vector<ModelCreaDevManagerTreeNode>& GetChildren() const;
void SetChildren(std::vector<ModelCreaDevManagerTreeNode>& children);
#define ID_WINDOW_PROPERTIES 10225
#define ID_WINDOW_PROJ_ACTIONS 10226
+#define ID_BUTTON_NEXT 10300
+#define ID_BUTTON_CANCEL 10301
+#define ID_BUTTON_CHOOSE 10302
+
#endif /* CREADEVMANAGERIDS_H_ */
#include "wxCreaDevManagerDescriptionPanel.h"
#include "wxCreaDevManagerProjectActionsPanel.h"
+#include "wxCreaDevManagerNewProjectDialog.h"
+#include "ControlCreaDevManagerMain.h"
#include <wx/dirdlg.h>
auiManager.UnInit();
}
+void wxCreaDevManagerMainFrame::UpdateVisual()
+{
+ auiManager.Update();
+ this->Update();
+}
+
bool wxCreaDevManagerMainFrame::Create(
wxWindow* parent,
wxWindowID id,
)
{
wxFrame::Create(parent, id, caption, pos, size, style);
+ this->controller = new ControlCreaDevManagerMain();
+ this->controller->LoadActiveProjects();
CreateMenus();
CreateControls();
return TRUE;
//File menu
void wxCreaDevManagerMainFrame::OnMenuNewProject(wxCommandEvent& event)
{
- std::cerr << "Event OnMenuNewProject not implemented yet" << std::endl;
+ wxCreaDevManagerNewProjectDialog* dialog = new wxCreaDevManagerNewProjectDialog(this, this->controller);
+ long userResponse;
+ userResponse = dialog->ShowModal();
+
+ ((wxCreaDevManagerTreeCtrl*)tree_Projects)->BuildTree(this->controller->GetActiveProjects());
+
+ this->UpdateVisual();
+
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuOpenProject(wxCommandEvent& event)
{
- //std::cerr << "Event OnMenuOpenProject not implemented" << std::endl;
-
long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
wxDirDialog* FD = new wxDirDialog(this, wxString("Select the project directory"), wxString(""), style);
long userResponse;
userResponse = FD->ShowModal();
if(userResponse == wxID_OK)
{
- std::string path = crea::wx2std (FD->GetPath());
- std::cout << "selection path: "<< path << std::endl;
- std::string path1 = path + "/Makefile";
-
- FILE* pFile = fopen(path1.c_str(), "r");
- if(pFile == NULL) // not the binary folder
+ switch(this->controller->OpenProject(crea::wx2std (FD->GetPath())))
{
- std::cerr << path1 << ": file not found..." << std::endl;
- path1 = path + "/CMakeLists.txt";
- pFile = fopen(path1.c_str(), "r");
- if(pFile == NULL) //not the source folder
- {
- std::cerr << path1 << ": file not found..." << std::endl;
- wxMessageBox( wxT("No project selected."), wxT("Open Project - Error"), wxICON_ERROR);
- event.Skip();
- return;
- }else{//source folder
- std::cout << "sources folder found..." << std::endl;
- fclose(pFile);
- }
- }else{//binary folder
- std::cout << "binary folder found..." << std::endl;
- fclose(pFile);
-
- std::ifstream readFile;
- readFile.open(path1.c_str());
- std::string word;
- bool found = false;
- while(!found && readFile >> word)
- {
- //cout << word << endl;
- if(word == "CMAKE_SOURCE_DIR")
- {
- readFile >> word;
- readFile.ignore();
- getline(readFile, word, '\n');
- path = word;
- found = true;
- }
- }
- readFile.close();
-
- if(!found)
- {
- std::cerr << "sources not found..." << std::endl;
- wxMessageBox( wxString("Sources not found."), wxString("Open Project - Error"), wxICON_ERROR);
- event.Skip();
- return;
- }else{
- pFile = fopen(path.c_str(), "r");
- std::cout << "sources at " << path << " open = " << (pFile != NULL) << std::endl;
- std::cout.flush();
- }
- }
-
-
- this->projectTree.addRoot(path);
- this->projectTree.populateNode(path);
-
- ((wxCreaDevManagerTreeCtrl*)tree_Projects)->BuildTree(this->projectTree);
+ case 1:
+ wxMessageBox( wxT("No project selected."), wxT("Open Project - Error"), wxICON_ERROR);
+ event.Skip();
+ break;
+ case 2:
+ wxMessageBox( wxString("Sources not found."), wxString("Open Project - Error"), wxICON_ERROR);
+ event.Skip();
+ break;
+ case 0:
+ break;
+ };
+
+ ((wxCreaDevManagerTreeCtrl*)tree_Projects)->BuildTree(this->controller->GetActiveProjects());
auiManager.Update();
}
#include <wx/aui/aui.h>
#include "ModelCreaDevManagerTree.h"
+#include "ControlCreaDevManagerMain.h"
class wxCreaDevManagerMainFrame:public wxFrame
{
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE
);
+ void UpdateVisual();
protected:
void CreateMenus();
wxPanel* panel_ProjectActions;
//Model
- ModelCreaDevManagerTree projectTree;
+ ControlCreaDevManagerMain* controller;
};
--- /dev/null
+/*
+ * wxCreaDevManagerNewProjectDialog.cpp
+ *
+ * Created on: 2/11/2012
+ * Author: daniel
+ */
+
+#include "wxCreaDevManagerNewProjectDialog.h"
+
+#include "wx/richtext/richtextctrl.h"
+
+#include "creaDevManagerIds.h"
+
+#include "ControlCreaDevManagerProject.h"
+
+#include "wxCreaDevManagerMainFrame.h"
+
+BEGIN_EVENT_TABLE(wxCreaDevManagerNewProjectDialog, wxDialog)
+ EVT_BUTTON(ID_BUTTON_NEXT, wxCreaDevManagerNewProjectDialog::OnCreateProject)
+ EVT_BUTTON(ID_BUTTON_CANCEL, wxCreaDevManagerNewProjectDialog::OnCancel)
+ EVT_BUTTON(ID_BUTTON_CHOOSE, wxCreaDevManagerNewProjectDialog::OnChooseLocation)
+END_EVENT_TABLE()
+
+wxCreaDevManagerNewProjectDialog::wxCreaDevManagerNewProjectDialog(
+ wxWindow* parent,
+ ControlCreaDevManagerMain* controller,
+ wxWindowID id,
+ const wxString& caption,
+ const wxPoint& position,
+ const wxSize& size,
+ long style
+)
+{
+ this->Controller = controller;
+ wxCreaDevManagerNewProjectDialog::Create(parent, id, caption, position, size, style);
+}
+
+wxCreaDevManagerNewProjectDialog::~wxCreaDevManagerNewProjectDialog()
+{
+}
+
+bool wxCreaDevManagerNewProjectDialog::Create(
+ wxWindow* parent,
+ wxWindowID id,
+ const wxString& caption,
+ const wxPoint& position,
+ const wxSize& size,
+ long style
+)
+{
+ wxDialog::Create(parent, id, caption, position, size, style);
+
+ this->CreateControls();
+
+ return TRUE;
+}
+
+void wxCreaDevManagerNewProjectDialog::CreateControls()
+{
+ wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
+
+
+ wxStaticText* title = new wxStaticText(this, wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);//new wxRichTextCtrl(this,wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxRE_READONLY);
+ v_sizer1->Add(title, 0, wxALIGN_LEFT | wxALL | wxALIGN_CENTER_VERTICAL, 5);
+
+ wxStaticText* instruction = new wxStaticText(this, wxID_ANY, wxString("Please fill the following details."), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+ v_sizer1->Add(instruction, 0, wxALIGN_LEFT | wxALL | wxALIGN_CENTER_VERTICAL, 5);
+
+ wxFlexGridSizer* formItems = new wxFlexGridSizer(4,2,9,15);
+
+ wxStaticText *stxtPrjLoc = new wxStaticText(this, -1, wxT("Project Location"));
+ wxStaticText *stxtPrjName = new wxStaticText(this, -1, wxT("Project Name"));
+ wxStaticText *stxtPrjAuth = new wxStaticText(this, -1, wxT("Default Package's Author (1 word)"));
+ wxStaticText *stxtPrjPkg = new wxStaticText(this, -1, wxT("Default Package's Description (HTML)"));
+
+ wxBoxSizer* h_sizer1 = new wxBoxSizer(wxHORIZONTAL);
+ wxButton *ddPrjLocBtn = new wxButton(this, ID_BUTTON_CHOOSE, wxString("Choose directory..."));
+ this->projectLocation = new wxStaticText(this, -1, wxString(""));
+ h_sizer1->Add(ddPrjLocBtn,0,wxALIGN_LEFT | wxLEFT | wxALIGN_CENTER_VERTICAL, 5);
+ h_sizer1->Add(this->projectLocation,0,wxALIGN_LEFT | wxLEFT | wxALIGN_CENTER_VERTICAL, 5);
+ h_sizer1->SetMinSize(wxSize(150, 20));
+
+ this->projectName = new wxTextCtrl(this, -1);
+ this->packageAuthor = new wxTextCtrl(this, -1);
+ this->packageDescription = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
+
+ formItems->Add(stxtPrjLoc, 0, wxALIGN_CENTER_VERTICAL);
+ formItems->Add(h_sizer1, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL);
+ formItems->Add(stxtPrjName, 0, wxALIGN_CENTER_VERTICAL);
+ formItems->Add(this->projectName, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL);
+ formItems->Add(stxtPrjAuth, 0, wxALIGN_CENTER_VERTICAL);
+ formItems->Add(this->packageAuthor, 1, wxEXPAND | wxALIGN_CENTER_VERTICAL);
+ formItems->Add(stxtPrjPkg);
+ formItems->Add(this->packageDescription, 1, wxEXPAND);
+
+ formItems->AddGrowableCol(1,1);
+ formItems->AddGrowableRow(3,1);
+
+ v_sizer1->Add(formItems, 1, wxEXPAND | wxALL, 15);
+
+ wxBoxSizer* h_sizer2 = new wxBoxSizer(wxHORIZONTAL);
+ h_sizer2->Add(new wxButton(this, ID_BUTTON_NEXT, wxString("Create Project")), 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
+ h_sizer2->Add(new wxButton(this, ID_BUTTON_CANCEL, wxString("Cancel")), 0, wxALL | wxALIGN_CENTER_VERTICAL, 5);
+
+ v_sizer1->Add(h_sizer2, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, 30);
+
+ SetSizer(v_sizer1);
+ v_sizer1->SetSizeHints(this);
+}
+
+void wxCreaDevManagerNewProjectDialog::OnCreateProject(wxCommandEvent& event)
+{
+ bool ready = true;
+
+ if(ready && this->projectName->GetValue() == wxString(""))
+ {
+ wxMessageBox(wxString("The project name cannot be empty"),_T("Error"),wxOK | wxICON_ERROR);
+ ready = false;
+ }
+ if(ready && this->projectLocation->GetLabel() == wxString(""))
+ {
+ wxMessageBox(wxString("The project location cannot be empty"),_T("Error"),wxOK | wxICON_ERROR);
+ ready = false;
+ }
+ if(ready && this->packageAuthor->GetValue() == wxString(""))
+ {
+ wxMessageBox(wxString("The project's author cannot be empty"),_T("Error"),wxOK | wxICON_ERROR);
+ ready = false;
+ }
+
+ std::cout << ready << std::endl;
+
+ if(ready && ControlCreaDevManagerProject::CreateProject(crea::wx2std(this->projectName->GetValue()), crea::wx2std(this->projectLocation->GetLabel()), crea::wx2std(this->packageAuthor->GetValue()), crea::wx2std(this->packageDescription->GetValue())))
+ {
+ this->Controller->OpenProject(crea::wx2std(this->projectLocation->GetLabel()) + "/" + crea::wx2std(this->projectName->GetValue()));
+
+ this->DestroyChildren();
+
+ wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
+
+ wxStaticText* title = new wxStaticText(this, wxID_ANY, wxString("Your project is ready!"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);//new wxRichTextCtrl(this,wxID_ANY, wxString("Create a new project"), wxDefaultPosition, wxDefaultSize, wxRE_READONLY);
+ v_sizer1->Add(title, 0, wxALL, 5);
+
+ wxStaticText* instruction = new wxStaticText(this, wxID_ANY, wxString("Please close this dialog to continue to the project."), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+ v_sizer1->Add(instruction, 0, wxALL, 5);
+
+ v_sizer1->Add(new wxButton(this, ID_BUTTON_CANCEL, wxString("Close")), 0, wxALL, 5);
+
+ SetSizer(v_sizer1);
+ v_sizer1->SetSizeHints(this);
+ }else{
+ if(ready)
+ this->Close();
+ }
+
+
+ event.Skip();
+}
+
+void wxCreaDevManagerNewProjectDialog::OnCancel(wxCommandEvent& event)
+{
+ this->Close();
+ event.Skip();
+}
+
+void wxCreaDevManagerNewProjectDialog::OnChooseLocation(wxCommandEvent& event)
+{
+ wxDirDialog* dialog = new wxDirDialog(this, "Choose the location of the new project");
+ dialog->ShowModal();
+ this->projectLocation->SetLabel(dialog->GetPath());
+ this->Update();
+ event.Skip();
+}
--- /dev/null
+/*
+ * wxCreaDevManagerNewProjectDialog.h
+ *
+ * Created on: 2/11/2012
+ * Author: daniel
+ */
+
+#ifndef WXCREADEVMANAGERNEWPROJECTDIALOG_H_
+#define WXCREADEVMANAGERNEWPROJECTDIALOG_H_
+
+#include <creaWx.h>
+#include <wx/dialog.h>
+#include "ControlCreaDevManagerMain.h"
+
+class wxCreaDevManagerNewProjectDialog : public wxDialog
+{
+ DECLARE_EVENT_TABLE()
+ public:
+ wxCreaDevManagerNewProjectDialog(
+ wxWindow* parent,
+ ControlCreaDevManagerMain* controller,
+ wxWindowID id = wxID_ANY,
+ const wxString& caption = wxString("New Project"),
+ const wxPoint& position = wxDefaultPosition,
+ const wxSize& size = wxSize(400,300),
+ long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER
+ );
+ ~wxCreaDevManagerNewProjectDialog();
+ bool Create(
+ wxWindow* parent,
+ wxWindowID id = wxID_ANY,
+ const wxString& caption = wxString("New Project"),
+ const wxPoint& position = wxDefaultPosition,
+ const wxSize& size = wxSize(400,300),
+ long style = wxDEFAULT_DIALOG_STYLE
+ );
+
+ protected:
+ void CreateControls();
+
+ void OnCreateProject(wxCommandEvent& event);
+ void OnCancel(wxCommandEvent& event);
+ void OnChooseLocation(wxCommandEvent& event);
+
+ private:
+ wxStaticText* projectLocation;
+ wxTextCtrl* projectName;
+ wxTextCtrl* packageAuthor;
+ wxTextCtrl* packageDescription;
+
+ ControlCreaDevManagerMain* Controller;
+
+
+};
+
+#endif /* WXCREADEVMANAGERNEWPROJECTDIALOG_H_ */
return TRUE;
}
-void wxCreaDevManagerTreeCtrl::BuildTree(ModelCreaDevManagerTree& projectsTree)
+void wxCreaDevManagerTreeCtrl::BuildTree(const ModelCreaDevManagerTree& projectsTree)
{
this->DeleteAllItems();
wxTreeItemId rootIndex = this-> AddRoot(_("Open Projects"));
this->Update();
}
-void wxCreaDevManagerTreeCtrl::BuildTree(std::vector<ModelCreaDevManagerTreeNode>& projectsTree, wxTreeItemId parent)
+void wxCreaDevManagerTreeCtrl::BuildTree(const std::vector<ModelCreaDevManagerTreeNode>& projectsTree, wxTreeItemId parent)
{
for (int i = 0; i < projectsTree.size(); i++)
{
const wxString &name=_("Projects tree")
);
- void BuildTree(ModelCreaDevManagerTree& tree);
+ void BuildTree(const ModelCreaDevManagerTree& tree);
private:
- void BuildTree(std::vector<ModelCreaDevManagerTreeNode>& tree, wxTreeItemId parent);
+ void BuildTree(const std::vector<ModelCreaDevManagerTreeNode>& tree, wxTreeItemId parent);
};
#endif /* WXCREADEVMANAGERTREECTRL_H_ */