#include <string>
#include <cstring>
-using namespace std;
-
ModelCreaDevManagerTree::ModelCreaDevManagerTree()
{
}
bool returnValue;
bool noWinner = true;
unsigned int i = 0;
- string xName = x.GetName();
- string yName = y.GetName();
+ std::string xName = x.GetName();
+ std::string yName = y.GetName();
unsigned char xType = x.GetType();
unsigned char yType = y.GetType();
return returnValue;
}
-void ModelCreaDevManagerTree::addRoot(string path)
+void ModelCreaDevManagerTree::addRoot(std::string path)
{
- stringstream p(path);
- vector<string> breadcrumbs;
- string name;
+ std::stringstream p(path);
+ std::vector<std::string> breadcrumbs;
+ std::string name;
while(!p.eof())
{
name = breadcrumbs[breadcrumbs.size()-1];
this->projectRoots.push_back(ModelCreaDevManagerTreeNode(path,name,DT_DIR,0));
- cout << "project root added: " << name << " in " << path << endl;
+ std::cout << "project root added: " << name << " in " << path << std::endl;
}
void ModelCreaDevManagerTree::populateNode(ModelCreaDevManagerTreeNode& node)
{
- //cout << "populating " << node.GetName() << " path " << node.GetPath() << "..." << endl;
- vector <ModelCreaDevManagerTreeNode>* nodes = new vector <ModelCreaDevManagerTreeNode>;
+ //std::cout << "populating " << node.GetName() << " path " << node.GetPath() << "..." << std::endl;
+ std::vector <ModelCreaDevManagerTreeNode>* nodes = new std::vector <ModelCreaDevManagerTreeNode>;
DIR *dp;
struct dirent *ep;
- string path = node.GetPath()+node.GetName()+"/";
+ std::string path = node.GetPath()+node.GetName()+"/";
dp = opendir(path.c_str());
if (dp != NULL)
{
while ((ep = readdir (dp)) != NULL)
{
- //cout << ep->d_name << endl;
+ //std::cout << ep->d_name << std::endl;
if(strcmp(ep->d_name, ".") != 0 && strcmp(ep->d_name, "..") != 0 )
{
ModelCreaDevManagerTreeNode innerNode = ModelCreaDevManagerTreeNode(path, ep->d_name, ep->d_type, node.GetLevel()+1);
}
else
{
- cerr << "Couldn't open the directory" << endl;
+ std::cerr << "Couldn't open the directory" << std::endl;
}
}
-void ModelCreaDevManagerTree::populateNode(string path)
+void ModelCreaDevManagerTree::populateNode(std::string path)
{
if(path[path.size()-1] != '/')
path+="/";
- cout << "searching " << path << endl;
+ std::cout << "searching " << path << std::endl;
for (int i = 0; i < this->projectRoots.size(); i++)
{
- //cout << (this->projectRoots[i].GetPath() + this->projectRoots[i].GetName() + "/") << "..." << endl;
+ //std::cout << (this->projectRoots[i].GetPath() + this->projectRoots[i].GetName() + "/") << "..." << std::endl;
if(this->projectRoots[i].GetPath()+this->projectRoots[i].GetName()+"/" == path)
{
- cout << "Populating Project: " << path << "..." << endl;
+ std::cout << "Populating Project: " << path << "..." << std::endl;
this->populateNode(this->projectRoots[i]);
break;
}
#include <algorithm>
-using namespace std;
-
BEGIN_EVENT_TABLE(wxCreaDevManagerMainFrame, wxFrame)
EVT_MENU(ID_MENU_NEW_PROJECT, wxCreaDevManagerMainFrame::OnMenuNewProject)
EVT_MENU(ID_MENU_OPEN_PROJECT, wxCreaDevManagerMainFrame::OnMenuOpenProject)
//FileMenu
menu_File = new wxMenu();
- menu_File->Append(ID_MENU_NEW_PROJECT, _("&New Project..."));
- menu_File->Append(ID_MENU_OPEN_PROJECT, _("&Open Project..."));
- menu_File->Append(ID_MENU_OPEN_RECENT, _("Open &Recent"));
+ menu_File->Append(ID_MENU_NEW_PROJECT, wxString("&New Project..."));
+ menu_File->Append(ID_MENU_OPEN_PROJECT, wxString("&Open Project..."));
+ menu_File->Append(ID_MENU_OPEN_RECENT, wxString("Open &Recent"));
menu_File->AppendSeparator();
- menu_File->Append(ID_MENU_CLOSE_PROJECT, _("&Close Project"));
- menu_File->Append(ID_MENU_CLOSE_ALL_PROJECTS, _("C&lose All Projects"));
+ menu_File->Append(ID_MENU_CLOSE_PROJECT, wxString("&Close Project"));
+ menu_File->Append(ID_MENU_CLOSE_ALL_PROJECTS, wxString("C&lose All Projects"));
menu_File->AppendSeparator();
- menu_File->Append(ID_MENU_EXPORT_HIERARCHY, _("&Export Project Hierarchy..."));
+ menu_File->Append(ID_MENU_EXPORT_HIERARCHY, wxString("&Export Project Hierarchy..."));
menu_File->AppendSeparator();
- menu_File->Append(ID_MENU_EXIT, _("E&xit"));
+ menu_File->Append(ID_MENU_EXIT, wxString("E&xit"));
- menuBar->Append(menu_File, _("&File"));
+ menuBar->Append(menu_File, wxString("&File"));
//EditMenu
menu_Edit = new wxMenu();
- menu_Edit->Append(ID_MENU_REFRESH_PROJECT, _("&Refresh Project"));
+ menu_Edit->Append(ID_MENU_REFRESH_PROJECT, wxString("&Refresh Project"));
menu_Edit->AppendSeparator();
- menu_Edit->Append(ID_MENU_CUT, _("Cu&t"));
- menu_Edit->Append(ID_MENU_COPY, _("&Copy"));
- menu_Edit->Append(ID_MENU_PASTE, _("&Paste"));
+ menu_Edit->Append(ID_MENU_CUT, wxString("Cu&t"));
+ menu_Edit->Append(ID_MENU_COPY, wxString("&Copy"));
+ menu_Edit->Append(ID_MENU_PASTE, wxString("&Paste"));
menu_Edit->AppendSeparator();
- menu_Edit->Append(ID_MENU_DELETE, _("&Delete"));
- menu_Edit->Append(ID_MENU_SELECT_ALL, _("Select &All"));
- menu_Edit->Append(ID_MENU_SELECT_NONE, _("Ca&ncel Selection"));
+ menu_Edit->Append(ID_MENU_DELETE, wxString("&Delete"));
+ menu_Edit->Append(ID_MENU_SELECT_ALL, wxString("Select &All"));
+ menu_Edit->Append(ID_MENU_SELECT_NONE, wxString("Ca&ncel Selection"));
- menuBar->Append(menu_Edit, _("&Edit"));
+ menuBar->Append(menu_Edit, wxString("&Edit"));
//ToolsMenu
menu_Tools = new wxMenu();
- menu_Tools->Append(ID_MENU_EVENT_LOG, _("Event &Log"));
- menu_Tools->Append(ID_MENU_BBTK_GRAPHICAL_EDITOR, _("BBTK &Graphical Editor"));
- menu_Tools->Append(ID_MENU_MINITOOLS, _("&MiniTools"));
- menu_Tools->Append(ID_MENU_CODE_EDITOR, _("&Code Editor"));
- menu_Tools->Append(ID_MENU_COMMAND_LINE, _("&Command Line"));
+ menu_Tools->Append(ID_MENU_EVENT_LOG, wxString("Event &Log"));
+ menu_Tools->Append(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxString("BBTK &Graphical Editor"));
+ menu_Tools->Append(ID_MENU_MINITOOLS, wxString("&MiniTools"));
+ menu_Tools->Append(ID_MENU_CODE_EDITOR, wxString("&Code Editor"));
+ menu_Tools->Append(ID_MENU_COMMAND_LINE, wxString("&Command Line"));
- menuBar->Append(menu_Tools, _("&Tools"));
+ menuBar->Append(menu_Tools, wxString("&Tools"));
//HelpMenu
menu_Help = new wxMenu();
- menu_Help->Append(ID_MENU_HELP, _("&Help"));
- menu_Help->Append(ID_MENU_REPORT_BUG, _("Report &Bug"));
- menu_Help->Append(ID_MENU_ABOUT_CREADEVMANAGER, _("&About CreaDevManager"));
- menu_Help->Append(ID_MENU_ABOUT_CREATIS, _("A&bout CREATIS"));
+ menu_Help->Append(ID_MENU_HELP, wxString("&Help"));
+ menu_Help->Append(ID_MENU_REPORT_BUG, wxString("Report &Bug"));
+ menu_Help->Append(ID_MENU_ABOUT_CREADEVMANAGER, wxString("&About CreaDevManager"));
+ menu_Help->Append(ID_MENU_ABOUT_CREATIS, wxString("A&bout CREATIS"));
- menuBar->Append(menu_Help, _("&Help"));
+ menuBar->Append(menu_Help, wxString("&Help"));
//Set Bar
SetMenuBar(menuBar);
panel_Properties = new wxCreaDevManagerDescriptionPanel(
this,
ID_WINDOW_PROPERTIES,
- _("Description Panel"),
+ wxString("Description Panel"),
wxDefaultPosition,
wxDefaultSize,
0
panel_ProjectActions = new wxCreaDevManagerProjectActionsPanel(
this,
ID_WINDOW_PROJ_ACTIONS,
- _("Project Actions Panel"),
+ wxString("Project Actions Panel"),
wxDefaultPosition,
wxDefaultSize,
0
);
panel_ProjectActions->SetMinSize(wxSize(500, 150));
- auiManager.AddPane(tree_Projects, wxLEFT, wxT("Projects Tree"));
- auiManager.AddPane(panel_ProjectActions, wxBOTTOM, wxT("Project Actions"));
- auiManager.AddPane(panel_Properties, wxCENTER, wxT("Properties"));
+ auiManager.AddPane(tree_Projects, wxLEFT, wxString("Projects Tree"));
+ auiManager.AddPane(panel_ProjectActions, wxBOTTOM, wxString("Project Actions"));
+ auiManager.AddPane(panel_Properties, wxCENTER, wxString("Properties"));
auiManager.Update();
auiManager.GetPane(tree_Projects).CloseButton(false).MaximizeButton(true);
- auiManager.GetPane(panel_Properties).CloseButton(false);
+ auiManager.GetPane(panel_Properties).CloseButton(false);
}
//Event Handlers
//File menu
void wxCreaDevManagerMainFrame::OnMenuNewProject(wxCommandEvent& event)
{
- cerr << "Event OnMenuNewProject not implemented yet" << endl;
+ std::cerr << "Event OnMenuNewProject not implemented yet" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuOpenProject(wxCommandEvent& event)
{
- cerr << "Event OnMenuOpenProject not implemented" << endl;
+ //std::cerr << "Event OnMenuOpenProject not implemented" << std::endl;
long style = wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST;
- wxDirDialog* FD = new wxDirDialog(this, crea::std2wx("Select the project directory"), crea::std2wx(""), style);
+ wxDirDialog* FD = new wxDirDialog(this, wxString("Select the project directory"), wxString(""), style);
long userResponse;
userResponse = FD->ShowModal();
if(userResponse == wxID_OK)
{
- string path = crea::wx2std (FD->GetPath());
- cout << "selection path: "<< path << endl;
- string path1 = path + "/Makefile";
+ 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
{
- cerr << path1 << ": file not found..." << endl;
+ 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
{
- cerr << path1 << ": file not found..." << endl;
+ 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
- cout << "sources folder found..." << endl;
+ std::cout << "sources folder found..." << std::endl;
fclose(pFile);
}
}else{//binary folder
- cout << "binary folder found..." << endl;
+ std::cout << "binary folder found..." << std::endl;
fclose(pFile);
- ifstream readFile;
+ std::ifstream readFile;
readFile.open(path1.c_str());
- string word;
+ std::string word;
bool found = false;
while(!found && readFile >> word)
{
if(!found)
{
- cerr << "sources not found..." << endl;
- wxMessageBox( wxT("Sources not found."), wxT("Open Project - Error"), wxICON_ERROR);
+ 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");
- cout << "sources at " << path << " open = " << (pFile != NULL) << endl;
- cout.flush();
+ std::cout << "sources at " << path << " open = " << (pFile != NULL) << std::endl;
+ std::cout.flush();
}
}
}
void wxCreaDevManagerMainFrame::OnMenuOpenRecent(wxCommandEvent& event)
{
- cerr << "Event OnMenuOpenRecent not implemented" << endl;
+ std::cerr << "Event OnMenuOpenRecent not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuCloseProject(wxCommandEvent& event)
{
- cerr << "Event OnMenuCloseProject not implemented" << endl;
+ std::cerr << "Event OnMenuCloseProject not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuCloseAllProjects(wxCommandEvent& event)
{
- cerr << "Event OnMenuCloseAllProjects not implemented" << endl;
+ std::cerr << "Event OnMenuCloseAllProjects not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuExportHierarchy(wxCommandEvent& event)
{
- cerr << "Event OnMenuExportHierarchy not implemented" << endl;
+ std::cerr << "Event OnMenuExportHierarchy not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuExit(wxCommandEvent& event)
{
- cout << "Closing CreaDevManager..." << endl;
+ std::cout << "Closing CreaDevManager..." << std::endl;
Close();
event.Skip();
}
//Edit Menu
void wxCreaDevManagerMainFrame::OnMenuRefreshProject(wxCommandEvent& event)
{
- cerr << "Event OnMenuRefreshProject not implemented" << endl;
+ std::cerr << "Event OnMenuRefreshProject not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuMenuCut(wxCommandEvent& event)
{
- cerr << "Event OnMenuMenuCut not implemented" << endl;
+ std::cerr << "Event OnMenuMenuCut not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuMenuCopy(wxCommandEvent& event)
{
- cerr << "Event OnMenuMenuCopy not implemented" << endl;
+ std::cerr << "Event OnMenuMenuCopy not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuMenuPaste(wxCommandEvent& event)
{
- cerr << "Event OnMenuMenuPaste not implemented" << endl;
+ std::cerr << "Event OnMenuMenuPaste not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuMenuDelete(wxCommandEvent& event)
{
- cerr << "Event OnMenuMenuDelete not implemented" << endl;
+ std::cerr << "Event OnMenuMenuDelete not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuSelectAll(wxCommandEvent& event)
{
- cerr << "Event OnMenuSelectAll not implemented" << endl;
+ std::cerr << "Event OnMenuSelectAll not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuSelectNone(wxCommandEvent& event)
{
- cerr << "Event OnMenuSelectNone not implemented" << endl;
+ std::cerr << "Event OnMenuSelectNone not implemented" << std::endl;
event.Skip();
}
//Tools Menu
void wxCreaDevManagerMainFrame::OnMenuEventLog(wxCommandEvent& event)
{
- cerr << "Event OnMenuEventLog not implemented" << endl;
+ std::cerr << "Event OnMenuEventLog not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuBBTKGraphicalEditor(wxCommandEvent& event)
{
- cerr << "Event OnMenuBBTKGraphicalEditor not implemented" << endl;
+ std::cerr << "Event OnMenuBBTKGraphicalEditor not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuMiniTools(wxCommandEvent& event)
{
- cerr << "Event OnMenuMiniTools not implemented" << endl;
+ std::cerr << "Event OnMenuMiniTools not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuCodeEditor(wxCommandEvent& event)
{
- cerr << "Event OnMenuCodeEditor not implemented" << endl;
+ std::cerr << "Event OnMenuCodeEditor not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuCommandLine(wxCommandEvent& event)
{
- cerr << "Event OnMenuCommandLine not implemented" << endl;
+ std::cerr << "Event OnMenuCommandLine not implemented" << std::endl;
event.Skip();
}
//Help Menu
void wxCreaDevManagerMainFrame::OnMenuHelp(wxCommandEvent& event)
{
- cerr << "Event OnMenuHelp not implemented" << endl;
+ std::cerr << "Event OnMenuHelp not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuReportBug(wxCommandEvent& event)
{
- cerr << "Event OnMenuReportBug not implemented" << endl;
+ std::cerr << "Event OnMenuReportBug not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuAboutCreaDevManager(wxCommandEvent& event)
{
- cerr << "Event OnMenuAboutCreaDevManager not implemented" << endl;
+ std::cerr << "Event OnMenuAboutCreaDevManager not implemented" << std::endl;
event.Skip();
}
void wxCreaDevManagerMainFrame::OnMenuAboutCreatis(wxCommandEvent& event)
{
- cerr << "Event OnMenuAboutCreatis not implemented" << endl;
+ std::cerr << "Event OnMenuAboutCreatis not implemented" << std::endl;
event.Skip();
}