}
}
+
+std::map<std::string, bool> modelCDMPackage::Get3rdPartyLibraries()
+{
+ std::map<std::string, bool> res;
+ res["Test"] = false;
+ return res;
+}
+
+bool modelCDMPackage::Set3rdPartyLibrary(const std::string& library_name,
+ const bool& toInclude)
+{
+ return false;
+}
+
+std::map<std::string, bool> modelCDMPackage::GetCustomLibraries()
+{
+ std::map<std::string, bool> res;
+ res["Test"] = false;
+ return res;
+}
+
+bool modelCDMPackage::SetCustomLibrary(const std::string& library_name,
+ const bool& toInclude)
+{
+ return false;
+}
*/
void CheckStructure(std::map<std::string, bool>& properties);
+ /**
+ * Checks the package's CMakeLists file to check which third party libraries are enabled.
+ * @return A map with the name of the library and if it's included in the CMakeLists file.
+ */
+ std::map<std::string, bool> Get3rdPartyLibraries();
+
+ /**
+ * Sets the 3rd party library inclusion in the CMakeLists file.
+ * @return if the operation was successful.
+ */
+ bool Set3rdPartyLibrary(const std::string& library_name, const bool& toInclude);
+
+ /**
+ * Checks the package CMakeLists file to check which custom libraries are enabled.
+ * @return A map with the name of the library and if it's included in the CMakeLists file.
+ */
+ std::map<std::string, bool> GetCustomLibraries();
+
+ /**
+ * Sets the custom library inclusion in the CMakeLists file.
+ * @return if the operation was successful.
+ */
+ bool SetCustomLibrary(const std::string& library_name, const bool& toInclude);
+
private:
/**
* Package name.
)
{
wxPanel::Create(parent, id, pos, size, style);
+
+ // this part makes the scrollbars show up
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
+
this->appli = appli;
CreateControls();
return TRUE;
wxButton* createApplicationbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_APPLICATION, _T("A. Create Application"));
createApplicationbt->SetToolTip(wxT("Create a new application for this project."));
actionsGridSizer->Add(createApplicationbt, 1, wxALL | wxEXPAND, 5);
- wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("B. Edit CMakeLists File"));
+ wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
editCMakebt->SetToolTip(wxT("Open the system default text editor to edit the CMakeLists.txt file."));
editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMAppliDescriptionPanel::OnCMakeMouseEnter,NULL,this);
editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMAppliDescriptionPanel::OnCMakeMouseExit,NULL,this);
actionsGridSizer->Add(editCMakebt, 1, wxALL | wxEXPAND, 5);
- wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("C. Open Applications Folder"));
+ wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Applications Folder"));
openFolderbt->SetToolTip(wxT("Open the appli folder in the file explorer."));
actionsGridSizer->Add(openFolderbt, 1, wxALL | wxEXPAND, 5);
#define WXCDMAPPLIDESCRIPTIONPANEL_H_
#include <creaWx.h>
-#include <wx/panel.h>
#include <wx/hyperlink.h>
#include "modelCDMAppli.h"
/**
* Application manager description panel. Shows the available applications in the project and the actions corresponding to application management.
*/
-class wxCDMAppliDescriptionPanel : public wxPanel
+class wxCDMAppliDescriptionPanel : public wxScrolledWindow
{
DECLARE_EVENT_TABLE()
public:
)
{
wxPanel::Create(parent, id, pos, size, style);
+
+ // this part makes the scrollbars show up
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
+
this->application = application;
CreateControls();
return TRUE;
//actionsGrid Sizer
wxFlexGridSizer* actionsGridSizer = new wxFlexGridSizer(3, 2, 9, 15);
- wxButton* createClassbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_CLASS, _T("Create Class (Optional)"));
+ wxButton* createClassbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_CLASS, _T("Create Class"));
createClassbt->SetToolTip(wxT("Create a new Class (.h and .cxx files)."));
- wxButton* createFolderbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_FOLDER, _T("Create Folder (Optional)"));
+ wxButton* createFolderbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_FOLDER, _T("Create Folder"));
createFolderbt->SetToolTip(wxT("Create a new Folder inside the application folder."));
wxButton* openMainbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_CXX, _T("A. Open Main File"));
openMainbt->SetToolTip(wxT("Open the main file in the application folder with the default code editor."));
openMainbt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMApplicationDescriptionPanel::OnMainMouseEnter,NULL,this);
openMainbt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMApplicationDescriptionPanel::OnMainMouseExit,NULL,this);
- wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("C. Edit CMakeLists File"));
+ wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt file inside this application."));
editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMApplicationDescriptionPanel::OnCMakeMouseEnter,NULL,this);
editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMApplicationDescriptionPanel::OnCMakeMouseExit,NULL,this);
- wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("B. Open Application Folder"));
+ wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Application Folder"));
openFolderbt->SetToolTip(wxT("Open the application folder in the file explorer."));
#define WXCDMAPPLICATIONDESCRIPTIONPANEL_H_
#include <creaWx.h>
-#include <wx/panel.h>
#include <wx/hyperlink.h>
#include "modelCDMApplication.h"
/**
* Application description panel. Shows the properties and actions available for the described application.
*/
-class wxCDMApplicationDescriptionPanel : public wxPanel
+class wxCDMApplicationDescriptionPanel : public wxScrolledWindow
{
DECLARE_EVENT_TABLE()
public:
)
{
wxPanel::Create(parent, id, pos, size, style);
+
+ // this part makes the scrollbars show up
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
+
this->blackBox = blackBox;
CreateControls();
return TRUE;
openCxxbt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMBlackBoxDescriptionPanel::OnCxxMouseExit,NULL,this);
openCxxbt->SetToolTip(wxT("Open the .cxx file in the default text editor."));
actionsGridSizer->Add(openCxxbt, 1, wxALL | wxEXPAND, 5);
- wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("C. Open Source Folder"));
+ wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Source Folder"));
openFolderbt->SetToolTip(wxT("Open the source folder in the file explorer."));
actionsGridSizer->Add(openFolderbt, 1, wxALL | wxEXPAND, 5);
#define WXCDMBLACKBOXDESCRIPTIONPANEL_H_
#include <creaWx.h>
-#include <wx/panel.h>
#include <wx/hyperlink.h>
#include "modelCDMBlackBox.h"
/**
* Black box description panel. Shows the properties and available actions for the described black box.
*/
-class wxCDMBlackBoxDescriptionPanel : public wxPanel
+class wxCDMBlackBoxDescriptionPanel : public wxScrolledWindow
{
DECLARE_EVENT_TABLE()
public:
)
{
wxPanel::Create(parent, id, pos, size, style);
+ // this part makes the scrollbars show up
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
this->cMakeLists = makefile;
CreateControls();
return TRUE;
#define WXCDMCMAKELISTSDESCRIPTIONPANEL_H_
#include <creaWx.h>
-#include <wx/panel.h>
#include <wx/hyperlink.h>
#include "modelCDMCMakeListsFile.h"
/**
* CMakeLists File description panel. Shows the file properties and the available actions for it.
*/
-class wxCDMCMakeListsDescriptionPanel : public wxPanel
+class wxCDMCMakeListsDescriptionPanel : public wxScrolledWindow
{
DECLARE_EVENT_TABLE()
public:
)
{
wxPanel::Create(parent, id, pos, size, style);
+ // this part makes the scrollbars show up
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
+
this->file = file;
CreateControls();
return TRUE;
wxStaticText *pLength = new wxStaticText(propertiesPanel, -1, wxT("File Size"));
wxStaticText* pLocationtc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(this->file->GetPath()));
- pLocationtc->SetMaxSize(wxSize(350,-1));
+ pLocationtc->SetMaxSize(wxSize(300,-1));
int lgth = this->file->GetLength();
std::stringstream ss;
ss << lgth / 1024;
std::string lgths = ss.str() + " KB";
wxStaticText* pLengthtc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(lgths));
- propertiesGridSizer->Add(pLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ propertiesGridSizer->Add(pLocation, 0, wxALIGN_RIGHT | wxALIGN_TOP);
propertiesGridSizer->Add(pLocationtc, 1, wxEXPAND);
- propertiesGridSizer->Add(pLength, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
+ propertiesGridSizer->Add(pLength, 0, wxALIGN_RIGHT | wxALIGN_TOP);
propertiesGridSizer->Add(pLengthtc, 1, wxEXPAND);
propertiesGridSizer->AddGrowableCol(1,1);
#define WXCDMFILEDESCRIPTIONPANEL_H_
#include <creaWx.h>
-#include <wx/panel.h>
#include <wx/hyperlink.h>
#include "modelCDMFile.h"
/**
* File description panel. Shows the File properties and the available options for it.
*/
-class wxCDMFileDescriptionPanel : public wxPanel
+class wxCDMFileDescriptionPanel : public wxScrolledWindow
{
DECLARE_EVENT_TABLE()
public:
)
{
wxPanel::Create(parent, id, pos, size, style);
+ // this part makes the scrollbars show up
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
+
this->folder = folder;
CreateControls();
return TRUE;
#define WXCDMFOLDERDESCRIPTIONPANEL_H_
#include <creaWx.h>
-#include <wx/panel.h>
#include <wx/hyperlink.h>
#include "modelCDMFolder.h"
/**
* Folder description panel. Shows the properties of the referenced folder and the available actions.
*/
-class wxCDMFolderDescriptionPanel : public wxPanel
+class wxCDMFolderDescriptionPanel : public wxScrolledWindow
{
DECLARE_EVENT_TABLE()
public:
)
{
wxPanel::Create(parent, id, pos, size, style);
+ // this part makes the scrollbars show up
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
+
this->lib = lib;
CreateControls();
return TRUE;
wxButton* createLibrarybt = new wxButton(actionsPanel, ID_BUTTON_CREATE_LIBRARY, _T("A. Create Library"));
createLibrarybt->SetToolTip(wxT("Create a new library for this project."));
actionsGridSizer->Add(createLibrarybt, 1, wxALL | wxEXPAND, 5);
- wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("B. Edit CMakeLists File"));
+ wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
editCMakebt->SetToolTip(wxT("Open the system default text editor to edit the Lib's CMakeLists.txt file."));
editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibDescriptionPanel::OnCMakeMouseEnter,NULL,this);
editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibDescriptionPanel::OnCMakeMouseExit,NULL,this);
actionsGridSizer->Add(editCMakebt, 1, wxALL | wxEXPAND, 5);
- wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("C. Open Libraries Folder"));
+ wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Libraries Folder"));
openFolderbt->SetToolTip(wxT("Open the lib folder in the file explorer."));
actionsGridSizer->Add(openFolderbt, 1, wxALL | wxEXPAND, 5);
#define WXCDMLIBDESCRIPTIONPANEL_H_
#include <creaWx.h>
-#include <wx/panel.h>
#include <wx/hyperlink.h>
#include "modelCDMLib.h"
/**
* Library manager description panel. Shows the available libraries in the project and the actions corresponding to library management.
*/
-class wxCDMLibDescriptionPanel : public wxPanel
+class wxCDMLibDescriptionPanel : public wxScrolledWindow
{
DECLARE_EVENT_TABLE()
public:
)
{
wxPanel::Create(parent, id, pos, size, style);
+ // this part makes the scrollbars show up
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
+
this->library = library;
CreateControls();
return TRUE;
wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("B. Open Library Folder"));
openFolderbt->SetToolTip(wxT("Open the library folder in the file explorer."));
actionsGridSizer->Add(openFolderbt, 1, wxALL | wxEXPAND, 5);
- wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("C. Edit CMakeLists File"));
+ wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt of this library in the default text editor."));
editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibraryDescriptionPanel::OnCMakeMouseEnter,NULL,this);
editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibraryDescriptionPanel::OnCMakeMouseExit,NULL,this);
actionsGridSizer->Add(editCMakebt, 1, wxALL | wxEXPAND, 5);
- wxButton* createFolderbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_FOLDER, _T("Create Folder (Optional)"));
+ wxButton* createFolderbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_FOLDER, _T("Create Folder"));
createFolderbt->SetToolTip(wxT("Create a new folder for this library."));
actionsGridSizer->Add(createFolderbt, 1, wxALL | wxEXPAND, 5);
#define WXCDMLIBRARYDESCRIPTIONPANEL_H_
#include <creaWx.h>
-#include <wx/panel.h>
#include <wx/hyperlink.h>
#include "modelCDMLibrary.h"
/**
* Library description panel. Shows the available actions on the described library.
*/
-class wxCDMLibraryDescriptionPanel : public wxPanel
+class wxCDMLibraryDescriptionPanel : public wxScrolledWindow
{
DECLARE_EVENT_TABLE()
public:
)
{
wxPanel::Create(parent, id, pos, size, style);
+ //to scroll
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
+
CreateControls();
return TRUE;
}
#define WXCDMMAINDESCRIPTIONPANEL_H_
#include <creaWx.h>
-#include <wx/panel.h>
/**
* Main View description panel. Shows the welcome message and allows to open or create Crea projects.
*/
-class wxCDMMainDescriptionPanel : public wxPanel
+class wxCDMMainDescriptionPanel : public wxScrolledWindow
{
DECLARE_EVENT_TABLE()
--- /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.
+# ------------------------------------------------------------------------
+ */
+
+
+/*
+ * wxCDMPackageConfigurationDialog.cpp
+ *
+ * Created on: 6/4/2013
+ * Author: Daniel Felipe Gonzalez Obando
+ */
+
+#include "wxCDMPackageConfigurationDialog.h"
+
+#include "creaDevManagerIds.h"
+
+BEGIN_EVENT_TABLE(wxCDMPackageConfigurationDialog, wxDialog)
+EVT_BUTTON(wxID_OK, wxCDMPackageConfigurationDialog::OnFinish)
+EVT_CHECKBOX(ID_CHECK_INCLUDE_3RDLIBRARY, wxCDMPackageConfigurationDialog::On3rdLibraryIncludeChange)
+EVT_CHECKBOX(ID_CHECK_INCLUDE_LIBRARY, wxCDMPackageConfigurationDialog::OnCustomLibraryIncludeChange)
+END_EVENT_TABLE()
+
+wxCDMPackageConfigurationDialog::wxCDMPackageConfigurationDialog(
+ wxWindow* parent,
+ modelCDMPackage* package,
+ wxWindowID id,
+ const wxString& caption,
+ const wxPoint& position,
+ const wxSize& size,
+ long style
+)
+{
+ wxCDMPackageConfigurationDialog::Create(parent, id, caption, position, size, style);
+ this->package = package;
+}
+
+wxCDMPackageConfigurationDialog::~wxCDMPackageConfigurationDialog()
+{
+}
+
+bool wxCDMPackageConfigurationDialog::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);
+
+ this->CreateControls();
+
+ return TRUE;
+}
+
+void wxCDMPackageConfigurationDialog::CreateControls()
+{
+
+ wxBoxSizer* v_sizer1 = new wxBoxSizer(wxVERTICAL);
+
+
+ wxStaticText* title = new wxStaticText(this, wxID_ANY, wxT("Please select the libraries that are used in this package."), 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, 5);
+
+ wxBoxSizer* includesPanelSizer = new wxBoxSizer(wxVERTICAL);
+
+ //Third Party Libraries
+ wxStaticText* Title1 = new wxStaticText(this, wxID_ANY, wxT("Third Party Libraries:"));
+ wxFont font = Title1->GetFont();
+ font.SetWeight(wxFONTWEIGHT_BOLD);
+ Title1->SetFont(font);
+ includesPanelSizer->Add(Title1, 0, wxEXPAND | wxALL, 5);
+
+ //inclusion data
+ std::map<std::string, bool> inclusions = this->package->Get3rdPartyLibraries();
+ //includesGrid Sizer
+ wxFlexGridSizer* includesGridSizer = new wxFlexGridSizer(inclusions.size()+1, 2, 0, 5);
+
+ wxStaticText* ChBTitle = new wxStaticText(
+ this,
+ wxID_ANY,
+ wxT("Included"),
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_CENTER
+ );
+ wxStaticText* LNmTitle = new wxStaticText(
+ this,
+ wxID_ANY,
+ wxT("Library Name"),
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_LEFT
+ );
+
+ includesGridSizer->Add(ChBTitle, 1, wxEXPAND);
+ includesGridSizer->Add(LNmTitle, 1, wxEXPAND);
+
+ for (std::map<std::string, bool>::iterator it = inclusions.begin(); it != inclusions.end(); ++it) {
+ wxCheckBox* ChBIncl = new wxCheckBox(
+ this, ID_CHECK_INCLUDE_3RDLIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
+ );
+ ChBIncl->SetToolTip(crea::std2wx("When this box is checked the " + it->first + " library is included in the project configuration for this library."));
+ ChBIncl->SetName(crea::std2wx(it->first));
+ ChBIncl->SetValue(it->second);
+ includesGridSizer->Add(ChBIncl, 1, wxEXPAND);
+
+ wxStaticText* LNmIncl = new wxStaticText(this, wxID_ANY, crea::std2wx(it->first));
+ includesGridSizer->Add(LNmIncl, 1, wxEXPAND);
+ }
+
+ includesGridSizer->AddGrowableCol(1,1);
+
+ includesPanelSizer->Add(includesGridSizer, 1, wxEXPAND, 0);
+
+ //Custom Libraries
+ wxStaticText* Title2 = new wxStaticText(this, wxID_ANY, wxT("Custom Libraries:"));
+ font = Title2->GetFont();
+ font.SetWeight(wxFONTWEIGHT_BOLD);
+ Title2->SetFont(font);
+ includesPanelSizer->Add(Title2, 0, wxEXPAND | wxALL, 5);
+
+ //inclusion data
+ std::map<std::string, bool> inclusionsLibs = this->package->GetCustomLibraries();
+ //includesGrid Sizer
+ wxFlexGridSizer* includesLibGridSizer = new wxFlexGridSizer(inclusionsLibs.size()+1, 2, 0, 5);
+
+ wxStaticText* ChBTitle1 = new wxStaticText(
+ this,
+ wxID_ANY,
+ wxT("Included"),
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_CENTER
+ );
+ wxStaticText* LNmTitle1 = new wxStaticText(
+ this,
+ wxID_ANY,
+ wxT("Library Name"),
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_LEFT
+ );
+
+ includesLibGridSizer->Add(ChBTitle1, 1, wxEXPAND);
+ includesLibGridSizer->Add(LNmTitle1, 1, wxEXPAND);
+
+ for (std::map<std::string, bool>::iterator it = inclusionsLibs.begin(); it != inclusionsLibs.end(); ++it) {
+ wxCheckBox* ChBIncl = new wxCheckBox(
+ this, ID_CHECK_INCLUDE_LIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
+ );
+ ChBIncl->SetToolTip(crea::std2wx("When this box is checked the " + it->first + " custom library is included in the project configuration for this library."));
+ ChBIncl->SetName(crea::std2wx(it->first));
+ ChBIncl->SetValue(it->second);
+ includesLibGridSizer->Add(ChBIncl, 1, wxEXPAND);
+
+ wxStaticText* LNmIncl = new wxStaticText(this, wxID_ANY, crea::std2wx(it->first));
+ includesLibGridSizer->Add(LNmIncl, 1, wxEXPAND);
+ }
+
+ includesLibGridSizer->AddGrowableCol(1,1);
+
+ includesPanelSizer->Add(includesLibGridSizer, 1, wxEXPAND, 0);
+
+ v_sizer1->Add(includesPanelSizer, 1, wxEXPAND);
+
+ v_sizer1->Add(new wxButton(this, wxID_OK, wxT("Close")), 0, wxALIGN_CENTER | wxRIGHT | wxBOTTOM, 30);
+
+ SetSizer(v_sizer1);
+}
+
+void wxCDMPackageConfigurationDialog::OnFinish(wxCommandEvent& event)
+{
+ this->EndModal(wxID_OK);
+}
+
+void wxCDMPackageConfigurationDialog::On3rdLibraryIncludeChange(
+ wxCommandEvent& event)
+{
+ this->package->Set3rdPartyLibrary(
+ crea::wx2std(((wxCheckBox*)event.GetEventObject())->GetName()),
+ ((wxCheckBox*)event.GetEventObject())->GetValue()
+ );
+}
+
+void wxCDMPackageConfigurationDialog::OnCustomLibraryIncludeChange(
+ wxCommandEvent& event)
+{
+ this->package->SetCustomLibrary(
+ crea::wx2std(((wxCheckBox*)event.GetEventObject())->GetName()),
+ ((wxCheckBox*)event.GetEventObject())->GetValue()
+ );
+}
--- /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.
+# ------------------------------------------------------------------------
+*/
+
+
+/*
+ * wxCDMPackageConfigurationDialog.h
+ *
+ * Created on: 6/4/2013
+ * Author: Daniel Felipe Gonzalez Obando
+ */
+
+#ifndef WXCDMPACKAGECONFIGURATIONDIALOG_H_
+#define WXCDMPACKAGECONFIGURATIONDIALOG_H_
+
+#include <creaWx.h>
+#include <wx/dialog.h>
+
+#include "modelCDMPackage.h"
+
+/**
+ * Package Configuration Dialog
+ */
+class wxCDMPackageConfigurationDialog : public wxDialog
+{
+ DECLARE_EVENT_TABLE()
+public:
+ /**
+ * Package Configuration Dialog Constructor.
+ * @param parent Parent window.
+ * @param package Package Description reference.
+ * @param id Dialog ID. By default wxID_ANY.
+ * @param caption Dialog label. By default "Package Library Configuration".
+ * @param position Dialog position. By default wxDefaultPosition.
+ * @param size Dialog size. By default 350, 370.
+ * @param style Dialog style. By default wxDEFAULT_DIALOG_STYLE.
+ */
+ wxCDMPackageConfigurationDialog(
+ wxWindow* parent,
+ modelCDMPackage * package,
+ wxWindowID id = wxID_ANY,
+ const wxString& caption = wxT("Package Library Configuration"),
+ const wxPoint& position = wxDefaultPosition,
+ const wxSize& size = wxSize(350,370),
+ long style = wxDEFAULT_DIALOG_STYLE
+ );
+ /**
+ * Destructor.
+ */
+ ~wxCDMPackageConfigurationDialog();
+ /**
+ * Package Configuration Dialog Creator.
+ * @param parent Parent window.
+ * @param id Dialog ID. By default wxID_ANY.
+ * @param caption Dialog label. By default "Package Library Configuration".
+ * @param position Dialog position. By default wxDefaultPosition.
+ * @param size Dialog size. By default 350, 370.
+ * @param style Dialog style. By default wxDEFAULT_DIALOG_STYLE.
+ * @return if the creation was successful.
+ */
+ bool Create(
+ wxWindow* parent,
+ wxWindowID id = wxID_ANY,
+ const wxString& caption = wxT("Package Library Configuration"),
+ const wxPoint& position = wxDefaultPosition,
+ const wxSize& size = wxSize(350,370),
+ long style = wxDEFAULT_DIALOG_STYLE
+ );
+
+protected:
+ /**
+ * Creates the help controls (text and buttons).
+ */
+ void CreateControls();
+
+//attributes
+private:
+ /**
+ * Main panel reference.
+ */
+ modelCDMPackage* package;
+
+//handlers
+protected:
+ /**
+ * Handler to close configuration dialog.
+ * @param event Unused.
+ */
+ void OnFinish(wxCommandEvent& event);
+
+ /**
+ * Handler when a third party library include is pressed.
+ * @param event checkbox event.
+ */
+ void On3rdLibraryIncludeChange(wxCommandEvent& event);
+
+ /**
+ * Handler when a custom library include is pressed.
+ * @param event checkbox event.
+ */
+ void OnCustomLibraryIncludeChange(wxCommandEvent& event);
+};
+
+#endif /* WXCDMPACKAGECONFIGURATIONDIALOG_H_ */
#include "images/PkIcon64.xpm"
#include "wxCDMNewBlackBoxDialog.h"
+#include "wxCDMPackageConfigurationDialog.h"
#include <wx/textdlg.h>
#include "CDMUtilities.h"
EVT_BUTTON(ID_BUTTON_CREATE_BLACKBOX, wxCDMPackageDescriptionPanel::OnBtnCreateBlackBox)
EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMPackageDescriptionPanel::OnBtnEditCMakeLists)
EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMPackageDescriptionPanel::OnBtnOpenFolder)
+EVT_BUTTON(ID_BUTTON_CHOOSE, wxCDMPackageDescriptionPanel::OnBtnConfigurePackage)
END_EVENT_TABLE()
wxCDMPackageDescriptionPanel::wxCDMPackageDescriptionPanel(
)
{
wxPanel::Create(parent, id, pos, size, style);
+ // this part makes the scrollbars show up
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
+
this->package = package;
CreateControls();
return TRUE;
wxButton* createBBbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_BLACKBOX, _T("A. Create Black Box"));
createBBbt->SetToolTip(wxT("Create a new black box for the active project inside this package."));
actionsGridSizer->Add(createBBbt, 1, wxALL | wxEXPAND, 5);
- wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("B. Edit CMakeLists File"));
+ wxButton* editConfbt = new wxButton(actionsPanel, ID_BUTTON_CHOOSE, _T("B. Configure Package"));
+ editConfbt->SetToolTip(wxT("Select the libraries your package is going to use. This procedure changes the package's CMakeLists file."));
+ actionsGridSizer->Add(editConfbt, 1, wxALL | wxEXPAND, 5);
+ wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
editCMakebt->SetToolTip(wxT("Open the system default text editor to edit the package's CMakeLists.txt file."));
editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageDescriptionPanel::OnCMakeMouseEnter,NULL,this);
editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageDescriptionPanel::OnCMakeMouseExit,NULL,this);
actionsGridSizer->Add(editCMakebt, 1, wxALL | wxEXPAND, 5);
- wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("C. Open Package Folder"));
+ wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Package Folder"));
openFolderbt->SetToolTip(wxT("Open the package folder in the file explorer."));
actionsGridSizer->Add(openFolderbt, 1, wxALL | wxEXPAND, 5);
}
}
+void
+wxCDMPackageDescriptionPanel::OnBtnConfigurePackage(wxCommandEvent& event)
+{
+ wxCDMPackageConfigurationDialog* dialog = new wxCDMPackageConfigurationDialog(this,this->package);
+ long userResponse;
+ userResponse = dialog->ShowModal();
+}
+
void wxCDMPackageDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
{
std::string* result;
#define WXCDMPACKAGEDESCRIPTIONPANEL_H_
#include <creaWx.h>
-#include <wx/panel.h>
#include <wx/hyperlink.h>
#include "modelCDMPackage.h"
/**
* Package description panel. Shows the package's properties and the available actions for a package.
*/
-class wxCDMPackageDescriptionPanel : public wxPanel
+class wxCDMPackageDescriptionPanel : public wxScrolledWindow
{
DECLARE_EVENT_TABLE()
public:
* Handles when the create black box button is pressed.
*/
void OnBtnCreateBlackBox(wxCommandEvent& event);
+ /**
+ * Handles when the configure package button is pressed.
+ */
+ void OnBtnConfigurePackage(wxCommandEvent& event);
/**
* Handles when the edit cmakelists file button is pressed.
*/
)
{
wxPanel::Create(parent, id, pos, size, style);
+ // this part makes the scrollbars show up
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
+
this->project = project;
CreateControls();
return TRUE;
wxButton* createPkgbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_PACKAGE, _T("A. Create Package"));
createPkgbt->SetToolTip(wxT("Create a new package for this project."));
actionsGridSizer->Add(createPkgbt, 1, wxALL | wxEXPAND, 5);
- wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("B. Edit CMakeLists File"));
+ wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt file of this project."));
editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageManagerPanel::OnCMakeMouseEnter,NULL,this);
editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageManagerPanel::OnCMakeMouseExit,NULL,this);
#define WXCDMPACKAGEMANAGERPANEL_H_
#include <creaWx.h>
-#include <wx/panel.h>
#include <wx/hyperlink.h>
#include <wx/event.h>
/**
* Package manager description panel. Shows the available packages in the project and the actions corresponding to package management.
*/
-class wxCDMPackageManagerPanel : public wxPanel
+class wxCDMPackageManagerPanel : public wxScrolledWindow
{
DECLARE_EVENT_TABLE()
public:
)
{
wxPanel::Create(parent,id,pos,size,style);
+ // this part makes the scrollbars show up
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
+
wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
this->SetSizer(sizer);
#define WXCDMPROJECTACTIONSPANEL_H_
#include <creaWx.h>
-#include <wx/panel.h>
#include "modelCDMProject.h"
/**
* Panel with common actions for an open Crea project.
*/
-class wxCDMProjectActionsPanel : public wxPanel
+class wxCDMProjectActionsPanel : public wxScrolledWindow
{
DECLARE_EVENT_TABLE()
public:
)
{
wxPanel::Create(parent, id, pos, size, style);
+ // this part makes the scrollbars show up
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
+
this->project = project;
CreateControls();
return TRUE;
// sourceLocation
wxBoxSizer* pSourceLocationsz = new wxBoxSizer(wxHORIZONTAL);
wxStaticText* pSourceLocationtc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetPath()));
- //pSourceLocationtc->SetMaxSize(wxSize(350,-1));
+ pSourceLocationtc->SetMaxSize(wxSize(200,-1));
wxButton* pSourceLocationbt = new wxButton(propertiesPanel, ID_BUTTON_OPEN_FOLDER, wxT("Open"));
pSourceLocationbt->SetToolTip(wxT("Open the source folder in the file explorer."));
pSourceLocationsz->Add(pSourceLocationtc, 1, wxALIGN_CENTER, 1);
// buildLocation
wxBoxSizer* pBuildLocationsz = new wxBoxSizer(wxHORIZONTAL);
this->buildPathtc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetBuildPath()));
- //this->buildPathtc->SetMaxSize(wxSize(350,-1));
+ this->buildPathtc->SetMaxSize(wxSize(200,-1));
wxButton* pBuildLocationbt = new wxButton(propertiesPanel, ID_BUTTON_SET_BUILD_PATH, wxT("Choose"));
pBuildLocationbt->SetToolTip(wxT("Select a new location for compiling the project."));
pBuildLocationsz->Add(this->buildPathtc, 1, wxALIGN_CENTER, 1);
actionsGridSizer->Add(appliMgrbt, 1, wxALL | wxEXPAND, 5);
}
// edit CMakeLists file
- wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("D. Edit CMakeLists File"));
+ wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt file of this project."));
editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnCMakeMouseEnter,NULL,this);
editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnCMakeMouseExit,NULL,this);
#define WXCDMPROJECTDESCRIPTIONPANEL_H_
#include <creaWx.h>
-#include <wx/panel.h>
#include "modelCDMProject.h"
/**
* Project Description Panel. Shows the project properties and the principal actions for the project.
*/
-class wxCDMProjectDescriptionPanel : public wxPanel
+class wxCDMProjectDescriptionPanel : public wxScrolledWindow
{
DECLARE_EVENT_TABLE()
public: