#include <stdlib.h>
#include <iostream> // for std::cout
#include "creaDevManager.h"
-#include "wxCreaDevManagerMainFrame.h"
+#include "wxCDMMainFrame.h"
IMPLEMENT_APP(wxCreaDevManagerApp)
{
wxApp::OnInit();
- wxCreaDevManagerMainFrame* mainWindow = new wxCreaDevManagerMainFrame(NULL);
+ wxCDMMainFrame* mainWindow = new wxCDMMainFrame(NULL);
SetTopWindow(mainWindow);
mainWindow->SetSize(800, 600);
mainWindow->Show(true);
*/
#include "ControlCreaDevManagerMain.h"
-#include "ModelCreaDevManagerTree.h"
#include <cstdio>
#include <fstream>
{
}
-const ModelCreaDevManagerTree& ControlCreaDevManagerMain::GetActiveProjects() const
+const modelCDMProjectsTree& ControlCreaDevManagerMain::GetActiveProjects() const
{
return projectsTree;
}
}
}
- projectsTree.addRoot(path);
+ projectsTree.SetRoot(path);
projectsTree.populateNode(path);
return 0;
}
#define CONTROLCREADEVMANAGERMAIN_H_
#include <iostream>
-#include "ModelCreaDevManagerTree.h"
+#include "modelCDMProjectsTree.h"
class ControlCreaDevManagerMain
{
ControlCreaDevManagerMain();
~ControlCreaDevManagerMain();
- const ModelCreaDevManagerTree& GetActiveProjects() const;
+ const modelCDMProjectsTree& GetActiveProjects() const;
bool LoadActiveProjects();
bool UpdateActiveProjects();
const int OpenProject(const std::string& path);
bool CloseProject(const std::string& projectName);
private:
- ModelCreaDevManagerTree projectsTree;
+ modelCDMProjectsTree projectsTree;
};
+++ /dev/null
-/*
- * ModelCreaDevManagerTree.h
- *
- * Created on: 22/10/2012
- * Author: daniel
- */
-
-#ifndef MODELCREADEVMANAGERTREE_H_
-#define MODELCREADEVMANAGERTREE_H_
-
-#include <vector>
-#include <iostream>
-#include "ModelCreaDevManagerTreeNode.h"
-
-class ModelCreaDevManagerTree
-{
- public:
- ModelCreaDevManagerTree();
- ~ModelCreaDevManagerTree();
-
-
- static bool CompareNodeItem(ModelCreaDevManagerTreeNode x, ModelCreaDevManagerTreeNode y);
-
- void addRoot(std::string path);
- void populateNode(std::string path);
-
- std::vector<ModelCreaDevManagerTreeNode> projectRoots;
- private:
- void populateNode(ModelCreaDevManagerTreeNode& node);
-};
-
-#endif /* MODELCREADEVMANAGERTREE_H_ */
+++ /dev/null
-/*
- * ModelCreaDevManagerTreeNode.cpp
- *
- * Created on: 22/10/2012
- * Author: daniel
- */
-
-#include "ModelCreaDevManagerTreeNode.h"
-
-ModelCreaDevManagerTreeNode::ModelCreaDevManagerTreeNode(std::string path, std::string name, unsigned char type, int level)
-{
- this->_path = path;
- this->_name = name;
- this->_type = type;
- this->_level = level;
-}
-
-ModelCreaDevManagerTreeNode::~ModelCreaDevManagerTreeNode()
-{
-}
-
-const std::string& ModelCreaDevManagerTreeNode::GetPath() const
-{
- return this->_path;
-}
-
-const std::string& ModelCreaDevManagerTreeNode::GetName() const
-{
- return this->_name;
-}
-const unsigned char& ModelCreaDevManagerTreeNode::GetType() const
-{
- return this->_type;
-}
-
-const int& ModelCreaDevManagerTreeNode::GetLevel() const
-{
- return this->_level;
-}
-
-const std::vector<ModelCreaDevManagerTreeNode>& ModelCreaDevManagerTreeNode::GetChildren() const
-{
- return this->_children;
-}
-
-
-void ModelCreaDevManagerTreeNode::SetChildren(std::vector<ModelCreaDevManagerTreeNode>& children)
-{
- this->_children.clear();
- this->_children = children;
-}
+++ /dev/null
-/*
- * ModelCreaDevManagerTreeNode.h
- *
- * Created on: 22/10/2012
- * Author: daniel
- */
-
-#ifndef MODELCREADEVMANAGERTREENODE_H_
-#define MODELCREADEVMANAGERTREENODE_H_
-
-#include <vector>
-#include <iostream>
-
-
-
-class ModelCreaDevManagerTreeNode
-{
- public:
- ModelCreaDevManagerTreeNode(std::string path, std::string name, unsigned char type, int level);
- ~ModelCreaDevManagerTreeNode();
-
- 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);
-
-
- private:
- std::string _path;
- std::string _name;
- unsigned char _type;
- int _level;
- std::vector<ModelCreaDevManagerTreeNode> _children;
-
-};
-
-#endif /* MODELCREADEVMANAGERTREENODE_H_ */
--- /dev/null
+/*
+ * controlCDMMain.cpp
+ *
+ * Created on: 13/11/2012
+ * Author: daniel
+ */
+
+#include "controlCDMMain.h"
+#include <iostream>
+
+controlCDMMain::controlCDMMain()
+{
+ this->main = NULL;
+}
+
+controlCDMMain::~controlCDMMain()
+{
+
+}
+
+const modelCDMProject& controlCDMMain::GetActiveProject()
+{
+ if(!main)
+ this->main = new modelCDMProject();
+ return *main;
+}
+
+bool controlCDMMain::UpdateActiveProject()
+{
+ return true;
+}
+
+const int controlCDMMain::OpenProject(const std::string& path)
+{
+ return 1;
+}
+
+bool controlCDMMain::CloseProject(const std::string& projectName)
+{
+ return true;
+}
+
--- /dev/null
+/*
+ * controlCDMMain.h
+ *
+ * Created on: 13/11/2012
+ * Author: daniel
+ */
+
+#ifndef CONTROLCDMMAIN_H_
+#define CONTROLCDMMAIN_H_
+
+#include "modelCDMProject.h"
+
+class controlCDMMain
+{
+public:
+ controlCDMMain();
+ ~controlCDMMain();
+ const modelCDMProject& GetActiveProject();
+ bool UpdateActiveProject();
+ const int OpenProject(const std::string& path);
+ bool CloseProject(const std::string& projectName);
+private:
+ modelCDMProject* main;
+};
+
+#endif /* CONTROLCDMMAIN_H_ */
--- /dev/null
+/*
+ * modelCDMIProjectTreeNode.h
+ *
+ * Created on: 13/11/2012
+ * Author: daniel
+ */
+
+#ifndef MODELCDMIPROJECTTREENODE_H_
+#define MODELCDMIPROJECTTREENODE_H_
+
+#include <iostream>
+#include <vector>
+
+class modelCDMIProjectTreeNode
+{
+public:
+ virtual ~modelCDMIProjectTreeNode(){}
+
+ const std::string& GetPath() const
+ {
+ return this->path;
+ }
+ const std::string& GetName() const
+ {
+ return this->name;
+ }
+ const unsigned char& GetType() const
+ {
+ return this->type;
+ }
+ const int& GetLevel() const
+ {
+ return this->level;
+ }
+ const std::vector<modelCDMIProjectTreeNode>& GetChildren() const
+ {
+ return this->children;
+ }
+ void SetChildren(std::vector<modelCDMIProjectTreeNode>& children)
+ {
+ this->children.clear();
+ this->children = children;
+ }
+protected:
+ std::string path;
+ std::string name;
+ unsigned char type;
+ int level;
+ std::vector<modelCDMIProjectTreeNode> children;
+};
+
+
+#endif /* MODELCDMIPROJECTTREENODE_H_ */
--- /dev/null
+/*
+ * modelCDMMain.cpp
+ *
+ * Created on: 13/11/2012
+ * Author: daniel
+ */
+
+#include "modelCDMMain.h"
+
+#include <iostream>
+
+modelCDMMain::modelCDMMain()
+{
+ this->project = NULL;
+}
+modelCDMMain::~modelCDMMain()
+{
+ if (this->project != NULL)
+ delete this->project;
+}
+
+modelCDMProject* modelCDMMain::GetProject()
+{
+ return this->project;
+}
+void modelCDMMain::SetProject(modelCDMProject* project)
+{
+ if(this->project != NULL && this->project != project)
+ delete this->project;
+ this->project = project;
+}
+
--- /dev/null
+/*
+ * modelCDMMain.h
+ *
+ * Created on: 13/11/2012
+ * Author: daniel
+ */
+
+#ifndef MODELCDMMAIN_H_
+#define MODELCDMMAIN_H_
+
+#include "modelCDMProject.h"
+
+class modelCDMMain
+{
+public:
+ modelCDMMain();
+ ~modelCDMMain();
+
+ modelCDMProject* GetProject();
+ void SetProject(modelCDMProject* project);
+
+private:
+ modelCDMProject* project;
+};
+
+
+#endif /* MODELCDMMAIN_H_ */
--- /dev/null
+/*
+ * modelCDMProject.cpp
+ *
+ * Created on: 13/11/2012
+ * Author: daniel
+ */
+
+#include "modelCDMProject.h"
+
+modelCDMProject::modelCDMProject(std::string name, std::string path, unsigned char type, int level)
+{
+ this->name = name;
+ this->path = path;
+ this->type = type;
+ this->level = level;
+}
+
--- /dev/null
+/*
+ * modelCDMProject.h
+ *
+ * Created on: 13/11/2012
+ * Author: daniel
+ */
+
+#ifndef MODELCDMPROJECT_H_
+#define MODELCDMPROJECT_H_
+
+#include "modelCDMIProjectTreeNode.h"
+
+class modelCDMProject : public modelCDMIProjectTreeNode
+{
+public:
+ modelCDMProject();
+ modelCDMProject(std::string name, std::string path, unsigned char type, int level);
+ ~modelCDMProject(){}
+
+};
+
+#endif /* MODELCDMPROJECT_H_ */
* Author: daniel
*/
-#include "ModelCreaDevManagerTree.h"
+#include "modelCDMProjectsTree.h"
-#include <iostream>
-#include <sstream>
-#include <algorithm>
-#include <string>
-#include <cstring>
#include <creaWx.h>
#include <wx/dir.h>
+#include <sstream>
+#include <algorithm>
-ModelCreaDevManagerTree::ModelCreaDevManagerTree()
+modelCDMProjectsTree::modelCDMProjectsTree()
{
}
-ModelCreaDevManagerTree::~ModelCreaDevManagerTree()
+modelCDMProjectsTree::~modelCDMProjectsTree()
{
}
-bool ModelCreaDevManagerTree::CompareNodeItem(ModelCreaDevManagerTreeNode x, ModelCreaDevManagerTreeNode y)
+bool modelCDMProjectsTree::CompareNodeItem(modelCDMProjectsTreeNode x, modelCDMProjectsTreeNode y)
{
bool returnValue;
bool noWinner = true;
return returnValue;
}
-void ModelCreaDevManagerTree::addRoot(std::string path)
+void modelCDMProjectsTree::SetRoot(std::string path)
{
std::stringstream p(path);
std::vector<std::string> breadcrumbs;
name = breadcrumbs[breadcrumbs.size()-1];
bool projectFound = false;
- for (int i = 0; i < this->projectRoots.size(); i++)
- {
- if(this->projectRoots[i].GetName() == name)
- projectFound = true;
- }
+ if(projectRoot.GetName() == name)
+ projectFound = true;
if(!projectFound)
{
- this->projectRoots.push_back(ModelCreaDevManagerTreeNode(path,name,DT_DIR,0));
+ this->projectRoot = modelCDMProjectsTreeNode(path,name,DT_DIR,0);
}else{
std::cout << "already existing ";
}
- std::cout << "project root added: " << name << " in " << path << std::endl;
+ std::cout << "project root set: " << name << " in " << path << std::endl;
}
-void ModelCreaDevManagerTree::populateNode(ModelCreaDevManagerTreeNode& node)
+void modelCDMProjectsTree::populateNode(modelCDMProjectsTreeNode& node)
{
//std::cout << "populating " << node.GetName() << " path " << node.GetPath() << "..." << std::endl;
- std::vector <ModelCreaDevManagerTreeNode>* nodes = new std::vector <ModelCreaDevManagerTreeNode>;
+ std::vector <modelCDMProjectsTreeNode>* nodes = new std::vector <modelCDMProjectsTreeNode>;
std::string path = node.GetPath()+node.GetName()+"/";
bool cont = dir.GetFirst(&fileName, wxEmptyString, wxDIR_DIRS);
while (cont)
{
- ModelCreaDevManagerTreeNode innerNode = ModelCreaDevManagerTreeNode(path, crea::wx2std(fileName), wxDIR_DIRS, node.GetLevel()+1);
+ modelCDMProjectsTreeNode innerNode = modelCDMProjectsTreeNode(path, crea::wx2std(fileName), wxDIR_DIRS, node.GetLevel()+1);
this->populateNode(innerNode);
nodes->push_back(innerNode);
cont = dir.GetNext(&fileName);
cont = dir.GetFirst(&fileName, wxEmptyString, wxDIR_FILES);
while (cont)
{
- ModelCreaDevManagerTreeNode innerNode = ModelCreaDevManagerTreeNode(path, crea::wx2std(fileName), wxDIR_FILES, node.GetLevel()+1);
+ modelCDMProjectsTreeNode innerNode = modelCDMProjectsTreeNode(path, crea::wx2std(fileName), wxDIR_FILES, node.GetLevel()+1);
nodes->push_back(innerNode);
cont = dir.GetNext(&fileName);
}
}*/
}
-void ModelCreaDevManagerTree::populateNode(std::string path)
+void modelCDMProjectsTree::populateNode(std::string path)
{
if(path[path.size()-1] != '/')
path+="/";
std::cout << "searching " << path << std::endl;
- for (int i = 0; i < this->projectRoots.size(); i++)
+ if(this->projectRoot.GetPath()+this->projectRoot.GetName()+"/" == path)
{
- //std::cout << (this->projectRoots[i].GetPath() + this->projectRoots[i].GetName() + "/") << "..." << std::endl;
- if(this->projectRoots[i].GetPath()+this->projectRoots[i].GetName()+"/" == path)
- {
- std::cout << "Populating Project: " << path << "..." << std::endl;
- this->populateNode(this->projectRoots[i]);
- break;
- }
+ std::cout << "Populating Project: " << path << "..." << std::endl;
+ this->populateNode(this->projectRoot);
}
}
--- /dev/null
+/*
+ * modelCDMProjectsTree.h
+ *
+ * Created on: 22/10/2012
+ * Author: daniel
+ */
+
+#ifndef MODELCDMPROJECTSTREE_H_
+#define MODELCDMPROJECTSTREE_H_
+
+#include <iostream>
+#include "modelCDMProjectsTreeNode.h"
+
+class modelCDMProjectsTree
+{
+ public:
+ modelCDMProjectsTree();
+ ~modelCDMProjectsTree();
+
+
+ static bool CompareNodeItem(modelCDMProjectsTreeNode x, modelCDMProjectsTreeNode y);
+
+ void SetRoot(std::string path);
+ void populateNode(std::string path);
+
+ modelCDMProjectsTreeNode projectRoot;
+ protected:
+ void populateNode(modelCDMProjectsTreeNode& node);
+};
+
+#endif /* MODELCDMPROJECTSTREE_H_ */
--- /dev/null
+/*
+ * ModelCreaDevManagerTreeNode.cpp
+ *
+ * Created on: 22/10/2012
+ * Author: daniel
+ */
+
+#include "modelCDMProjectsTreeNode.h"
+
+modelCDMProjectsTreeNode::modelCDMProjectsTreeNode(std::string path, std::string name, unsigned char type, int level)
+{
+ this->_path = path;
+ this->_name = name;
+ this->_type = type;
+ this->_level = level;
+}
+
+modelCDMProjectsTreeNode::~modelCDMProjectsTreeNode()
+{
+}
+
+const std::string& modelCDMProjectsTreeNode::GetPath() const
+{
+ return this->_path;
+}
+
+const std::string& modelCDMProjectsTreeNode::GetName() const
+{
+ return this->_name;
+}
+const unsigned char& modelCDMProjectsTreeNode::GetType() const
+{
+ return this->_type;
+}
+
+const int& modelCDMProjectsTreeNode::GetLevel() const
+{
+ return this->_level;
+}
+
+const std::vector<modelCDMProjectsTreeNode>& modelCDMProjectsTreeNode::GetChildren() const
+{
+ return this->_children;
+}
+
+
+void modelCDMProjectsTreeNode::SetChildren(std::vector<modelCDMProjectsTreeNode>& children)
+{
+ this->_children.clear();
+ this->_children = children;
+}
--- /dev/null
+/*
+ * modelCDMProjectsTreeNode.h
+ *
+ * Created on: 22/10/2012
+ * Author: daniel
+ */
+
+#ifndef MODELCDMPROJECTSTREENODE_H_
+#define MODELCDMPROJECTSTREENODE_H_
+
+#include <iostream>
+#include <vector>
+
+class modelCDMProjectsTreeNode
+{
+public:
+ modelCDMProjectsTreeNode();
+ modelCDMProjectsTreeNode(std::string path, std::string name, unsigned char type, int level);
+ ~modelCDMProjectsTreeNode();
+
+ const std::string& GetPath() const;
+ const std::string& GetName() const;
+ const unsigned char& GetType() const;
+ const int& GetLevel() const;
+ const std::vector<modelCDMProjectsTreeNode>& GetChildren() const;
+
+ void SetChildren(std::vector<modelCDMProjectsTreeNode>& children);
+
+
+private:
+ std::string _path;
+ std::string _name;
+ unsigned char _type;
+ int _level;
+ std::vector<modelCDMProjectsTreeNode> _children;
+
+};
+
+#endif /* MODELCDMPROJECTSTREENODE_H_ */
--- /dev/null
+/*
+ * wxCDMMainPanel.cpp
+ *
+ * Created on: 13/11/2012
+ * Author: daniel
+ */
+
+#include "wxCDMMainDescriptionPanel.h"
+#include "creaDevManagerIds.h"
+#include "images/Cicon64.xpm"
+
+
+wxCDMMainDescriptionPanel::wxCDMMainDescriptionPanel(
+ wxWindow* parent,
+ wxWindowID id,
+ const wxString& caption,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style
+)
+{
+ wxCDMMainDescriptionPanel::Create(parent, id, caption, pos, size, style);
+}
+
+wxCDMMainDescriptionPanel::~wxCDMMainDescriptionPanel()
+{
+}
+
+bool wxCDMMainDescriptionPanel::Create(
+ wxWindow* parent,
+ wxWindowID id,
+ const wxString& caption,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style
+)
+{
+ wxPanel::Create(parent, id, pos, size, style);
+ CreateControls();
+ return TRUE;
+}
+
+void wxCDMMainDescriptionPanel::CreateControls()
+{
+ wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
+
+ //Welcome
+ sizer->Add(new wxStaticText(this, -1, _("Welcome")),0, wxALIGN_CENTER, 0);
+
+ //Image
+ sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(Cicon)),0, wxALIGN_CENTER, 0);
+
+ //Crea Development Manager
+ sizer->Add(new wxStaticText(this, -1, _("Crea Development Manager")),0, wxALIGN_CENTER, 0);
+
+ //Actions
+ wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions"));
+ wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL);
+ sizer -> Add(actionsBoxInnerSizer, 2, wxEXPAND | wxALL, 20);
+
+ actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_NEWPROJECT, _T("New Project")), 0, wxRIGHT | wxLEFT, 20);
+ actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_OPENPROJECT, _T("Open Project")), 0, wxRIGHT | wxLEFT, 20);
+
+ //Asign sizer
+ sizer->SetSizeHints(this);
+ SetSizer(sizer);
+}
+
+void wxCDMMainDescriptionPanel::OnBtnNewProject(wxCommandEvent& event)
+{
+ event.ResumePropagation(1);
+ event.Skip();
+}
+
+void wxCDMMainDescriptionPanel::OnBtnOpenProject(wxCommandEvent& event)
+{
+ event.ResumePropagation(1);
+ event.Skip();
+}
+
--- /dev/null
+/*
+ * wxCDMMainDescriptionPanel.h
+ *
+ * Created on: 13/11/2012
+ * Author: daniel
+ */
+
+#ifndef WXCDMMAINDESCRIPTIONPANEL_H_
+#define WXCDMMAINDESCRIPTIONPANEL_H_
+
+#include <creaWx.h>
+#include <wx/panel.h>
+
+class wxCDMMainDescriptionPanel : public wxPanel
+{
+public:
+ wxCDMMainDescriptionPanel(
+ wxWindow* parent,
+ wxWindowID id = -1,
+ const wxString& caption = _("Description Frame"),
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE
+ );
+
+ ~wxCDMMainDescriptionPanel();
+
+ bool Create(
+ wxWindow* parent,
+ wxWindowID id = -1,
+ const wxString& caption = _("Description Frame"),
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE
+ );
+
+ void CreateControls();
+
+//handlers
+protected:
+ void OnBtnNewProject(wxCommandEvent& event);
+ void OnBtnOpenProject(wxCommandEvent& event);
+};
+
+#endif /* WXCDMMAINDESCRIPTIONPANEL_H_ */
-#include "wxCreaDevManagerMainFrame.h"
-#include "creaDevManagerIds.h"
-#include "wxCreaDevManagerTreeCtrl.h"
+#include "wxCDMMainFrame.h"
-#include "wxCreaDevManagerDescriptionPanel.h"
-#include "wxCreaDevManagerProjectActionsPanel.h"
-#include "wxCreaDevManagerNewProjectDialog.h"
-#include "ControlCreaDevManagerMain.h"
+#include "creaDevManagerIds.h"
+#include "wxCDMMainDescriptionPanel.h"
+#include "wxCDMProjectActionsPanel.h"
+#include "wxCDMNewProjectDialog.h"
-#include <wx/dirdlg.h>
#include <iostream>
-#include <cstdio>
-#include <iterator>
-#include <fstream>
-#include <string>
-#include <algorithm>
-
-
-BEGIN_EVENT_TABLE(wxCreaDevManagerMainFrame, wxFrame)
- EVT_MENU(ID_MENU_NEW_PROJECT, wxCreaDevManagerMainFrame::OnMenuNewProject)
- EVT_MENU(ID_MENU_OPEN_PROJECT, wxCreaDevManagerMainFrame::OnMenuOpenProject)
- EVT_MENU(ID_MENU_OPEN_RECENT, wxCreaDevManagerMainFrame::OnMenuOpenRecent)
- EVT_MENU(ID_MENU_CLOSE_PROJECT, wxCreaDevManagerMainFrame::OnMenuCloseProject)
- EVT_MENU(ID_MENU_CLOSE_ALL_PROJECTS, wxCreaDevManagerMainFrame::OnMenuCloseAllProjects)
- EVT_MENU(ID_MENU_EXPORT_HIERARCHY, wxCreaDevManagerMainFrame::OnMenuExportHierarchy)
- EVT_MENU(ID_MENU_EXIT, wxCreaDevManagerMainFrame::OnMenuExit)
- EVT_MENU(ID_MENU_REFRESH_PROJECT, wxCreaDevManagerMainFrame::OnMenuRefreshProject)
- EVT_MENU(ID_MENU_CUT, wxCreaDevManagerMainFrame::OnMenuMenuCut)
- EVT_MENU(ID_MENU_COPY, wxCreaDevManagerMainFrame::OnMenuMenuCopy)
- EVT_MENU(ID_MENU_PASTE, wxCreaDevManagerMainFrame::OnMenuMenuPaste)
- EVT_MENU(ID_MENU_DELETE, wxCreaDevManagerMainFrame::OnMenuMenuDelete)
- EVT_MENU(ID_MENU_SELECT_ALL, wxCreaDevManagerMainFrame::OnMenuSelectAll)
- EVT_MENU(ID_MENU_SELECT_NONE, wxCreaDevManagerMainFrame::OnMenuSelectNone)
- EVT_MENU(ID_MENU_EVENT_LOG, wxCreaDevManagerMainFrame::OnMenuEventLog)
- EVT_MENU(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxCreaDevManagerMainFrame::OnMenuBBTKGraphicalEditor)
- EVT_MENU(ID_MENU_MINITOOLS, wxCreaDevManagerMainFrame::OnMenuMiniTools)
- EVT_MENU(ID_MENU_CODE_EDITOR, wxCreaDevManagerMainFrame::OnMenuCodeEditor)
- EVT_MENU(ID_MENU_COMMAND_LINE, wxCreaDevManagerMainFrame::OnMenuCommandLine)
- EVT_MENU(ID_MENU_HELP, wxCreaDevManagerMainFrame::OnMenuHelp)
- EVT_MENU(ID_MENU_REPORT_BUG, wxCreaDevManagerMainFrame::OnMenuReportBug)
- EVT_MENU(ID_MENU_ABOUT_CREADEVMANAGER, wxCreaDevManagerMainFrame::OnMenuAboutCreaDevManager)
- EVT_MENU(ID_MENU_ABOUT_CREATIS, wxCreaDevManagerMainFrame::OnMenuAboutCreatis)
- EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCreaDevManagerMainFrame::OnMenuNewProject)
- EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCreaDevManagerMainFrame::OnMenuOpenProject)
+
+
+
+BEGIN_EVENT_TABLE(wxCDMMainFrame, wxFrame)
+ EVT_MENU(ID_MENU_NEW_PROJECT, wxCDMMainFrame::OnMenuNewProject)
+ EVT_MENU(ID_MENU_OPEN_PROJECT, wxCDMMainFrame::OnMenuOpenProject)
+ EVT_MENU(ID_MENU_OPEN_RECENT, wxCDMMainFrame::OnMenuOpenRecent)
+ EVT_MENU(ID_MENU_CLOSE_PROJECT, wxCDMMainFrame::OnMenuCloseProject)
+ EVT_MENU(ID_MENU_CLOSE_ALL_PROJECTS, wxCDMMainFrame::OnMenuCloseAllProjects)
+ EVT_MENU(ID_MENU_EXPORT_HIERARCHY, wxCDMMainFrame::OnMenuExportHierarchy)
+ EVT_MENU(ID_MENU_EXIT, wxCDMMainFrame::OnMenuExit)
+ EVT_MENU(ID_MENU_REFRESH_PROJECT, wxCDMMainFrame::OnMenuRefreshProject)
+ EVT_MENU(ID_MENU_CUT, wxCDMMainFrame::OnMenuMenuCut)
+ EVT_MENU(ID_MENU_COPY, wxCDMMainFrame::OnMenuMenuCopy)
+ EVT_MENU(ID_MENU_PASTE, wxCDMMainFrame::OnMenuMenuPaste)
+ EVT_MENU(ID_MENU_DELETE, wxCDMMainFrame::OnMenuMenuDelete)
+ EVT_MENU(ID_MENU_SELECT_ALL, wxCDMMainFrame::OnMenuSelectAll)
+ EVT_MENU(ID_MENU_SELECT_NONE, wxCDMMainFrame::OnMenuSelectNone)
+ EVT_MENU(ID_MENU_EVENT_LOG, wxCDMMainFrame::OnMenuEventLog)
+ EVT_MENU(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxCDMMainFrame::OnMenuBBTKGraphicalEditor)
+ EVT_MENU(ID_MENU_MINITOOLS, wxCDMMainFrame::OnMenuMiniTools)
+ EVT_MENU(ID_MENU_CODE_EDITOR, wxCDMMainFrame::OnMenuCodeEditor)
+ EVT_MENU(ID_MENU_COMMAND_LINE, wxCDMMainFrame::OnMenuCommandLine)
+ EVT_MENU(ID_MENU_HELP, wxCDMMainFrame::OnMenuHelp)
+ EVT_MENU(ID_MENU_REPORT_BUG, wxCDMMainFrame::OnMenuReportBug)
+ EVT_MENU(ID_MENU_ABOUT_CREADEVMANAGER, wxCDMMainFrame::OnMenuAboutCreaDevManager)
+ EVT_MENU(ID_MENU_ABOUT_CREATIS, wxCDMMainFrame::OnMenuAboutCreatis)
+ EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCDMMainFrame::OnMenuNewProject)
+ EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMMainFrame::OnMenuOpenProject)
END_EVENT_TABLE()
-wxCreaDevManagerMainFrame::wxCreaDevManagerMainFrame(
+wxCDMMainFrame::wxCDMMainFrame(
wxWindow* parent,
wxWindowID id,
const wxString& caption,
Create(parent, id, caption, pos, size, style);
}
-wxCreaDevManagerMainFrame::~wxCreaDevManagerMainFrame()
+wxCDMMainFrame::~wxCDMMainFrame()
{
auiManager.UnInit();
}
-void wxCreaDevManagerMainFrame::UpdateVisual()
-{
- auiManager.Update();
- this->Update();
-}
-
-bool wxCreaDevManagerMainFrame::Create(
+bool wxCDMMainFrame::Create(
wxWindow* parent,
wxWindowID id,
const wxString& caption,
)
{
wxFrame::Create(parent, id, caption, pos, size, style);
- this->controller = new ControlCreaDevManagerMain();
- this->controller->LoadActiveProjects();
+ this->model = new modelCDMMain();
CreateMenus();
CreateControls();
return TRUE;
}
-void wxCreaDevManagerMainFrame::CreateMenus()
+void wxCDMMainFrame::CreateMenus()
{
wxMenuBar* menuBar = new wxMenuBar;
}
-void wxCreaDevManagerMainFrame::CreateControls()
+void wxCDMMainFrame::CreateControls()
{
auiManager.SetManagedWindow(this);
- tree_Projects = new wxCreaDevManagerTreeCtrl(
+ tree_Projects = new wxCDMProjectsTreeCtrl(
this,
ID_TREE_PROJECTS,
wxDefaultPosition,
);
tree_Projects->SetMinSize(wxSize(200,200));
- panel_Properties = new wxCreaDevManagerDescriptionPanel(
+ panel_Properties = new wxCDMMainDescriptionPanel(
this,
ID_WINDOW_PROPERTIES,
wxString("Description Panel"),
- panel_ProjectActions = new wxCreaDevManagerProjectActionsPanel(
+ panel_ProjectActions = new wxCDMProjectActionsPanel(
this,
ID_WINDOW_PROJ_ACTIONS,
wxString("Project Actions Panel"),
//Event Handlers
//File menu
-void wxCreaDevManagerMainFrame::OnMenuNewProject(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event)
{
- wxCreaDevManagerNewProjectDialog* dialog = new wxCreaDevManagerNewProjectDialog(this, this->controller);
+ wxCDMNewProjectDialog* dialog = new wxCDMNewProjectDialog(this);
long userResponse;
userResponse = dialog->ShowModal();
- ((wxCreaDevManagerTreeCtrl*)tree_Projects)->BuildTree(this->controller->GetActiveProjects());
-
- this->UpdateVisual();
+ if(userResponse == wxID_FORWARD)
+ {
+ //TODO createProject
+ std::cerr << "should create Project here" << std::endl;
+ //tree_Projects->BuildTree(this->model->GetActiveProjects());
+ }
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuOpenProject(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event)
{
+ /*
long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
wxDirDialog* FD = new wxDirDialog(this, wxString("Select the project directory"), wxString(""), style);
long userResponse;
auiManager.Update();
}
+ */
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuOpenRecent(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuOpenRecent(wxCommandEvent& event)
{
std::cerr << "Event OnMenuOpenRecent not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuCloseProject(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event)
{
std::cerr << "Event OnMenuCloseProject not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuCloseAllProjects(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuCloseAllProjects(wxCommandEvent& event)
{
std::cerr << "Event OnMenuCloseAllProjects not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuExportHierarchy(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuExportHierarchy(wxCommandEvent& event)
{
std::cerr << "Event OnMenuExportHierarchy not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuExit(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuExit(wxCommandEvent& event)
{
std::cout << "Closing CreaDevManager..." << std::endl;
Close();
}
//Edit Menu
-void wxCreaDevManagerMainFrame::OnMenuRefreshProject(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuRefreshProject(wxCommandEvent& event)
{
std::cerr << "Event OnMenuRefreshProject not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuMenuCut(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuMenuCut(wxCommandEvent& event)
{
std::cerr << "Event OnMenuMenuCut not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuMenuCopy(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuMenuCopy(wxCommandEvent& event)
{
std::cerr << "Event OnMenuMenuCopy not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuMenuPaste(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuMenuPaste(wxCommandEvent& event)
{
std::cerr << "Event OnMenuMenuPaste not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuMenuDelete(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuMenuDelete(wxCommandEvent& event)
{
std::cerr << "Event OnMenuMenuDelete not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuSelectAll(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuSelectAll(wxCommandEvent& event)
{
std::cerr << "Event OnMenuSelectAll not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuSelectNone(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuSelectNone(wxCommandEvent& event)
{
std::cerr << "Event OnMenuSelectNone not implemented" << std::endl;
event.Skip();
}
//Tools Menu
-void wxCreaDevManagerMainFrame::OnMenuEventLog(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuEventLog(wxCommandEvent& event)
{
std::cerr << "Event OnMenuEventLog not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuBBTKGraphicalEditor(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuBBTKGraphicalEditor(wxCommandEvent& event)
{
std::cerr << "Event OnMenuBBTKGraphicalEditor not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuMiniTools(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuMiniTools(wxCommandEvent& event)
{
std::cerr << "Event OnMenuMiniTools not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuCodeEditor(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuCodeEditor(wxCommandEvent& event)
{
std::cerr << "Event OnMenuCodeEditor not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuCommandLine(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuCommandLine(wxCommandEvent& event)
{
std::cerr << "Event OnMenuCommandLine not implemented" << std::endl;
event.Skip();
}
//Help Menu
-void wxCreaDevManagerMainFrame::OnMenuHelp(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuHelp(wxCommandEvent& event)
{
std::cerr << "Event OnMenuHelp not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuReportBug(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuReportBug(wxCommandEvent& event)
{
std::cerr << "Event OnMenuReportBug not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuAboutCreaDevManager(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuAboutCreaDevManager(wxCommandEvent& event)
{
std::cerr << "Event OnMenuAboutCreaDevManager not implemented" << std::endl;
event.Skip();
}
-void wxCreaDevManagerMainFrame::OnMenuAboutCreatis(wxCommandEvent& event)
+void wxCDMMainFrame::OnMenuAboutCreatis(wxCommandEvent& event)
{
std::cerr << "Event OnMenuAboutCreatis not implemented" << std::endl;
event.Skip();
--- /dev/null
+#ifndef WXCDMMAINFRAME_H_INCLUDED
+#define WXCDMMAINFRAME_H_INCLUDED
+
+#include <creaWx.h>
+#include <wx/aui/aui.h>
+#include "wxCDMProjectsTreeCtrl.h"
+#include "modelCDMMain.h"
+
+class wxCDMMainFrame:public wxFrame
+{
+ DECLARE_EVENT_TABLE()
+
+public:
+ wxCDMMainFrame(
+ wxWindow* parent,
+ wxWindowID id = -1,
+ const wxString& caption = wxString("CREATIS CreaDevManager"),
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE
+ );
+
+ ~wxCDMMainFrame();
+
+ bool Create(
+ wxWindow* parent,
+ wxWindowID id = -1,
+ const wxString& caption = wxString("CREATIS CreaDevManager"),
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE
+ );
+
+protected:
+ void CreateMenus();
+ void CreateControls();
+
+private:
+
+ //Menus
+ wxMenu* menu_File;
+ wxMenu* menu_Edit;
+ wxMenu* menu_Tools;
+ wxMenu* menu_Help;
+
+ //Controls
+ wxAuiManager auiManager;
+ wxCDMProjectsTreeCtrl* tree_Projects;
+ wxPanel* panel_Properties;
+ wxPanel* panel_ProjectActions;
+
+ //Model
+ modelCDMMain* model;
+
+ //events
+protected:
+ //File
+ void OnMenuNewProject(wxCommandEvent& event);
+ void OnMenuOpenProject(wxCommandEvent& event);
+ void OnMenuOpenRecent(wxCommandEvent& event);
+ void OnMenuCloseProject(wxCommandEvent& event);
+ void OnMenuCloseAllProjects(wxCommandEvent& event);
+ void OnMenuExportHierarchy(wxCommandEvent& event);
+ void OnMenuExit(wxCommandEvent& event);
+
+ //Edit
+ void OnMenuRefreshProject(wxCommandEvent& event);
+ void OnMenuMenuCut(wxCommandEvent& event);
+ void OnMenuMenuCopy(wxCommandEvent& event);
+ void OnMenuMenuPaste(wxCommandEvent& event);
+ void OnMenuMenuDelete(wxCommandEvent& event);
+ void OnMenuSelectAll(wxCommandEvent& event);
+ void OnMenuSelectNone(wxCommandEvent& event);
+
+ //Tools
+ void OnMenuEventLog(wxCommandEvent& event);
+ void OnMenuBBTKGraphicalEditor(wxCommandEvent& event);
+ void OnMenuMiniTools(wxCommandEvent& event);
+ void OnMenuCodeEditor(wxCommandEvent& event);
+ void OnMenuCommandLine(wxCommandEvent& event);
+
+ //Help
+ void OnMenuHelp(wxCommandEvent& event);
+ void OnMenuReportBug(wxCommandEvent& event);
+ void OnMenuAboutCreaDevManager(wxCommandEvent& event);
+ void OnMenuAboutCreatis(wxCommandEvent& event);
+};
+
+#endif
/*
- * wxCreaDevManagerNewProjectDialog.cpp
+ * wxCDMNewProjectDialog.cpp
*
- * Created on: 2/11/2012
+ * Created on: 13/11/2012
* Author: daniel
*/
-#include "wxCreaDevManagerNewProjectDialog.h"
-
-#include "wx/richtext/richtextctrl.h"
+#include "wxCDMNewProjectDialog.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)
+BEGIN_EVENT_TABLE(wxCDMNewProjectDialog, wxDialog)
+ EVT_BUTTON(ID_BUTTON_NEXT, wxCDMNewProjectDialog::OnCreateProject)
+ EVT_BUTTON(ID_BUTTON_CANCEL, wxCDMNewProjectDialog::OnCancel)
+ EVT_BUTTON(ID_BUTTON_CHOOSE, wxCDMNewProjectDialog::OnChooseLocation)
END_EVENT_TABLE()
-wxCreaDevManagerNewProjectDialog::wxCreaDevManagerNewProjectDialog(
- wxWindow* parent,
- ControlCreaDevManagerMain* controller,
- wxWindowID id,
- const wxString& caption,
- const wxPoint& position,
- const wxSize& size,
- long style
+wxCDMNewProjectDialog::wxCDMNewProjectDialog(
+ wxWindow* parent,
+ wxWindowID id,
+ const wxString& caption,
+ const wxPoint& position,
+ const wxSize& size,
+ long style
)
{
- this->Controller = controller;
- wxCreaDevManagerNewProjectDialog::Create(parent, id, caption, position, size, style);
+ wxCDMNewProjectDialog::Create(parent, id, caption, position, size, style);
}
-wxCreaDevManagerNewProjectDialog::~wxCreaDevManagerNewProjectDialog()
+wxCDMNewProjectDialog::~wxCDMNewProjectDialog()
{
}
-bool wxCreaDevManagerNewProjectDialog::Create(
- wxWindow* parent,
- wxWindowID id,
- const wxString& caption,
- const wxPoint& position,
- const wxSize& size,
- long style
+bool wxCDMNewProjectDialog::Create(
+ wxWindow* parent,
+ wxWindowID id,
+ const wxString& caption,
+ const wxPoint& position,
+ const wxSize& size,
+ long int style
)
{
wxDialog::Create(parent, id, caption, position, size, style);
return TRUE;
}
-void wxCreaDevManagerNewProjectDialog::CreateControls()
+const wxString wxCDMNewProjectDialog::GetProjectLocation()
+{
+ return this->projectLocation->GetLabel();
+}
+const wxString wxCDMNewProjectDialog::GetProjectName()
+{
+ return this->projectName->GetValue();
+}
+const wxString wxCDMNewProjectDialog::GetPackageAuthor()
+{
+ return this->packageAuthor->GetValue();
+}
+const wxString wxCDMNewProjectDialog::GetPackageDescription()
+{
+ return this->packageDescription->GetValue();
+}
+
+void wxCDMNewProjectDialog::CreateControls()
{
wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
v_sizer1->SetSizeHints(this);
}
-void wxCreaDevManagerNewProjectDialog::OnCreateProject(wxCommandEvent& event)
+void wxCDMNewProjectDialog::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;
- }
+ {
+ 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;
- }
+ {
+ 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();
- }
+ {
+ wxMessageBox(wxString("The project's author cannot be empty"),_T("Error"),wxOK | wxICON_ERROR);
+ ready = false;
+ }
+ if(ready)
+ {
+ this->EndModal(wxID_FORWARD);
+ }
event.Skip();
}
-void wxCreaDevManagerNewProjectDialog::OnCancel(wxCommandEvent& event)
+void wxCDMNewProjectDialog::OnCancel(wxCommandEvent& event)
{
- this->Close();
+ this->EndModal(wxID_CANCEL);
event.Skip();
}
-void wxCreaDevManagerNewProjectDialog::OnChooseLocation(wxCommandEvent& event)
+void wxCDMNewProjectDialog::OnChooseLocation(wxCommandEvent& event)
{
wxDirDialog* dialog = new wxDirDialog(this, "Choose the location of the new project");
dialog->ShowModal();
this->Update();
event.Skip();
}
+
--- /dev/null
+/*
+ * wxCDMNewProjectDialog.h
+ *
+ * Created on: 13/11/2012
+ * Author: daniel
+ */
+
+#ifndef WXCDMNEWPROJECTDIALOG_H_
+#define WXCDMNEWPROJECTDIALOG_H_
+
+#include <creaWx.h>
+#include <wx/dialog.h>
+
+class wxCDMNewProjectDialog : public wxDialog
+{
+ DECLARE_EVENT_TABLE()
+public:
+ wxCDMNewProjectDialog(
+ 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 | wxRESIZE_BORDER
+ );
+ ~wxCDMNewProjectDialog();
+ 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
+ );
+
+ const wxString GetProjectLocation();
+ const wxString GetProjectName();
+ const wxString GetPackageAuthor();
+ const wxString GetPackageDescription();
+
+protected:
+ void CreateControls();
+
+private:
+ wxStaticText* projectLocation;
+ wxTextCtrl* projectName;
+ wxTextCtrl* packageAuthor;
+ wxTextCtrl* packageDescription;
+
+//handlers
+protected:
+ void OnCreateProject(wxCommandEvent& event);
+ void OnCancel(wxCommandEvent& event);
+ void OnChooseLocation(wxCommandEvent& event);
+};
+
+#endif /* WXCDMNEWPROJECTDIALOG_H_ */
/*
- * wxCreaDevManagerProjectActionsWindow.cpp
+ * wxCDMProjectActionsPanel.cpp
*
* Created on: 25/10/2012
* Author: daniel
*/
-#include "wxCreaDevManagerProjectActionsPanel.h"
+#include "wxCDMProjectActionsPanel.h"
-wxCreaDevManagerProjectActionsPanel::wxCreaDevManagerProjectActionsPanel(
+wxCDMProjectActionsPanel::wxCDMProjectActionsPanel(
wxWindow* parent,
wxWindowID id,
const wxString& caption,
long style
)
{
- wxCreaDevManagerProjectActionsPanel::Create(parent,id,caption,pos,size,style);
+ wxCDMProjectActionsPanel::Create(parent,id,caption,pos,size,style);
}
-wxCreaDevManagerProjectActionsPanel::~wxCreaDevManagerProjectActionsPanel()
+wxCDMProjectActionsPanel::~wxCDMProjectActionsPanel()
{
}
-bool wxCreaDevManagerProjectActionsPanel::Create(
+bool wxCDMProjectActionsPanel::Create(
wxWindow* parent,
wxWindowID id,
const wxString& caption,
return TRUE;
}
-void wxCreaDevManagerProjectActionsPanel::CreateControls()
+void wxCDMProjectActionsPanel::CreateControls()
{
this->GetSizer()->Add(new wxButton(this, -1, _T("Action 1")), 0, wxALL, 5);
this->GetSizer()->Add(new wxButton(this, -1, _T("Action 2")), 0, wxALL, 5);
/*
- * wxCreaDevManagerProjectActionsWindow.h
+ * wxCDMProjectActionsPanel.h
*
* Created on: 25/10/2012
* Author: daniel
*/
-#ifndef WXCREADEVMANAGERPROJECTACTIONSPANEL_H_
-#define WXCREADEVMANAGERPROJECTACTIONSPANEL_H_
+#ifndef WXCDMPROJECTACTIONSPANEL_H_
+#define WXCDMPROJECTACTIONSPANEL_H_
#include <creaWx.h>
#include <wx/panel.h>
-class wxCreaDevManagerProjectActionsPanel : public wxPanel
+class wxCDMProjectActionsPanel : public wxPanel
{
public:
- wxCreaDevManagerProjectActionsPanel(
+ wxCDMProjectActionsPanel(
wxWindow* parent,
wxWindowID id = -1,
const wxString& caption = _("Description Frame"),
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE
);
- ~wxCreaDevManagerProjectActionsPanel();
+ ~wxCDMProjectActionsPanel();
bool Create(
wxWindow* parent,
wxWindowID id = -1,
void CreateControls();
};
-#endif /* WXCREADEVMANAGERPROJECTACTIONSWINDOW_H_ */
+#endif /* WXCDMPROJECTACTIONSPANEL_H_ */
* Author: daniel
*/
-#include "wxCreaDevManagerTreeCtrl.h"
+#include "wxCDMProjectsTreeCtrl.h"
#include "creaDevManagerIds.h"
#include <vector>
-wxCreaDevManagerTreeCtrl::wxCreaDevManagerTreeCtrl(
+wxCDMProjectsTreeCtrl::wxCDMProjectsTreeCtrl(
wxWindow *parent,
wxWindowID id,
const wxPoint &pos,
const wxString &name
)
{
- Create(parent, id, pos, size, style, validator, name);
+ wxCDMProjectsTreeCtrl::Create(parent, id, pos, size, style, validator, name);
}
-wxCreaDevManagerTreeCtrl::~wxCreaDevManagerTreeCtrl()
+wxCDMProjectsTreeCtrl::~wxCDMProjectsTreeCtrl()
{
}
-bool wxCreaDevManagerTreeCtrl::Create(
+bool wxCDMProjectsTreeCtrl::Create(
wxWindow* parent,
wxWindowID id,
const wxPoint &pos,
return TRUE;
}
-void wxCreaDevManagerTreeCtrl::BuildTree(const ModelCreaDevManagerTree& projectsTree)
+void wxCDMProjectsTreeCtrl::BuildTree(const modelCDMProjectsTree& projectsTree)
{
this->DeleteAllItems();
wxTreeItemId rootIndex = this-> AddRoot(_("Open Projects"));
- for (int i = 0; i < projectsTree.projectRoots.size(); i++)
- {
- std::cout << "Building TreeCtrl for " << projectsTree.projectRoots[i].GetName() << std::endl;
- wxTreeItemId parentIndex = this-> AppendItem(rootIndex, wxString(projectsTree.projectRoots[i].GetName().c_str(), wxConvUTF8));
- this->BuildTree(projectsTree.projectRoots[i].GetChildren(), parentIndex);
- }
+ std::cout << "Building TreeCtrl for " << projectsTree.projectRoot.GetName() << std::endl;
+ wxTreeItemId parentIndex = this-> AppendItem(rootIndex, wxString(projectsTree.projectRoot.GetName().c_str(), wxConvUTF8));
+ this->BuildTree(projectsTree.projectRoot.GetChildren(), parentIndex);
+
this->Expand(rootIndex);
this->Update();
}
-void wxCreaDevManagerTreeCtrl::BuildTree(const std::vector<ModelCreaDevManagerTreeNode>& projectsTree, wxTreeItemId parent)
+void wxCDMProjectsTreeCtrl::BuildTree(const std::vector<modelCDMProjectsTreeNode>& projectsTree, wxTreeItemId parent)
{
for (int i = 0; i < projectsTree.size(); i++)
{
wxString nodeName((projectsTree[i].GetName()).c_str(), wxConvUTF8);
parentNodeIndex = this->AppendItem(parent, nodeName);
- std::vector<ModelCreaDevManagerTreeNode> innerChildren = projectsTree[i].GetChildren();
+ std::vector<modelCDMProjectsTreeNode> innerChildren = projectsTree[i].GetChildren();
if(innerChildren.size() > 0)
{
this->BuildTree(innerChildren, parentNodeIndex);
* Author: daniel
*/
-#ifndef WXCREADEVMANAGERTREECTRL_H_
-#define WXCREADEVMANAGERTREECTRL_H_
+#ifndef WXCDMPROJECTSTREECTRL_H_
+#define WXCDMPROJECTSTREECTRL_H_
#include <creaWx.h>
#include <wx/treectrl.h>
-#include "ModelCreaDevManagerTree.h"
-#include "ModelCreaDevManagerTreeNode.h"
-#include <vector>
+#include "modelCDMProjectsTree.h"
+#include <vector>
-class wxCreaDevManagerTreeCtrl: public wxTreeCtrl
+class wxCDMProjectsTreeCtrl: public wxTreeCtrl
{
public:
- wxCreaDevManagerTreeCtrl(
+ wxCDMProjectsTreeCtrl(
wxWindow *parent,
wxWindowID id=wxID_ANY,
const wxPoint &pos=wxDefaultPosition,
const wxValidator &validator=wxDefaultValidator,
const wxString &name=_("Projects tree")
);
- ~wxCreaDevManagerTreeCtrl();
+ ~wxCDMProjectsTreeCtrl();
bool Create(
wxWindow *parent,
wxWindowID id=wxID_ANY,
const wxString &name=_("Projects tree")
);
- void BuildTree(const ModelCreaDevManagerTree& tree);
+ void BuildTree(const modelCDMProjectsTree& tree);
private:
- void BuildTree(const std::vector<ModelCreaDevManagerTreeNode>& tree, wxTreeItemId parent);
+ void BuildTree(const std::vector<modelCDMProjectsTreeNode>& tree, wxTreeItemId parent);
};
-#endif /* WXCREADEVMANAGERTREECTRL_H_ */
+#endif /* WXCDMPROJECTSTREECTRL_H_ */
+++ /dev/null
-/*
- * wxCreaDevManagerDescriptionFrame.cpp
- *
- * Created on: 23/10/2012
- * Author: daniel
- */
-
-#include "wxCreaDevManagerDescriptionPanel.h"
-
-#include "images/Cicon64.xpm"
-
-#include "creaDevManagerIds.h"
-
-#include <wx/statbox.h>
-
-#include <iostream>
-
-BEGIN_EVENT_TABLE(wxCreaDevManagerDescriptionPanel, wxPanel)
- EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCreaDevManagerDescriptionPanel::OnBtnNewProject)
- EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCreaDevManagerDescriptionPanel::OnBtnOpenProject)
-END_EVENT_TABLE()
-
-wxCreaDevManagerDescriptionPanel::wxCreaDevManagerDescriptionPanel(
- wxWindow* parent,
- wxWindowID id,
- const wxString& caption,
- const wxPoint& pos,
- const wxSize& size,
- long style
-)
-{
- wxCreaDevManagerDescriptionPanel::Create(parent, id, caption, pos, size, style);
-}
-
-wxCreaDevManagerDescriptionPanel::~wxCreaDevManagerDescriptionPanel()
-{
-}
-
-bool wxCreaDevManagerDescriptionPanel::Create(
- wxWindow* parent,
- wxWindowID id,
- const wxString& caption,
- const wxPoint& pos,
- const wxSize& size,
- long style
-)
-{
- wxPanel::Create(parent, id, pos, size, style);
-
- CreateView();
-
- return TRUE;
-}
-
-void wxCreaDevManagerDescriptionPanel::CreateView(wxString title, wxString imagePath, wxString type, std::vector< std::pair< std::string, std::string > > properties)
-{
- wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
-
- //Title
- sizer->Add(new wxStaticText(this, -1, _("Welcome")),0, wxALIGN_CENTER, 0);
- //Image
- sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(Cicon)),0, wxALIGN_CENTER, 0);
- //Name
- sizer->Add(new wxStaticText(this, -1, _("Crea Development Manager")),0, wxALIGN_CENTER, 0);
-
- //Properties Box
- /*
- wxStaticBox* propsBox = new wxStaticBox(this, -1, _T("&Properties"));
-
- wxStaticBoxSizer* propsBoxInnerSizer = new wxStaticBoxSizer(propsBox, wxVERTICAL);
- sizer -> Add(propsBoxInnerSizer, 1, wxCENTER | wxEXPAND | wxALL, 5);
-
- wxString propsText = wxString(_T("Property 1: value 1\nProperty 2: long valuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuue 2"));
- wxStaticText* props = new wxStaticText(this, -1, propsText, wxDefaultPosition, wxSize(140,10));
- propsBoxInnerSizer->Add(props, 1, wxEXPAND | wxALL, 5);
- */
- //Actions Box
- wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions"));
-
- wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL);
- sizer -> Add(actionsBoxInnerSizer, 2, wxCENTER | wxEXPAND | wxALL, 10);
-
- actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_NEWPROJECT, _T("New Project")), 0, wxRIGHT | wxLEFT, 20);
- actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_OPENPROJECT, _T("Open Project")), 0, wxRIGHT | wxLEFT, 20);
-
-
-
- sizer->SetSizeHints(this);
-
-
- SetSizer(sizer);
-}
-
-void wxCreaDevManagerDescriptionPanel::OnBtnNewProject(wxCommandEvent& event)
-{
- event.ResumePropagation(1);
- event.Skip();
-}
-
-void wxCreaDevManagerDescriptionPanel::OnBtnOpenProject(wxCommandEvent& event)
-{
- event.ResumePropagation(1);
- event.Skip();
-}
+++ /dev/null
-/*
- * wxCreaDevManagerDescriptionFrame.h
- *
- * Created on: 23/10/2012
- * Author: daniel
- */
-
-#ifndef WXCREADEVMANAGERDESCRIPTIONPANEL_H_
-#define WXCREADEVMANAGERDESCRIPTIONPANEL_H_
-
-#include <creaWx.h>
-#include <wx/panel.h>
-#include <wx/bitmap.h>
-#include <wx/stattext.h>
-
-#include <iostream>
-#include <utility>
-#include <vector>
-
-class wxCreaDevManagerDescriptionPanel : public wxPanel
-{
-
- DECLARE_EVENT_TABLE()
-
- public:
- wxCreaDevManagerDescriptionPanel(
- wxWindow* parent,
- wxWindowID id = -1,
- const wxString& caption = _("Description Frame"),
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE
- );
-
- ~wxCreaDevManagerDescriptionPanel();
-
- bool Create(
- wxWindow* parent,
- wxWindowID id = -1,
- const wxString& caption = _("Description Frame"),
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE
- );
-
-
- protected:
- void CreateView(wxString title = wxString("Title"), wxString imagePath = wxString(""), wxString type = wxString("Type"), std::vector<std::pair<std::string, std::string> > properties = std::vector<std::pair<std::string, std::string> >());
-
- void OnBtnNewProject(wxCommandEvent& event);
- void OnBtnOpenProject(wxCommandEvent& event);
-
-
- private:
- wxStaticText* _title;
- wxBitmap* _image;
- wxStaticText* _type;
- wxStaticText* _properties;
-
-};
-
-#endif /* WXCREADEVMANAGERDESCRIPTIONFRAME_H_ */
+++ /dev/null
-#ifndef WXCREADEVMANAGERMAINFRAME_H_INCLUDED
-#define WXCREADEVMANAGERMAINFRAME_H_INCLUDED
-
-#include <creaWx.h>
-#include <wx/treectrl.h>
-#include <wx/aui/aui.h>
-
-#include "ModelCreaDevManagerTree.h"
-#include "ControlCreaDevManagerMain.h"
-
-class wxCreaDevManagerMainFrame:public wxFrame
-{
- DECLARE_EVENT_TABLE()
-
- public:
- wxCreaDevManagerMainFrame(
- wxWindow* parent,
- wxWindowID id = -1,
- const wxString& caption = wxString("CREATIS CreaDevManager"),
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE
- );
-
- ~wxCreaDevManagerMainFrame();
-
- bool Create(
- wxWindow* parent,
- wxWindowID id = -1,
- const wxString& caption = wxString("CREATIS CreaDevManager"),
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- long style = wxDEFAULT_FRAME_STYLE
- );
- void UpdateVisual();
-
- protected:
- void CreateMenus();
- void CreateControls();
-
- //events
- //File
- void OnMenuNewProject(wxCommandEvent& event);
- void OnMenuOpenProject(wxCommandEvent& event);
- void OnMenuOpenRecent(wxCommandEvent& event);
- void OnMenuCloseProject(wxCommandEvent& event);
- void OnMenuCloseAllProjects(wxCommandEvent& event);
- void OnMenuExportHierarchy(wxCommandEvent& event);
- void OnMenuExit(wxCommandEvent& event);
-
- //Edit
- void OnMenuRefreshProject(wxCommandEvent& event);
- void OnMenuMenuCut(wxCommandEvent& event);
- void OnMenuMenuCopy(wxCommandEvent& event);
- void OnMenuMenuPaste(wxCommandEvent& event);
- void OnMenuMenuDelete(wxCommandEvent& event);
- void OnMenuSelectAll(wxCommandEvent& event);
- void OnMenuSelectNone(wxCommandEvent& event);
-
- //Tools
- void OnMenuEventLog(wxCommandEvent& event);
- void OnMenuBBTKGraphicalEditor(wxCommandEvent& event);
- void OnMenuMiniTools(wxCommandEvent& event);
- void OnMenuCodeEditor(wxCommandEvent& event);
- void OnMenuCommandLine(wxCommandEvent& event);
-
- //Help
- void OnMenuHelp(wxCommandEvent& event);
- void OnMenuReportBug(wxCommandEvent& event);
- void OnMenuAboutCreaDevManager(wxCommandEvent& event);
- void OnMenuAboutCreatis(wxCommandEvent& event);
-
- private:
-
- //Menus
- wxMenu* menu_File;
- wxMenu* menu_Edit;
- wxMenu* menu_Tools;
- wxMenu* menu_Help;
-
- //Controls
- wxAuiManager auiManager;
- wxTreeCtrl* tree_Projects;
- wxPanel* panel_Properties;
- wxPanel* panel_ProjectActions;
-
- //Model
- ControlCreaDevManagerMain* controller;
-
-};
-
-#endif
+++ /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_ */