From 849573af00f0997944cdc7d4c42365091cd17d13 Mon Sep 17 00:00:00 2001 From: Daniel Gonzalez Date: Fri, 19 Apr 2013 15:05:58 +0200 Subject: [PATCH] Feature #1711 CreaDevManager application implementation Fix: Help in inclusions for Appli, Lib, Package Manager, Applications, Libraries, Packages. Now showing the code behind. Feature: Now the build path can be opened. Fix: Tree panel minimum size fixed to 250 px. --- appli/creaDevManager/creaDevManager.cpp | 2 +- lib/creaDevManagerLib/creaDevManagerIds.h | 71 ++++++++++--------- .../wxCDMAppliDescriptionPanel.cpp | 5 ++ .../wxCDMApplicationDescriptionPanel.cpp | 21 +++++- .../wxCDMLibDescriptionPanel.cpp | 5 ++ .../wxCDMLibraryDescriptionPanel.cpp | 21 +++++- lib/creaDevManagerLib/wxCDMMainFrame.cpp | 2 +- .../wxCDMPackageConfigurationDialog.cpp | 20 +++++- .../wxCDMPackageManagerPanel.cpp | 5 ++ .../wxCDMProjectDescriptionPanel.cpp | 22 ++++-- .../wxCDMProjectDescriptionPanel.h | 4 ++ 11 files changed, 130 insertions(+), 48 deletions(-) diff --git a/appli/creaDevManager/creaDevManager.cpp b/appli/creaDevManager/creaDevManager.cpp index fd922da..a57d7b2 100644 --- a/appli/creaDevManager/creaDevManager.cpp +++ b/appli/creaDevManager/creaDevManager.cpp @@ -49,7 +49,7 @@ bool wxCreaDevManagerApp::OnInit() mainWindow = new wxCDMMainFrame(NULL); SetTopWindow(mainWindow); - mainWindow->SetSize(750, 700); + mainWindow->SetSize(850, 700); wxToolTip::SetDelay(700); mainWindow->Show(true); std::cout << "Crea DevManager opened." << std::endl; diff --git a/lib/creaDevManagerLib/creaDevManagerIds.h b/lib/creaDevManagerLib/creaDevManagerIds.h index bdd9a15..2ac3960 100644 --- a/lib/creaDevManagerLib/creaDevManagerIds.h +++ b/lib/creaDevManagerLib/creaDevManagerIds.h @@ -92,40 +92,41 @@ #define ID_BUTTON_OPEN_COMMAND 10317 #define ID_BUTTON_SET_VERSION 10318 #define ID_BUTTON_SET_BUILD_PATH 10319 -#define ID_BUTTON_SET_AUTHOR 10320 -#define ID_BUTTON_SET_DESCRIPTION 10321 -#define ID_BUTTON_SET_NAME 10322 -#define ID_BUTTON_SET_CATEGORY 10323 - - -#define ID_BUTTON_BUILD_PROJECT 10324 -#define ID_BUTTON_CONFIGURE_BUILD 10325 -#define ID_BUTTON_CONNECT_PROJECT 10326 - -#define ID_BUTTON_GOTO_PACKAGE_MANAGER 10327 -#define ID_BUTTON_GOTO_APPLI_MANAGER 10328 -#define ID_BUTTON_GOTO_LIB_MANAGER 10329 - -#define ID_LINK_SELECT_PACKAGE 10330 -#define ID_LINK_SELECT_LIBRARY 10331 -#define ID_LINK_SELECT_APPLICATION 10332 -#define ID_LINK_SELECT_BLACKBOX 10333 - -#define ID_CHECK_INCLUDE_LIBRARY 10334 -#define ID_CHECK_INCLUDE_3RDLIBRARY 10335 -#define ID_CHECK_INCLUDE_PACKAGE 10336 -#define ID_CHECK_INCLUDE_APPLICATION 10337 - -#define ID_CHECKBOX_ENABLE_HELP 10338 -#define ID_CHECKBOX_DISABLE_HELP 10339 -#define ID_CHECKBOX_TOGGLE_HELP 10340 - -#define ID_BUTTON_CHECK_PROJECT 10341 - -#define ID_MENU_OPEN_RECENT1 10342 -#define ID_MENU_OPEN_RECENT2 10343 -#define ID_MENU_OPEN_RECENT3 10344 -#define ID_MENU_OPEN_RECENT4 10345 -#define ID_MENU_OPEN_RECENT5 10346 +#define ID_BUTTON_OPEN_BUILD_PATH 10320 +#define ID_BUTTON_SET_AUTHOR 10321 +#define ID_BUTTON_SET_DESCRIPTION 10322 +#define ID_BUTTON_SET_NAME 10323 +#define ID_BUTTON_SET_CATEGORY 10324 + + +#define ID_BUTTON_BUILD_PROJECT 10325 +#define ID_BUTTON_CONFIGURE_BUILD 10326 +#define ID_BUTTON_CONNECT_PROJECT 10327 + +#define ID_BUTTON_GOTO_PACKAGE_MANAGER 10328 +#define ID_BUTTON_GOTO_APPLI_MANAGER 10329 +#define ID_BUTTON_GOTO_LIB_MANAGER 10330 + +#define ID_LINK_SELECT_PACKAGE 10331 +#define ID_LINK_SELECT_LIBRARY 10332 +#define ID_LINK_SELECT_APPLICATION 10333 +#define ID_LINK_SELECT_BLACKBOX 10334 + +#define ID_CHECK_INCLUDE_LIBRARY 10335 +#define ID_CHECK_INCLUDE_3RDLIBRARY 10336 +#define ID_CHECK_INCLUDE_PACKAGE 10337 +#define ID_CHECK_INCLUDE_APPLICATION 10338 + +#define ID_CHECKBOX_ENABLE_HELP 10339 +#define ID_CHECKBOX_DISABLE_HELP 10340 +#define ID_CHECKBOX_TOGGLE_HELP 10341 + +#define ID_BUTTON_CHECK_PROJECT 10342 + +#define ID_MENU_OPEN_RECENT1 10343 +#define ID_MENU_OPEN_RECENT2 10344 +#define ID_MENU_OPEN_RECENT3 10345 +#define ID_MENU_OPEN_RECENT4 10346 +#define ID_MENU_OPEN_RECENT5 10347 #endif /* CREADEVMANAGERIDS_H_ */ diff --git a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp index ac06179..9f81851 100644 --- a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp @@ -158,6 +158,11 @@ void wxCDMAppliDescriptionPanel::CreateControls() //help icon wxButton* pApplicationHlp = new wxButton(propertiesPanel, wxID_ANY, wxT("?"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); + pApplicationHlp->Enable(false); + tt = "When this application is included in the CMakeLists file, the\nfollowing line is included in the CMakeList.txt file in the\nappli folder:\n" + "ADD_SUBDIRECTORY(" + applications[i]->GetName() + ")"; + pApplicationHlp->SetToolTip(crea::std2wx(tt)); + propertiesGridSizer -> Add(pApplicationHlp, 0, wxEXPAND | wxALIGN_CENTER); } diff --git a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp index 9f91b85..70a45fa 100644 --- a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp @@ -191,7 +191,14 @@ void wxCDMApplicationDescriptionPanel::CreateControls() wxCheckBox* ChBIncl = new wxCheckBox( includesPanel, 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 application.")); + ChBIncl->SetToolTip(crea::std2wx( + "When this box is checked the " + it->first + " library\n" + "is included in the project configuration for\n" + "this application including the following instruction\n" + "in the application's folder CMakeLists.txt file:\n" + "SET ( ${LIBRARY_NAME}_LINK_LIBRARIES\n" + " ${" + it->first+ "_LIBRARIES}\n" + ")")); ChBIncl->SetName(crea::std2wx(it->first)); ChBIncl->SetValue(it->second); includesGridSizer->Add(ChBIncl, 1, wxEXPAND); @@ -240,7 +247,17 @@ void wxCDMApplicationDescriptionPanel::CreateControls() wxCheckBox* ChBIncl = new wxCheckBox( includesPanel, 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 application.")); + ChBIncl->SetToolTip(crea::std2wx( + "When this box is checked the " + it->first + " custom\n" + "library is included in the project configuration for\n" + "this application including the following code in the\n" + "application's folder CMakeLists.txt file:\n" + "INCLUDE_DIRECTORIES (\n" + " ../../lib/"+ it->first + "\n" + ")\n" + "SET ( ${EXE_NAME}_LINK_LIBRARIES\n" + " " + it->first+ "\n" + ")")); ChBIncl->SetName(crea::std2wx(it->first)); ChBIncl->SetValue(it->second); includesLibGridSizer->Add(ChBIncl, 1, wxEXPAND); diff --git a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp index 5a71470..4dec780 100644 --- a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp @@ -156,6 +156,11 @@ void wxCDMLibDescriptionPanel::CreateControls() //help icon wxButton* pLibraryHlp = new wxButton(propertiesPanel, wxID_ANY, wxT("?"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); + pLibraryHlp->Enable(false); + tt = "When this library is included in the CMakeLists file, the\nfollowing line is included in the CMakeList.txt file in the lib\nfolder:\n" + "ADD_SUBDIRECTORY(" + libraries[i]->GetName() + ")"; + pLibraryHlp->SetToolTip(crea::std2wx(tt)); + propertiesGridSizer -> Add(pLibraryHlp, 0, wxEXPAND | wxALIGN_CENTER); } diff --git a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp index d97d019..53472bb 100644 --- a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp @@ -192,7 +192,14 @@ void wxCDMLibraryDescriptionPanel::CreateControls() wxCheckBox* ChBIncl = new wxCheckBox( includesPanel, 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->SetToolTip(crea::std2wx( + "When this box is checked the " + it->first + " library\n" + "is included in the project configuration for\n" + "this library including the following instruction\n" + "in the library's folder CMakeLists.txt file:\n" + "SET ( ${LIBRARY_NAME}_LINK_LIBRARIES\n" + " ${" + it->first+ "_LIBRARIES}\n" + ")")); ChBIncl->SetName(crea::std2wx(it->first)); ChBIncl->SetValue(it->second); includesGridSizer->Add(ChBIncl, 1, wxEXPAND); @@ -241,7 +248,17 @@ void wxCDMLibraryDescriptionPanel::CreateControls() wxCheckBox* ChBIncl = new wxCheckBox( includesPanel, 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->SetToolTip(crea::std2wx( + "When this box is checked the " + it->first + " custom\n" + "library is included in the project configuration for\n" + "this library including the following code in the\n" + "library's CMakeLists.txt file:\n" + "INCLUDE_DIRECTORIES (\n" + " ../"+ it->first + "\n" + ")\n" + "SET ( ${LIBRARY_NAME}_LINK_LIBRARIES\n" + " " + it->first+ "\n" + ")")); ChBIncl->SetName(crea::std2wx(it->first)); ChBIncl->SetValue(it->second); includesLibGridSizer->Add(ChBIncl, 1, wxEXPAND); diff --git a/lib/creaDevManagerLib/wxCDMMainFrame.cpp b/lib/creaDevManagerLib/wxCDMMainFrame.cpp index eb0a2d4..3b64a1e 100755 --- a/lib/creaDevManagerLib/wxCDMMainFrame.cpp +++ b/lib/creaDevManagerLib/wxCDMMainFrame.cpp @@ -282,7 +282,7 @@ void wxCDMMainFrame::CreateControls() ); auiManager.AddPane(panel_Properties, wxAuiPaneInfo().BestSize(600,400).CenterPane().Name(wxT("panel_Properties")).Caption(wxT("")).CloseButton(false)); - auiManager.AddPane(tree_Projects, wxAuiPaneInfo().Left().MinSize(300,300).BestSize(300,400).CloseButton(false).Name(wxT("tree_Projects")).Caption(wxT("Project Tree")).CloseButton(false)); + auiManager.AddPane(tree_Projects, wxAuiPaneInfo().Left().MinSize(250,300).BestSize(250,400).CloseButton(false).Name(wxT("tree_Projects")).Caption(wxT("Project Tree")).CloseButton(false)); auiManager.Update(); //auiManager.LoadPerspective(pers,true); wxToolTip::Enable(true); diff --git a/lib/creaDevManagerLib/wxCDMPackageConfigurationDialog.cpp b/lib/creaDevManagerLib/wxCDMPackageConfigurationDialog.cpp index 839131c..e88415b 100644 --- a/lib/creaDevManagerLib/wxCDMPackageConfigurationDialog.cpp +++ b/lib/creaDevManagerLib/wxCDMPackageConfigurationDialog.cpp @@ -128,7 +128,13 @@ void wxCDMPackageConfigurationDialog::CreateControls() wxCheckBox* ChBIncl = new wxCheckBox( includesPanel, 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->SetToolTip(crea::std2wx( + "When this box is checked the " + it->first + " library\n" + "is included in the project configuration for\n" + "this package including the following instruction\n" + "in the package's folder CMakeLists.txt file:\n" + "SET(${BBTK_PACKAGE_NAME}_USE_" + it->first+ " ON)\n" + )); ChBIncl->SetName(crea::std2wx(it->first)); ChBIncl->SetValue(it->second); includesGridSizer->Add(ChBIncl, 1, wxEXPAND); @@ -177,7 +183,17 @@ void wxCDMPackageConfigurationDialog::CreateControls() wxCheckBox* ChBIncl = new wxCheckBox( includesPanel, 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->SetToolTip(crea::std2wx( + "When this box is checked the " + it->first + " custom\n" + "library is included in the project configuration for\n" + "this packages including the following code in the\n" + "package's folder CMakeLists.txt file:\n" + "SET(${BBTK_PACKAGE_NAME}_INCLUDE_DIRS\n" + " ../lib/"+ it->first + "\n" + ")\n" + "SET(${BBTK_PACKAGE_NAME}_LIBS\n" + " " + it->first+ "\n" + ")")); ChBIncl->SetName(crea::std2wx(it->first)); ChBIncl->SetValue(it->second); includesLibGridSizer->Add(ChBIncl, 1, wxEXPAND); diff --git a/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp b/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp index c7d0d77..d7a28be 100644 --- a/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMPackageManagerPanel.cpp @@ -149,6 +149,11 @@ void wxCDMPackageManagerPanel::CreateControls() //help icon wxButton* pPackageHlp = new wxButton(propertiesPanel, wxID_ANY, wxT("?"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); + pPackageHlp->Enable(false); + tt = "When this package is included in the CMakeLists file, the\nfollowing line is included in the CMakeList.txt file in the\nproject folder:\n" + "ADD_SUBDIRECTORY(" + packages[i]->GetName() + ")"; + pPackageHlp->SetToolTip(crea::std2wx(tt)); + propertiesGridSizer -> Add(pPackageHlp, 0, wxEXPAND | wxALIGN_CENTER); } diff --git a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp index 844d8cb..920408c 100644 --- a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp @@ -49,6 +49,7 @@ EVT_BUTTON(ID_BUTTON_GOTO_LIB_MANAGER, wxCDMProjectDescriptionPanel::OnBtnManage EVT_BUTTON(ID_BUTTON_GOTO_APPLI_MANAGER, wxCDMProjectDescriptionPanel::OnBtnManageApplications) EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists) EVT_BUTTON(ID_BUTTON_SET_BUILD_PATH, wxCDMProjectDescriptionPanel::OnBtnSetBuildPath) +EVT_BUTTON(ID_BUTTON_OPEN_BUILD_PATH, wxCDMProjectDescriptionPanel::OnBtnOpenBuild) EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMProjectDescriptionPanel::OnBtnOpenFolder) EVT_BUTTON(ID_BUTTON_SET_VERSION, wxCDMProjectDescriptionPanel::OnBtnSetVersion) END_EVENT_TABLE() @@ -147,10 +148,16 @@ void wxCDMProjectDescriptionPanel::CreateControls() wxBoxSizer* pBuildLocationsz = new wxBoxSizer(wxHORIZONTAL); this->buildPathtc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetBuildPath())); this->buildPathtc->SetMaxSize(wxSize(200,-1)); - wxButton* pBuildLocationbt = new wxButton(propertiesPanel, ID_BUTTON_SET_BUILD_PATH, wxT("Choose")); + + wxButton* pBuildLocationbt = new wxButton(propertiesPanel, ID_BUTTON_SET_BUILD_PATH, wxT("Choose...")); pBuildLocationbt->SetToolTip(wxT("Select a new location for compiling the project.")); + + wxButton* pBuildOpenbt = new wxButton(propertiesPanel, ID_BUTTON_OPEN_BUILD_PATH, wxT("Open")); + pBuildOpenbt->SetToolTip(wxT("Open the binaries folder in the file explorer.")); + pBuildLocationsz->Add(this->buildPathtc, 1, wxALIGN_CENTER, 1); pBuildLocationsz->Add(pBuildLocationbt, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10); + pBuildLocationsz->Add(pBuildOpenbt, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10); propertiesGridSizer->Add(pVersion, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); propertiesGridSizer->Add(pVersionsz, 1, wxEXPAND); @@ -306,8 +313,7 @@ void wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) } } -void -wxCDMProjectDescriptionPanel::OnBtnSetBuildPath(wxCommandEvent& event) +void wxCDMProjectDescriptionPanel::OnBtnSetBuildPath(wxCommandEvent& event) { wxDirDialog* dialog = new wxDirDialog(this, wxT("Choose the new build location for the project")); if(dialog->ShowModal()) @@ -319,8 +325,14 @@ wxCDMProjectDescriptionPanel::OnBtnSetBuildPath(wxCommandEvent& event) this->buildPathtc->SetLabel(crea::std2wx(this->project->GetBuildPath())); } -void -wxCDMProjectDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event) +void wxCDMProjectDescriptionPanel::OnBtnOpenBuild(wxCommandEvent& event) +{ + std::string* result; + if(CDMUtilities::openFileExplorer(this->project->GetBuildPath())) + wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR); +} + +void wxCDMProjectDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event) { std::string* result; if(!this->project->OpenInFileExplorer(result)) diff --git a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.h index 74a71d7..d210e32 100644 --- a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.h @@ -144,6 +144,10 @@ protected: * Handles when the choose build path button is pressed. */ void OnBtnSetBuildPath(wxCommandEvent& event); + /** + * Handles when the open build folder button is pressed. + */ + void OnBtnOpenBuild(wxCommandEvent& event); /** * Handles when the open containing folder button is pressed. */ -- 2.45.0