//std::cout << "executing " << add << std::endl;
system(add.c_str());
+ if(this->project != NULL)
+ {
+ if (!CloseProject(result))
+ return false;
+ }
this->project = new modelCDMProject(nomDirectory);
//if is source folder
if(isSource)
{
+ if(this->project != NULL)
+ {
+ if (!CloseProject(result))
+ return false;
+ }
+
std::cout << "Project sources at: " << pathSource << std::endl;
if(isBinary)
{
std::string*& result
)
{
- //TODO: recreate the project using the project's path
- return true;
+ //recreate the project using the project's path
+ if (this->project != NULL)
+ {
+ return this->project->Refresh(result);
+ }
+ else
+ {
+ result = new std::string("There is no open project.");
+ return false;
+ }
}
bool modelCDMMain::CloseProject(
std::string*& result
)
{
- //TODO: delete the project tree and leave it as NULL
- return true;
+ //delete the project tree and leave it as NULL
+ if (this->project != NULL)
+ {
+ delete this->project;
+ this->project = NULL;
+ return true;
+ }
+ else
+ {
+ result = new std::string("There is no open project.");
+ return false;
+ }
}
#include <iostream>
#include <creaWx.h>
+#include "wx/treectrl.h"
#include "CDMUtilities.h"
#include "creaDevManagerIds.h"
EVT_MENU(ID_MENU_ABOUT_CREATIS, wxCDMMainFrame::OnMenuAboutCreatis)
EVT_BUTTON(ID_BUTTON_NEWPROJECT, wxCDMMainFrame::OnMenuNewProject)
EVT_BUTTON(ID_BUTTON_OPENPROJECT, wxCDMMainFrame::OnMenuOpenProject)
+EVT_TREE_SEL_CHANGED(ID_TREE_PROJECTS, wxCDMMainFrame::OnTreeSelectionChanged)
END_EVENT_TABLE()
wxCDMMainFrame::wxCDMMainFrame(
result,
crea::wx2std(dialog->GetPackageAuthor()),
crea::wx2std(dialog->GetPackageDescription())
- ))
+ ))
{
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());
+ //TODO: change description panel
+ //TODO: change project's actions panel
auiManager.Update();
wxMessageBox(_T("New Project created!"),_T("New Project - Success!"), wxOK | wxICON_INFORMATION);
//populate tree control
tree_Projects->BuildTree(this->model->GetProject());
+ tree_Projects->SelectItem(this->model->GetProject()->GetId());
auiManager.Update();
}
}
void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event)
{
- std::cerr << "Event OnMenuCloseProject not implemented" << std::endl;
+ std::string* result;
+ if(!this->model->CloseProject(result))
+ {
+ wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR);
+ }
event.Skip();
}
void wxCDMMainFrame::OnMenuCloseAllProjects(wxCommandEvent& event)
//Edit Menu
void wxCDMMainFrame::OnMenuRefreshProject(wxCommandEvent& event)
{
- std::cerr << "Event OnMenuRefreshProject not implemented" << std::endl;
+ std::string* result;
+ if(!model->RefreshProject(result))
+ {
+ wxMessageBox( crea::std2wx(result->c_str()), wxT("Refresh Project - Error"), wxICON_ERROR);
+ }
+ //TODO: Show possible problems in CMakeLists files
event.Skip();
}
void wxCDMMainFrame::OnMenuMenuCut(wxCommandEvent& event)
std::cerr << "Event OnMenuAboutCreatis not implemented" << std::endl;
event.Skip();
}
+
+void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event)
+{
+ std::cerr << "Event OnTreeSelectionChange not implemented" << std::endl;
+ event.Skip();
+}
#include <creaWx.h>
#include <wx/aui/aui.h>
+#include <wx/treectrl.h>
#include "wxCDMProjectsTreeCtrl.h"
#include "modelCDMMain.h"
void OnMenuReportBug(wxCommandEvent& event);
void OnMenuAboutCreaDevManager(wxCommandEvent& event);
void OnMenuAboutCreatis(wxCommandEvent& event);
+
+ //Tree
+ void OnTreeSelectionChanged(wxTreeEvent& event);
};
#endif
--- /dev/null
+/*
+# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# The fact that you are presently reading this means that you have had
+# knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------
+*/
+
+/*
+ * wxCDMProjectDescriptionPanel.cpp
+ *
+ * Created on: Nov 27, 2012
+ * Author: Daniel Felipe Gonzalez Obando
+ */
+
+#include "wxCDMProjectDescriptionPanel.h"
+
+wxCDMProjectDescriptionPanel::wxCDMProjectDescriptionPanel(
+ wxWindow* parent,
+ wxWindowID id,
+ const wxString&
+ caption,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style
+)
+{
+}
+
+wxCDMProjectDescriptionPanel::~wxCDMProjectDescriptionPanel()
+{
+}
+
+bool wxCDMProjectDescriptionPanel::Create(
+ wxWindow* parent,
+ wxWindowID id,
+ const wxString& caption,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style
+)
+{
+}
+
+void wxCDMProjectDescriptionPanel::CreateControls()
+{
+}
--- /dev/null
+/*
+# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# The fact that you are presently reading this means that you have had
+# knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------
+ */
+
+/*
+ * wxCDMProjectDescriptionPanel.h
+ *
+ * Created on: Nov 27, 2012
+ * Author: Daniel Felipe Gonzalez Obando
+ */
+
+#ifndef WXCDMPROJECTDESCRIPTIONPANEL_H_
+#define WXCDMPROJECTDESCRIPTIONPANEL_H_
+
+#include <creaWx.h>
+#include <wx/panel.h>
+
+class wxCDMProjectDescriptionPanel : public wxPanel
+{
+public:
+ wxCDMProjectDescriptionPanel(
+ wxWindow* parent,
+ wxWindowID id = -1,
+ const wxString& caption = _("Description Frame"),
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ long style = wxDEFAULT_FRAME_STYLE
+ );
+
+ ~wxCDMProjectDescriptionPanel();
+
+ 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:
+};
+
+#endif /* WXCDMPROJECTDESCRIPTIONPANEL_H_ */