From 71c071fbb1e2af618f6caa489351b966e1a54b1a Mon Sep 17 00:00:00 2001 From: Daniel Gonzalez Date: Sat, 6 Apr 2013 15:01:51 +0200 Subject: [PATCH] Feature #1711 CreaDevManager application implementation Fix: Scrollbars included for all description panels Feature: Show included libraries (3rd Party and custom) and checkboxes to include them in: Packages. Just shows a test library that doesn't really exist. --- lib/creaDevManagerLib/modelCDMPackage.cpp | 26 +++ lib/creaDevManagerLib/modelCDMPackage.h | 24 ++ .../wxCDMAppliDescriptionPanel.cpp | 9 +- .../wxCDMAppliDescriptionPanel.h | 3 +- .../wxCDMApplicationDescriptionPanel.cpp | 13 +- .../wxCDMApplicationDescriptionPanel.h | 3 +- .../wxCDMBlackBoxDescriptionPanel.cpp | 7 +- .../wxCDMBlackBoxDescriptionPanel.h | 3 +- .../wxCDMCMakeListsDescriptionPanel.cpp | 3 + .../wxCDMCMakeListsDescriptionPanel.h | 3 +- .../wxCDMFileDescriptionPanel.cpp | 10 +- .../wxCDMFileDescriptionPanel.h | 3 +- .../wxCDMFolderDescriptionPanel.cpp | 4 + .../wxCDMFolderDescriptionPanel.h | 3 +- .../wxCDMLibDescriptionPanel.cpp | 8 +- .../wxCDMLibDescriptionPanel.h | 3 +- .../wxCDMLibraryDescriptionPanel.cpp | 8 +- .../wxCDMLibraryDescriptionPanel.h | 3 +- .../wxCDMMainDescriptionPanel.cpp | 4 + .../wxCDMMainDescriptionPanel.h | 3 +- .../wxCDMPackageConfigurationDialog.cpp | 217 ++++++++++++++++++ .../wxCDMPackageConfigurationDialog.h | 127 ++++++++++ .../wxCDMPackageDescriptionPanel.cpp | 21 +- .../wxCDMPackageDescriptionPanel.h | 7 +- .../wxCDMPackageManagerPanel.cpp | 6 +- .../wxCDMPackageManagerPanel.h | 3 +- .../wxCDMProjectActionsPanel.cpp | 4 + .../wxCDMProjectActionsPanel.h | 3 +- .../wxCDMProjectDescriptionPanel.cpp | 10 +- .../wxCDMProjectDescriptionPanel.h | 3 +- 30 files changed, 498 insertions(+), 46 deletions(-) create mode 100644 lib/creaDevManagerLib/wxCDMPackageConfigurationDialog.cpp create mode 100644 lib/creaDevManagerLib/wxCDMPackageConfigurationDialog.h diff --git a/lib/creaDevManagerLib/modelCDMPackage.cpp b/lib/creaDevManagerLib/modelCDMPackage.cpp index 66c5e22..43d169a 100644 --- a/lib/creaDevManagerLib/modelCDMPackage.cpp +++ b/lib/creaDevManagerLib/modelCDMPackage.cpp @@ -689,3 +689,29 @@ void modelCDMPackage::CheckStructure(std::map& properties) } } + +std::map modelCDMPackage::Get3rdPartyLibraries() +{ + std::map res; + res["Test"] = false; + return res; +} + +bool modelCDMPackage::Set3rdPartyLibrary(const std::string& library_name, + const bool& toInclude) +{ + return false; +} + +std::map modelCDMPackage::GetCustomLibraries() +{ + std::map res; + res["Test"] = false; + return res; +} + +bool modelCDMPackage::SetCustomLibrary(const std::string& library_name, + const bool& toInclude) +{ + return false; +} diff --git a/lib/creaDevManagerLib/modelCDMPackage.h b/lib/creaDevManagerLib/modelCDMPackage.h index 05e2473..198e68b 100644 --- a/lib/creaDevManagerLib/modelCDMPackage.h +++ b/lib/creaDevManagerLib/modelCDMPackage.h @@ -161,6 +161,30 @@ public: */ void CheckStructure(std::map& 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 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 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. diff --git a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp index 00488ba..710d1ee 100644 --- a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp @@ -80,6 +80,11 @@ bool wxCDMAppliDescriptionPanel::Create( ) { 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; @@ -177,12 +182,12 @@ void wxCDMAppliDescriptionPanel::CreateControls() 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); diff --git a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.h index 99c8f59..a12c31f 100644 --- a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.h @@ -36,7 +36,6 @@ #define WXCDMAPPLIDESCRIPTIONPANEL_H_ #include -#include #include #include "modelCDMAppli.h" @@ -44,7 +43,7 @@ /** * 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: diff --git a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp index e370856..45d7b7e 100644 --- a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp @@ -82,6 +82,11 @@ bool wxCDMApplicationDescriptionPanel::Create( ) { 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; @@ -266,19 +271,19 @@ void wxCDMApplicationDescriptionPanel::CreateControls() //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.")); diff --git a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.h index 027db4f..d3117f8 100644 --- a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.h @@ -36,7 +36,6 @@ #define WXCDMAPPLICATIONDESCRIPTIONPANEL_H_ #include -#include #include #include "modelCDMApplication.h" @@ -44,7 +43,7 @@ /** * 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: diff --git a/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp index 959d27a..c562ef7 100644 --- a/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.cpp @@ -79,6 +79,11 @@ bool wxCDMBlackBoxDescriptionPanel::Create( ) { 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; @@ -186,7 +191,7 @@ void wxCDMBlackBoxDescriptionPanel::CreateControls() 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); diff --git a/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.h index 94d3071..fb0291b 100644 --- a/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMBlackBoxDescriptionPanel.h @@ -36,7 +36,6 @@ #define WXCDMBLACKBOXDESCRIPTIONPANEL_H_ #include -#include #include #include "modelCDMBlackBox.h" @@ -44,7 +43,7 @@ /** * 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: diff --git a/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.cpp index 0731624..40c2c33 100644 --- a/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.cpp @@ -73,6 +73,9 @@ bool wxCDMCMakeListsDescriptionPanel::Create( ) { 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; diff --git a/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.h index ac6f73f..e2ca842 100644 --- a/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMCMakeListsDescriptionPanel.h @@ -36,7 +36,6 @@ #define WXCDMCMAKELISTSDESCRIPTIONPANEL_H_ #include -#include #include #include "modelCDMCMakeListsFile.h" @@ -44,7 +43,7 @@ /** * 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: diff --git a/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.cpp index fac03fa..81768a9 100644 --- a/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.cpp @@ -75,6 +75,10 @@ bool wxCDMFileDescriptionPanel::Create( ) { 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; @@ -124,16 +128,16 @@ void wxCDMFileDescriptionPanel::CreateControls() 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); diff --git a/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.h index 09cc104..8eee2ee 100644 --- a/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMFileDescriptionPanel.h @@ -36,7 +36,6 @@ #define WXCDMFILEDESCRIPTIONPANEL_H_ #include -#include #include #include "modelCDMFile.h" @@ -44,7 +43,7 @@ /** * 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: diff --git a/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.cpp index 7acc023..7f95533 100644 --- a/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.cpp @@ -76,6 +76,10 @@ bool wxCDMFolderDescriptionPanel::Create( ) { 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; diff --git a/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.h index fafe66e..f06f0ce 100644 --- a/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMFolderDescriptionPanel.h @@ -36,7 +36,6 @@ #define WXCDMFOLDERDESCRIPTIONPANEL_H_ #include -#include #include #include "modelCDMFolder.h" @@ -44,7 +43,7 @@ /** * 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: diff --git a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp index cc63528..039c45a 100644 --- a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp @@ -78,6 +78,10 @@ bool wxCDMLibDescriptionPanel::Create( ) { 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; @@ -175,12 +179,12 @@ void wxCDMLibDescriptionPanel::CreateControls() 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); diff --git a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.h index 630c7b4..15c9ec4 100644 --- a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.h @@ -36,7 +36,6 @@ #define WXCDMLIBDESCRIPTIONPANEL_H_ #include -#include #include #include "modelCDMLib.h" @@ -44,7 +43,7 @@ /** * 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: diff --git a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp index 1b78ba0..47efd9c 100644 --- a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp @@ -81,6 +81,10 @@ bool wxCDMLibraryDescriptionPanel::Create( ) { 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; @@ -271,12 +275,12 @@ void wxCDMLibraryDescriptionPanel::CreateControls() 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); diff --git a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.h index cf05cd9..0fcc262 100644 --- a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.h @@ -36,7 +36,6 @@ #define WXCDMLIBRARYDESCRIPTIONPANEL_H_ #include -#include #include #include "modelCDMLibrary.h" @@ -44,7 +43,7 @@ /** * Library description panel. Shows the available actions on the described library. */ -class wxCDMLibraryDescriptionPanel : public wxPanel +class wxCDMLibraryDescriptionPanel : public wxScrolledWindow { DECLARE_EVENT_TABLE() public: diff --git a/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.cpp index d7f10ae..41daf68 100644 --- a/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.cpp @@ -74,6 +74,10 @@ bool wxCDMMainDescriptionPanel::Create( ) { 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; } diff --git a/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.h index fb0defa..08490f7 100644 --- a/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.h @@ -37,11 +37,10 @@ #define WXCDMMAINDESCRIPTIONPANEL_H_ #include -#include /** * 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() diff --git a/lib/creaDevManagerLib/wxCDMPackageConfigurationDialog.cpp b/lib/creaDevManagerLib/wxCDMPackageConfigurationDialog.cpp new file mode 100644 index 0000000..af407bf --- /dev/null +++ b/lib/creaDevManagerLib/wxCDMPackageConfigurationDialog.cpp @@ -0,0 +1,217 @@ +/* +# --------------------------------------------------------------------- +# +# 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 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::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 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::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() + ); +} diff --git a/lib/creaDevManagerLib/wxCDMPackageConfigurationDialog.h b/lib/creaDevManagerLib/wxCDMPackageConfigurationDialog.h new file mode 100644 index 0000000..03e02a3 --- /dev/null +++ b/lib/creaDevManagerLib/wxCDMPackageConfigurationDialog.h @@ -0,0 +1,127 @@ +/* +# --------------------------------------------------------------------- +# +# 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 +#include + +#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_ */ diff --git a/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp index e2e452c..5ac4691 100644 --- a/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.cpp @@ -40,6 +40,7 @@ #include "images/PkIcon64.xpm" #include "wxCDMNewBlackBoxDialog.h" +#include "wxCDMPackageConfigurationDialog.h" #include #include "CDMUtilities.h" @@ -57,6 +58,7 @@ EVT_HYPERLINK(ID_LINK_SELECT_BLACKBOX, wxCDMPackageDescriptionPanel::OnLnkBlackB 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( @@ -87,6 +89,10 @@ bool wxCDMPackageDescriptionPanel::Create( ) { 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; @@ -215,12 +221,15 @@ void wxCDMPackageDescriptionPanel::CreateControls() 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); @@ -407,6 +416,14 @@ void wxCDMPackageDescriptionPanel::OnBtnCreateBlackBox(wxCommandEvent& event) } } +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; diff --git a/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.h index 8e88f9a..6e992bd 100644 --- a/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMPackageDescriptionPanel.h @@ -36,7 +36,6 @@ #define WXCDMPACKAGEDESCRIPTIONPANEL_H_ #include -#include #include #include "modelCDMPackage.h" @@ -44,7 +43,7 @@ /** * 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: @@ -146,6 +145,10 @@ protected: * 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. */ diff --git a/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp b/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp index 871b20b..a706c17 100644 --- a/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp @@ -80,6 +80,10 @@ bool wxCDMPackageManagerPanel::Create( ) { 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; @@ -170,7 +174,7 @@ void wxCDMPackageManagerPanel::CreateControls() 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); diff --git a/lib/creaDevManagerLib/wxCDMPackageManagerPanel.h b/lib/creaDevManagerLib/wxCDMPackageManagerPanel.h index 3c5dc99..245ebf9 100644 --- a/lib/creaDevManagerLib/wxCDMPackageManagerPanel.h +++ b/lib/creaDevManagerLib/wxCDMPackageManagerPanel.h @@ -36,7 +36,6 @@ #define WXCDMPACKAGEMANAGERPANEL_H_ #include -#include #include #include @@ -45,7 +44,7 @@ /** * 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: diff --git a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp index 0b33c8c..5b5510e 100755 --- a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.cpp @@ -75,6 +75,10 @@ bool wxCDMProjectActionsPanel::Create( ) { 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); diff --git a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.h b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.h index 93850e2..cd60d75 100755 --- a/lib/creaDevManagerLib/wxCDMProjectActionsPanel.h +++ b/lib/creaDevManagerLib/wxCDMProjectActionsPanel.h @@ -37,14 +37,13 @@ #define WXCDMPROJECTACTIONSPANEL_H_ #include -#include #include "modelCDMProject.h" /** * Panel with common actions for an open Crea project. */ -class wxCDMProjectActionsPanel : public wxPanel +class wxCDMProjectActionsPanel : public wxScrolledWindow { DECLARE_EVENT_TABLE() public: diff --git a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp index 76aa9bb..503d511 100644 --- a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp @@ -81,6 +81,10 @@ bool wxCDMProjectDescriptionPanel::Create( ) { 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; @@ -135,7 +139,7 @@ void wxCDMProjectDescriptionPanel::CreateControls() // 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); @@ -143,7 +147,7 @@ void wxCDMProjectDescriptionPanel::CreateControls() // 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); @@ -206,7 +210,7 @@ void wxCDMProjectDescriptionPanel::CreateControls() 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); diff --git a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.h index 86726c5..74a71d7 100644 --- a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.h @@ -36,14 +36,13 @@ #define WXCDMPROJECTDESCRIPTIONPANEL_H_ #include -#include #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: -- 2.46.2