From: Daniel Gonzalez Date: Tue, 11 Dec 2012 15:19:54 +0000 (+0100) Subject: Feature #1711 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=ae979655a8f5e455fb8381c2cbf081ac0ec18132;p=crea.git Feature #1711 CreaDevManager application implementation - Fixing up tooltips and flow control with libraries and applications - Fixed bug in Lib, Appli, Library, Application Description views for tooltips. Still presented in Package manager and Black Box Description views. --- diff --git a/lib/creaDevManagerLib/modelCDMApplication.cpp b/lib/creaDevManagerLib/modelCDMApplication.cpp index a816a96..17a660a 100644 --- a/lib/creaDevManagerLib/modelCDMApplication.cpp +++ b/lib/creaDevManagerLib/modelCDMApplication.cpp @@ -49,7 +49,7 @@ modelCDMApplication::modelCDMApplication(const std::string& path, const int& lev //TODO::fix for windows delimiters = "/"; CDMUtilities::splitter::split(words, path, delimiters, CDMUtilities::splitter::no_empties); - this->name = words[words.size()-1]; + this->name = this->nameApplication = words[words.size()-1]; this->path = path; this->type = wxDIR_DIRS; diff --git a/lib/creaDevManagerLib/modelCDMLibrary.cpp b/lib/creaDevManagerLib/modelCDMLibrary.cpp index cfd0411..66f8ee4 100644 --- a/lib/creaDevManagerLib/modelCDMLibrary.cpp +++ b/lib/creaDevManagerLib/modelCDMLibrary.cpp @@ -49,7 +49,7 @@ modelCDMLibrary::modelCDMLibrary(const std::string& path, const int& level) //TODO::fix for windows delimiters = "/"; CDMUtilities::splitter::split(words, path, delimiters, CDMUtilities::splitter::no_empties); - this->name = words[words.size()-1]; + this->name = this->nameLibrary = words[words.size()-1]; this->path = path; this->type = wxDIR_DIRS; diff --git a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp index 249ddfe..778525f 100644 --- a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp @@ -44,6 +44,7 @@ EVT_BUTTON(ID_BUTTON_PREV, wxCDMAppliDescriptionPanel::OnBtnReturn) EVT_HYPERLINK(ID_LINK_SELECT_APPLICATION, wxCDMAppliDescriptionPanel::OnLnkApplicationSelect) EVT_BUTTON(ID_BUTTON_CREATE_APPLICATION, wxCDMAppliDescriptionPanel::OnBtnCreateApplication) EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMAppliDescriptionPanel::OnBtnEditCMakeLists) +EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMAppliDescriptionPanel::OnBtnOpenFolder) END_EVENT_TABLE() wxCDMAppliDescriptionPanel::wxCDMAppliDescriptionPanel( @@ -89,39 +90,54 @@ void wxCDMAppliDescriptionPanel::CreateControls() sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5); //Title - sizer->Add(new wxStaticText(this, -1, _("Applications")),0, wxALIGN_CENTER, 0); + sizer->Add(new wxStaticText(this, -1, _("Application Management")),0, wxALIGN_CENTER, 0); //Image sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(ApIcon64)),0, wxALIGN_CENTER, 0); //Applications - wxStaticBox* propertiesBox = new wxStaticBox(this, -1, _T("&Available Applications")); - wxStaticBoxSizer* propertiesBoxInnerSizer = new wxStaticBoxSizer(propertiesBox, wxVERTICAL); + wxStaticBoxSizer* propertiesBox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("A&vailable Applications")); + propertiesBox->GetStaticBox()->SetToolTip(wxT("Select any of the available applications to see its details or the modify them.")); + wxPanel* propertiesPanel = new wxPanel(this); + wxBoxSizer* propertiesPanelSizer = new wxBoxSizer(wxVERTICAL); std::vector applications = this->appli->GetApplications(); for (int i = 0; i < applications.size(); i++) { - wxHyperlinkCtrl* pLibrarylk = new wxHyperlinkCtrl(this,ID_LINK_SELECT_APPLICATION, crea::std2wx(applications[i]->GetName().c_str()), crea::std2wx(applications[i]->GetName().c_str())); - propertiesBoxInnerSizer -> Add(pLibrarylk, 0, wxALIGN_LEFT | wxALL, 5); + wxHyperlinkCtrl* pLibrarylk = new wxHyperlinkCtrl(propertiesPanel,ID_LINK_SELECT_APPLICATION, crea::std2wx(applications[i]->GetName().c_str()), crea::std2wx(applications[i]->GetName().c_str())); + std::string tt = "Name: " + applications[i]->GetName() + "\n"; + tt += "Location: " + applications[i]->GetPath(); + pLibrarylk->SetToolTip(crea::std2wx(tt.c_str())); + propertiesPanelSizer -> Add(pLibrarylk, 0, wxALIGN_LEFT | wxALL, 5); } - sizer -> Add(propertiesBoxInnerSizer, 0, wxEXPAND | wxALL, 10); + propertiesPanel->SetSizer(propertiesPanelSizer); + propertiesPanelSizer->Fit(propertiesPanel); + propertiesBox->Add(propertiesPanel, 0, wxALL, 5); + sizer -> Add(propertiesBox, 0, wxEXPAND | wxALL, 10); //Actions - wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions")); - wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL); - sizer -> Add(actionsBoxInnerSizer, 1, wxEXPAND | wxALL, 20); + wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Actions")); + actionsBox->GetStaticBox()->SetToolTip(wxT("Create a new application or make any change to the appli's CMakeLists.txt file by selecting the desired action.")); + wxPanel* actionsPanel = new wxPanel(this); + wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL); - wxButton* createApplicationbt = new wxButton(this, ID_BUTTON_CREATE_APPLICATION, _T("Create Application")); + wxButton* createApplicationbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_APPLICATION, _T("Create Application")); createApplicationbt->SetToolTip(wxT("Create a new application for this project.")); - actionsBoxInnerSizer->Add(createApplicationbt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20); - wxButton* editCMakebt = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")); + actionsPanelSizer->Add(createApplicationbt, 0, wxALL, 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 CMakeLists.txt file.")); - actionsBoxInnerSizer->Add(editCMakebt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20); + actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5); + wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Applications Folder")); + openFolderbt->SetToolTip(wxT("Open the appli folder in the file explorer.")); + actionsPanelSizer->Add(openFolderbt, 0, wxALL, 5); - //Assign sizer - actionsBoxInnerSizer->SetSizeHints(this); + actionsPanel->SetSizer(actionsPanelSizer); + actionsPanelSizer->Fit(actionsPanel); + actionsBox->Add(actionsPanel, 0, wxALL, 5); + sizer -> Add(actionsBox, 0, wxEXPAND | wxALL, 10); + //Assign sizer SetSizer(sizer); sizer->SetSizeHints(this); } @@ -194,3 +210,11 @@ void wxCDMAppliDescriptionPanel::OnBtnReturn(wxCommandEvent& event) newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } + +void +wxCDMAppliDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event) +{ + //TODO: implement method + std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl; + event.Skip(); +} diff --git a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.h index b77b3fd..01d4c78 100644 --- a/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.h @@ -78,6 +78,7 @@ protected: void OnBtnEditCMakeLists(wxCommandEvent& event); void OnLnkApplicationSelect(wxHyperlinkEvent& event); void OnBtnReturn(wxCommandEvent& event); + void OnBtnOpenFolder(wxCommandEvent& event); }; diff --git a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp index 3e931b1..03142d0 100644 --- a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.cpp @@ -34,13 +34,17 @@ #include "wxCDMApplicationDescriptionPanel.h" +#include "wxCDMMainFrame.h" + #include "creaDevManagerIds.h" #include "images/AIcon64.xpm" BEGIN_EVENT_TABLE(wxCDMApplicationDescriptionPanel, wxPanel) +EVT_BUTTON(ID_BUTTON_PREV, wxCDMApplicationDescriptionPanel::OnBtnReturn) EVT_BUTTON(ID_BUTTON_CREATE_CLASS, wxCDMApplicationDescriptionPanel::OnBtnCreateClass) EVT_BUTTON(ID_BUTTON_CREATE_FOLDER, wxCDMApplicationDescriptionPanel::OnBtnCreateFolder) EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMApplicationDescriptionPanel::OnBtnEditCMakeLists) +EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMApplicationDescriptionPanel::OnBtnOpenFolder) END_EVENT_TABLE() wxCDMApplicationDescriptionPanel::wxCDMApplicationDescriptionPanel( @@ -80,6 +84,11 @@ void wxCDMApplicationDescriptionPanel::CreateControls() { wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); + //Link to return + wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project")); + returnbt->SetToolTip(wxT("Return to the active project description.")); + sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5); + //Welcome sizer->Add(new wxStaticText(this, -1, _("Application")),0, wxALIGN_CENTER, 0); @@ -90,44 +99,74 @@ void wxCDMApplicationDescriptionPanel::CreateControls() sizer->Add(new wxStaticText(this, -1, crea::std2wx(this->application->GetNameApplication())),0, wxALIGN_CENTER, 0); //Project Properties - wxStaticBox* propertiesBox = new wxStaticBox(this, -1, _T("&Properties")); - wxStaticBoxSizer* propertiesBoxInnerSizer = new wxStaticBoxSizer(propertiesBox, wxVERTICAL); + wxStaticBoxSizer* propertiesBox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Properties")); + wxPanel* propertiesPanel = new wxPanel(this); + wxBoxSizer* propertiesPanelSizer = new wxBoxSizer(wxVERTICAL); - wxFlexGridSizer* flexGridSizer = new wxFlexGridSizer(4, 2, 9, 15); + wxFlexGridSizer* propertiesGridSizer = new wxFlexGridSizer(4, 2, 9, 15); - wxStaticText *pMainFile = new wxStaticText(this, -1, wxT("Main File")); + wxStaticText *pMainFile = new wxStaticText(propertiesPanel, -1, wxT("Main File")); + wxBoxSizer* pMainFilesz = new wxBoxSizer(wxHORIZONTAL); + wxStaticText* pMainFiletc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(this->application->GetMainFile())); + wxButton* pMainFilebt = new wxButton(propertiesPanel, ID_BUTTON_SET_VERSION, wxT("Choose")); + pMainFilebt->SetToolTip(wxT("Choose the main file for the application.")); + pMainFilesz->Add(pMainFiletc, 0, wxALIGN_CENTER_VERTICAL, 0); + pMainFilesz->Add(pMainFilebt, 0, wxALIGN_CENTER | wxLEFT, 10); - wxTextCtrl *pMainFiletc = new wxTextCtrl(this, -1, crea::std2wx(this->application->GetMainFile())); + propertiesGridSizer->Add(pMainFile, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + propertiesGridSizer->Add(pMainFilesz, 1, wxEXPAND); - flexGridSizer->Add(pMainFile, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - flexGridSizer->Add(pMainFiletc, 1, wxEXPAND); + propertiesGridSizer->AddGrowableCol(1,1); - propertiesBoxInnerSizer -> Add(flexGridSizer, 0, wxEXPAND); - sizer -> Add(propertiesBoxInnerSizer, 1, wxEXPAND | wxALL, 20); + propertiesPanelSizer->Add(propertiesGridSizer, 0, wxEXPAND); + propertiesPanel->SetSizer(propertiesPanelSizer); + propertiesPanelSizer->Fit(propertiesPanel); + propertiesBox->Add(propertiesPanel, 0, wxEXPAND); + sizer->Add(propertiesBox, 0, wxEXPAND | wxALL, 10); //Actions - wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions")); - wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL); - sizer -> Add(actionsBoxInnerSizer, 1, wxEXPAND | wxALL, 20); - - wxButton* createClassbt = new wxButton(this, ID_BUTTON_CREATE_CLASS, _T("Create Class")); + //actions StaticBoxSizer + wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Actions")); + actionsBox->GetStaticBox()->SetToolTip(wxT("Create classes or edit them for this application, as well as editing the application's CMakeLists.txt file by selecting the desired action.")); + //actions Panel + wxPanel* actionsPanel = new wxPanel(this); + //actions Sizer + wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL); + + 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(this, ID_BUTTON_CREATE_FOLDER, _T("Create Folder")); + wxButton* createFolderbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_FOLDER, _T("Create Folder")); createFolderbt->SetToolTip(wxT("Create a new Folder inside the application folder.")); - wxButton* editCMakebt = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("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.")); + wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Application Folder")); + openFolderbt->SetToolTip(wxT("Open the application folder in the file explorer.")); - actionsBoxInnerSizer->Add(createClassbt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20); - actionsBoxInnerSizer->Add(createFolderbt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20); - actionsBoxInnerSizer->Add(editCMakebt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20); - //Assign sizer - actionsBoxInnerSizer->SetSizeHints(this); + actionsPanelSizer->Add(createClassbt, 0, wxALL, 5); + actionsPanelSizer->Add(createFolderbt, 0, wxALL, 5); + actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5); + actionsPanelSizer->Add(openFolderbt, 0, wxALL, 5); + //SetPanel sizer and box + actionsPanel->SetSizer(actionsPanelSizer); + actionsPanelSizer->Fit(actionsPanel); + actionsBox->Add(actionsPanel, 0, wxALL, 5); + sizer->Add(actionsBox, 0, wxEXPAND | wxALL, 10); + + //Assign sizer SetSizer(sizer); sizer->SetSizeHints(this); } +void wxCDMApplicationDescriptionPanel::OnBtnReturn(wxCommandEvent& event) +{ + wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); + newEvent->SetInt(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetId()); + newEvent->SetId(0); + wxPostEvent(this->GetParent(), *newEvent); +} + void wxCDMApplicationDescriptionPanel::OnBtnCreateClass(wxCommandEvent& event) { //TODO: implement method @@ -148,3 +187,10 @@ void wxCDMApplicationDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl; event.Skip(); } + +void wxCDMApplicationDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event) +{ + //TODO: implement method + std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl; + event.Skip(); +} diff --git a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.h index c827fbd..7611d5b 100644 --- a/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMApplicationDescriptionPanel.h @@ -73,9 +73,11 @@ private: //handlers protected: + void OnBtnReturn(wxCommandEvent& event); void OnBtnCreateClass(wxCommandEvent& event); void OnBtnCreateFolder(wxCommandEvent& event); void OnBtnEditCMakeLists(wxCommandEvent& event); + void OnBtnOpenFolder(wxCommandEvent& event); }; diff --git a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp index f630190..e7b1379 100644 --- a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.cpp @@ -44,6 +44,7 @@ EVT_BUTTON(ID_BUTTON_PREV, wxCDMLibDescriptionPanel::OnBtnReturn) EVT_HYPERLINK(ID_LINK_SELECT_LIBRARY, wxCDMLibDescriptionPanel::OnLnkLibrarySelect) EVT_BUTTON(ID_BUTTON_CREATE_LIBRARY, wxCDMLibDescriptionPanel::OnBtnCreateLibrary) EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMLibDescriptionPanel::OnBtnEditCMakeLists) +EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMLibDescriptionPanel::OnBtnOpenFolder) END_EVENT_TABLE() wxCDMLibDescriptionPanel::wxCDMLibDescriptionPanel( @@ -95,33 +96,48 @@ void wxCDMLibDescriptionPanel::CreateControls() sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(LbIcon64)),0, wxALIGN_CENTER, 0); //Libraries - wxStaticBox* propertiesBox = new wxStaticBox(this, -1, _T("&Available Libraries")); - wxStaticBoxSizer* propertiesBoxInnerSizer = new wxStaticBoxSizer(propertiesBox, wxVERTICAL); + wxStaticBoxSizer* propertiesBox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("A&vailable Libraries")); + propertiesBox->GetStaticBox()->SetToolTip(wxT("Select any of the available libraries to see its details or the modify them.")); + wxPanel* propertiesPanel = new wxPanel(this); + wxBoxSizer* propertiesPanelSizer = new wxBoxSizer(wxVERTICAL); std::vector libraries = this->lib->GetLibraries(); for (int i = 0; i < libraries.size(); i++) { - wxHyperlinkCtrl* pLibrarylk = new wxHyperlinkCtrl(this,ID_LINK_SELECT_LIBRARY, crea::std2wx(libraries[i]->GetName().c_str()), crea::std2wx(libraries[i]->GetName().c_str())); - propertiesBoxInnerSizer -> Add(pLibrarylk, 0, wxALIGN_LEFT | wxALL, 5); + wxHyperlinkCtrl* pLibrarylk = new wxHyperlinkCtrl(propertiesPanel, ID_LINK_SELECT_LIBRARY, crea::std2wx(libraries[i]->GetName().c_str()), crea::std2wx(libraries[i]->GetName().c_str())); + std::string tt = "Name: " + libraries[i]->GetName() + "\n"; + tt += "Location: " + libraries[i]->GetPath(); + pLibrarylk->SetToolTip(crea::std2wx(tt.c_str())); + propertiesPanelSizer -> Add(pLibrarylk, 0, wxALIGN_LEFT | wxALL, 5); } - sizer -> Add(propertiesBoxInnerSizer, 0, wxEXPAND | wxALL, 10); + propertiesPanel->SetSizer(propertiesPanelSizer); + propertiesPanelSizer->Fit(propertiesPanel); + propertiesBox->Add(propertiesPanel, 0, wxALL, 5); + sizer -> Add(propertiesBox, 0, wxEXPAND | wxALL, 10); //Actions - wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions")); - wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL); - sizer -> Add(actionsBoxInnerSizer, 1, wxEXPAND | wxALL, 20); + wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Actions")); + actionsBox->GetStaticBox()->SetToolTip(wxT("Create a new library or make any change to the lib's CMakeLists.txt file by selecting the desired action.")); + wxPanel* actionsPanel = new wxPanel(this); + wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL); - wxButton* createLibrarybt = new wxButton(this, ID_BUTTON_CREATE_LIBRARY, _T("Create Library")); + wxButton* createLibrarybt = new wxButton(actionsPanel, ID_BUTTON_CREATE_LIBRARY, _T("Create Library")); createLibrarybt->SetToolTip(wxT("Create a new library for this project.")); - actionsBoxInnerSizer->Add(createLibrarybt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20); - wxButton* editCMakebt = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")); + actionsPanelSizer->Add(createLibrarybt, 0, wxALL, 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 CMakeLists.txt file.")); - actionsBoxInnerSizer->Add(editCMakebt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20); + actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5); + wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Libraries Folder")); + openFolderbt->SetToolTip(wxT("Open the lib folder in the file explorer.")); + actionsPanelSizer->Add(openFolderbt, 0, wxALL, 5); - //Assign sizer - actionsBoxInnerSizer->SetSizeHints(this); + actionsPanel->SetSizer(actionsPanelSizer); + actionsPanelSizer->Fit(actionsPanel); + actionsBox->Add(actionsPanel, 0, wxALL, 5); + sizer -> Add(actionsBox, 0, wxEXPAND | wxALL, 10); + //Assign sizer SetSizer(sizer); sizer->SetSizeHints(this); } @@ -193,3 +209,11 @@ void wxCDMLibDescriptionPanel::OnBtnReturn(wxCommandEvent& event) newEvent->SetId(0); wxPostEvent(this->GetParent(), *newEvent); } + +void +wxCDMLibDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event) +{ + //TODO: implement method + std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl; + event.Skip(); +} diff --git a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.h index 039ca73..b059a5c 100644 --- a/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMLibDescriptionPanel.h @@ -78,6 +78,7 @@ protected: void OnBtnEditCMakeLists(wxCommandEvent& event); void OnLnkLibrarySelect(wxHyperlinkEvent& event); void OnBtnReturn(wxCommandEvent& event); + void OnBtnOpenFolder(wxCommandEvent& event); }; diff --git a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp index ac47c51..38c67cc 100644 --- a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.cpp @@ -34,13 +34,17 @@ #include "wxCDMLibraryDescriptionPanel.h" +#include "wxCDMMainFrame.h" + #include "creaDevManagerIds.h" #include "images/LIcon64.xpm" BEGIN_EVENT_TABLE(wxCDMLibraryDescriptionPanel, wxPanel) +EVT_BUTTON(ID_BUTTON_PREV, wxCDMLibraryDescriptionPanel::OnBtnReturn) EVT_BUTTON(ID_BUTTON_CREATE_CLASS, wxCDMLibraryDescriptionPanel::OnBtnCreateClass) EVT_BUTTON(ID_BUTTON_CREATE_FOLDER, wxCDMLibraryDescriptionPanel::OnBtnCreateFolder) EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMLibraryDescriptionPanel::OnBtnEditCMakeLists) +EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMLibraryDescriptionPanel::OnBtnOpenFolder) END_EVENT_TABLE() wxCDMLibraryDescriptionPanel::wxCDMLibraryDescriptionPanel( @@ -80,7 +84,12 @@ void wxCDMLibraryDescriptionPanel::CreateControls() { wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); - //Welcome + //Link to return + wxButton* returnbt = new wxButton(this, ID_BUTTON_PREV, wxT("Return to project")); + returnbt->SetToolTip(wxT("Return to the active project description.")); + sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5); + + //Title sizer->Add(new wxStaticText(this, -1, _("Library")),0, wxALIGN_CENTER, 0); //Image @@ -90,22 +99,41 @@ void wxCDMLibraryDescriptionPanel::CreateControls() sizer->Add(new wxStaticText(this, -1, crea::std2wx(this->library->GetNameLibrary())),0, wxALIGN_CENTER, 0); //Actions - wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions")); - wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL); - sizer -> Add(actionsBoxInnerSizer, 1, wxEXPAND | wxALL, 20); - - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_CLASS, _T("Create Class")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20); - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_CREATE_FOLDER, _T("Create Folder")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20); - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File")), 0, wxEXPAND | wxRIGHT | wxLEFT, 20); - + wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxHORIZONTAL, this, wxT("&Actions")); + wxPanel* actionsPanel = new wxPanel(this); + wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL); + + wxButton* createClassbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_CLASS, _T("Create Class")); + createClassbt->SetToolTip(wxT("Create a new class for this library.")); + actionsPanelSizer->Add(createClassbt, 0, wxALL, 5); + wxButton* createFolderbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_FOLDER, _T("Create Folder")); + createFolderbt->SetToolTip(wxT("Create a new folder for this library.")); + actionsPanelSizer->Add(createFolderbt, 0, wxALL, 5); + 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.")); + actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5); + wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Library Folder")); + openFolderbt->SetToolTip(wxT("Open the library folder in the file explorer.")); + actionsPanelSizer->Add(openFolderbt, 0, wxALL, 5); + + actionsPanel->SetSizer(actionsPanelSizer); + actionsPanelSizer->Fit(actionsPanel); + actionsBox->Add(actionsPanel, 1, wxEXPAND); + sizer -> Add(actionsBox, 0, wxALL | wxEXPAND, 10); //Assign sizer - actionsBoxInnerSizer->SetSizeHints(this); - SetSizer(sizer); sizer->SetSizeHints(this); } +void wxCDMLibraryDescriptionPanel::OnBtnReturn(wxCommandEvent& event) +{ + wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); + newEvent->SetInt(((wxCDMMainFrame*)this->GetParent())->GetModel()->GetProject()->GetId()); + newEvent->SetId(0); + wxPostEvent(this->GetParent(), *newEvent); +} + void wxCDMLibraryDescriptionPanel::OnBtnCreateClass(wxCommandEvent& event) { //TODO: implement method @@ -126,3 +154,11 @@ void wxCDMLibraryDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl; event.Skip(); } + +void +wxCDMLibraryDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event) +{ + //TODO: implement method + std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl; + event.Skip(); +} diff --git a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.h index 1b45877..8ae6abd 100644 --- a/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMLibraryDescriptionPanel.h @@ -73,9 +73,11 @@ private: //handlers protected: + void OnBtnReturn(wxCommandEvent& event); void OnBtnCreateClass(wxCommandEvent& event); void OnBtnCreateFolder(wxCommandEvent& event); void OnBtnEditCMakeLists(wxCommandEvent& event); + void OnBtnOpenFolder(wxCommandEvent& event); }; diff --git a/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.cpp index 63b45c5..bb2c3eb 100644 --- a/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMMainDescriptionPanel.cpp @@ -87,12 +87,22 @@ void wxCDMMainDescriptionPanel::CreateControls() sizer->Add(new wxStaticText(this, -1, _("Crea Development Manager")),0, wxALIGN_CENTER, 0); //Actions - wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions")); - wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL); - sizer -> Add(actionsBoxInnerSizer, 2, wxEXPAND | wxALL, 20); - - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_NEWPROJECT, _T("New Project")), 0, wxRIGHT | wxLEFT, 20); - actionsBoxInnerSizer->Add(new wxButton(this, ID_BUTTON_OPENPROJECT, _T("Open Project")), 0, wxRIGHT | wxLEFT, 20); + wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Actions")); + actionsBox->GetStaticBox()->SetToolTip(wxT("Create a new crea project or open an existing one selection any of the available actions.")); + wxPanel* actionsPanel = new wxPanel(this); + wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL); + + wxButton* newProjectbt = new wxButton(actionsPanel, ID_BUTTON_NEWPROJECT, _T("New Project")); + newProjectbt->SetToolTip(wxT("Create a new crea project")); + actionsPanelSizer->Add(newProjectbt, 0, wxRIGHT | wxLEFT, 20); + wxButton* openProjectbt = new wxButton(actionsPanel, ID_BUTTON_OPENPROJECT, _T("Open Project")); + openProjectbt->SetToolTip(wxT("Open an existing crea project")); + actionsPanelSizer->Add(openProjectbt, 0, wxRIGHT | wxLEFT, 20); + + actionsPanel->SetSizer(actionsPanelSizer); + actionsPanelSizer->Fit(actionsPanel); + actionsBox->Add(actionsPanel, 0, wxALIGN_CENTER | wxALL, 10); + sizer -> Add(actionsBox, 0, wxEXPAND | wxALL, 20); //Asign sizer sizer->SetSizeHints(this); @@ -101,13 +111,11 @@ void wxCDMMainDescriptionPanel::CreateControls() void wxCDMMainDescriptionPanel::OnBtnNewProject(wxCommandEvent& event) { - event.ResumePropagation(1); event.Skip(); } void wxCDMMainDescriptionPanel::OnBtnOpenProject(wxCommandEvent& event) { - event.ResumePropagation(1); event.Skip(); } diff --git a/lib/creaDevManagerLib/wxCDMMainFrame.cpp b/lib/creaDevManagerLib/wxCDMMainFrame.cpp index 1785342..7c2bf5a 100755 --- a/lib/creaDevManagerLib/wxCDMMainFrame.cpp +++ b/lib/creaDevManagerLib/wxCDMMainFrame.cpp @@ -279,6 +279,7 @@ void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event) { auiManager.DetachPane(this->panel_Properties); this->panel_Properties->Destroy(); + this->panel_Properties = NULL; } this->panel_Properties = new wxCDMProjectDescriptionPanel( @@ -294,6 +295,7 @@ void wxCDMMainFrame::OnMenuNewProject(wxCommandEvent& event) { auiManager.DetachPane(this->panel_Properties); this->panel_ProjectActions->Destroy(); + this->panel_ProjectActions = NULL; } panel_ProjectActions = new wxCDMProjectActionsPanel( @@ -366,6 +368,7 @@ void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event) { auiManager.DetachPane(this->panel_Properties); this->panel_Properties->Destroy(); + this->panel_Properties = NULL; } this->panel_Properties = new wxCDMProjectDescriptionPanel( @@ -383,6 +386,7 @@ void wxCDMMainFrame::OnMenuOpenProject(wxCommandEvent& event) { auiManager.DetachPane(this->panel_ProjectActions); this->panel_ProjectActions->Destroy(); + this->panel_ProjectActions = NULL; } panel_ProjectActions = new wxCDMProjectActionsPanel( this, @@ -424,11 +428,13 @@ void wxCDMMainFrame::OnMenuCloseProject(wxCommandEvent& event) { auiManager.DetachPane(this->panel_Properties); this->panel_Properties->Destroy(); + this->panel_Properties = NULL; } if(this->panel_ProjectActions != NULL) { auiManager.DetachPane(this->panel_ProjectActions); this->panel_ProjectActions->Destroy(); + this->panel_ProjectActions = NULL; } this->panel_Properties = new wxCDMMainDescriptionPanel( @@ -460,11 +466,13 @@ void wxCDMMainFrame::OnMenuCloseAllProjects(wxCommandEvent& event) { auiManager.DetachPane(this->panel_Properties); this->panel_Properties->Destroy(); + this->panel_Properties = NULL; } if(this->panel_ProjectActions != NULL) { auiManager.DetachPane(this->panel_ProjectActions); this->panel_ProjectActions->Destroy(); + this->panel_ProjectActions = NULL; } this->panel_Properties = new wxCDMMainDescriptionPanel( @@ -490,7 +498,7 @@ void wxCDMMainFrame::OnMenuExit(wxCommandEvent& event) { std::cout << "Closing CreaDevManager..." << std::endl; std::string* result; - if(!this->model->CloseProject(result)) + if(this->model->GetProject() != NULL && !this->model->CloseProject(result)) { std::cout << "error closing project: " << *result << std::endl; wxMessageBox( crea::std2wx(result->c_str()), wxT("Close Project - Error"), wxICON_ERROR); @@ -501,21 +509,16 @@ void wxCDMMainFrame::OnMenuExit(wxCommandEvent& event) { auiManager.DetachPane(this->panel_Properties); this->panel_Properties->Destroy(); + this->panel_Properties = NULL; } + if(this->panel_ProjectActions != NULL) { auiManager.DetachPane(this->panel_ProjectActions); this->panel_ProjectActions->Destroy(); + this->panel_ProjectActions = NULL; } - this->panel_Properties = new wxCDMMainDescriptionPanel( - this, - ID_WINDOW_PROPERTIES, - wxT("Description Panel"), - wxDefaultPosition, - wxSize(600, 400), - 0 - ); Close(); event.Skip(); } @@ -615,14 +618,6 @@ void wxCDMMainFrame::OnMenuAboutCreatis(wxCommandEvent& event) void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) { - std::cout << "New Tree Selection" << std::endl; - - if(event.GetId() != 0) - { - event.Skip(); - } - - //get selected element wxTreeItemId elementId = event.GetItem(); @@ -834,8 +829,9 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) //delete old view if(this->panel_Properties!= NULL) { - this->panel_Properties->Destroy(); auiManager.DetachPane(this->panel_Properties); + this->panel_Properties->Destroy(); + this->panel_Properties = NULL; } //set new view @@ -849,18 +845,17 @@ void wxCDMMainFrame::OnTreeSelectionChanged(wxTreeEvent& event) void wxCDMMainFrame::OnCreationComplete(wxCommandEvent& event) { - std::cout << "inMainFrame id: " << event.GetId() << ", tree element: "<< event.GetInt() << std::endl; switch(event.GetId() != 0) { case 0: //select out old one to generate selection event - this->tree_Projects->SelectItem(event.GetInt(), false); this->tree_Projects->SelectItem(event.GetInt(), true); break; case 1: wxPanel* description = NULL; if(event.GetString() == wxT("manage_packages")) { + this->tree_Projects->SelectItem(this->model->GetProject()->GetId(), false); description = new wxCDMPackageManagerPanel( this, this->model->GetProject(), @@ -873,13 +868,11 @@ void wxCDMMainFrame::OnCreationComplete(wxCommandEvent& event) } else if(event.GetString() == wxT("manage_libraries")) { - this->tree_Projects->SelectItem(this->model->GetProject()->GetLib()->GetId(), false); this->tree_Projects->SelectItem(this->model->GetProject()->GetLib()->GetId(), true); break; } else if(event.GetString() == wxT("manage_applications")) { - this->tree_Projects->SelectItem(this->model->GetProject()->GetAppli()->GetId(), false); this->tree_Projects->SelectItem(this->model->GetProject()->GetAppli()->GetId(), true); break; } @@ -893,8 +886,9 @@ void wxCDMMainFrame::OnCreationComplete(wxCommandEvent& event) //delete old view if(this->panel_Properties!= NULL) { - this->panel_Properties->Destroy(); auiManager.DetachPane(this->panel_Properties); + this->panel_Properties->Destroy(); + this->panel_Properties = NULL; } //set new view diff --git a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp index e293f8b..ecd4e89 100644 --- a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp +++ b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.cpp @@ -45,7 +45,9 @@ EVT_BUTTON(ID_BUTTON_GOTO_PACKAGE_MANAGER, wxCDMProjectDescriptionPanel::OnBtnMa EVT_BUTTON(ID_BUTTON_GOTO_LIB_MANAGER, wxCDMProjectDescriptionPanel::OnBtnManageLibraries) 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_FOLDER, wxCDMProjectDescriptionPanel::OnBtnOpenFolder) +EVT_BUTTON(ID_BUTTON_SET_VERSION, wxCDMProjectDescriptionPanel::OnBtnSetVersion) END_EVENT_TABLE() wxCDMProjectDescriptionPanel::wxCDMProjectDescriptionPanel( @@ -120,8 +122,13 @@ void wxCDMProjectDescriptionPanel::CreateControls() // versionDate wxStaticText* pVersionDatetc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetVersionDate())); // sourceLocation + wxBoxSizer* pSourceLocationsz = new wxBoxSizer(wxHORIZONTAL); wxStaticText* pSourceLocationtc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetPath())); pSourceLocationtc->SetMaxSize(wxSize(350,-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, 0, wxALIGN_CENTER, 0); + pSourceLocationsz->Add(pSourceLocationbt, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10); // buildLocation wxBoxSizer* pBuildLocationsz = new wxBoxSizer(wxHORIZONTAL); wxStaticText* pBuildLocationtc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetBuildPath())); @@ -136,7 +143,7 @@ void wxCDMProjectDescriptionPanel::CreateControls() propertiesGridSizer->Add(pVersionDate, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); propertiesGridSizer->Add(pVersionDatetc, 1, wxEXPAND); propertiesGridSizer->Add(pSourceLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); - propertiesGridSizer->Add(pSourceLocationtc, 1, wxEXPAND); + propertiesGridSizer->Add(pSourceLocationsz, 1, wxEXPAND); propertiesGridSizer->Add(pBuildLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); propertiesGridSizer->Add(pBuildLocationsz, 1, wxEXPAND); @@ -147,12 +154,13 @@ void wxCDMProjectDescriptionPanel::CreateControls() //SetPanel sizer and box propertiesPanel->SetSizer(propertiesPanelSizer); propertiesPanelSizer->Fit(propertiesPanel); - propertiesBox->Add(propertiesPanel, 1, wxEXPAND); + propertiesBox->Add(propertiesPanel, 0, wxEXPAND); sizer->Add(propertiesBox, 0, wxEXPAND | wxALL, 10); //----------------------------------Project Actions-------------------------------------- //actions StaticBoxSizer wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxHORIZONTAL,this, _T("&Actions")); + actionsBox->GetStaticBox()->SetToolTip(wxT("Go to any of the content managers of the project or edit the project's CMakeLists.txt file by selecting any of the available actions.")); //actions Panel wxPanel* actionsPanel = new wxPanel(this); //actions Sizer @@ -186,7 +194,7 @@ void wxCDMProjectDescriptionPanel::CreateControls() //SetPanel sizer and box actionsPanel->SetSizer(actionsPanelSizer); actionsPanelSizer->Fit(actionsPanel); - actionsBox->Add(actionsPanel, 1, wxEXPAND); + actionsBox->Add(actionsPanel, 0, wxALL, 5); sizer->Add(actionsBox, 0, wxEXPAND | wxALL, 10); @@ -195,84 +203,6 @@ void wxCDMProjectDescriptionPanel::CreateControls() sizer->SetSizeHints(this); } - -void wxCDMProjectDescriptionPanel::OnBtnCreateLibrary(wxCommandEvent& event) -{ - //get name - wxString libraryName = wxGetTextFromUser( - _T("Enter the new library name"), - _T("New Library - creaDevManager"), - _T("") - ); - //check name - if(libraryName.Len() > 0) - { - std::string* result; - //create library - modelCDMIProjectTreeNode* library = this->project->CreateLibrary(crea::wx2std(libraryName),result); - //check library created - if(library == NULL) - { - wxMessageBox(crea::std2wx(*result),_T("New Library - Error!"),wxOK | wxICON_ERROR); - event.Skip(); - return; - } - wxMessageBox(crea::std2wx("Library successfully created."),_T("New Library - Success!"),wxOK | wxICON_INFORMATION); - - //refreshing tree and description - //send event instead of calling parent to avoid crashing - - ((wxCDMMainFrame*)this->GetParent())->RefreshProject(); - - wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(library->GetId()); - wxPostEvent(this->GetParent(), *newEvent); - event.Skip(); - } -} - -void wxCDMProjectDescriptionPanel::OnBtnCreateApplication(wxCommandEvent& event) -{ - //get name - wxString applicationName = wxGetTextFromUser( - _T("Enter the new application name"), - _T("New Application - creaDevManager"), - _T("") - ); - //check name - if(applicationName.Len() > 0) - { - std::string* result; - //create library - modelCDMIProjectTreeNode* application = this->project->CreateApplication(crea::wx2std(applicationName),result); - //check library created - if(application == NULL) - { - wxMessageBox(crea::std2wx(*result),_T("New Application - Error!"),wxOK | wxICON_ERROR); - event.Skip(); - return; - } - wxMessageBox(crea::std2wx("Application successfully created."),_T("New Application - Success!"),wxOK | wxICON_INFORMATION); - - //refreshing tree and description - //send event instead of calling parent to avoid crashing - - ((wxCDMMainFrame*)this->GetParent())->RefreshProject(); - - wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_DISPLAY_CHANGED); - newEvent->SetInt(application->GetId()); - wxPostEvent(this->GetParent(), *newEvent); - event.Skip(); - } -} - -void wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) -{ - //TODO: implement method - std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl; - event.Skip(); -} - void wxCDMProjectDescriptionPanel::OnBtnManagePackages(wxCommandEvent& event) { @@ -303,3 +233,34 @@ wxCDMProjectDescriptionPanel::OnBtnManageApplications(wxCommandEvent& event) wxPostEvent(this->GetParent(), *newEvent); event.Skip(); } + +void wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event) +{ + //TODO: implement method + std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl; + event.Skip(); +} + +void +wxCDMProjectDescriptionPanel::OnBtnSetBuildPath(wxCommandEvent& event) +{ + //TODO: implement method + std::cerr << "Event OnBtnSetBuildPath not implemented" << std::endl; + event.Skip(); +} + +void +wxCDMProjectDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event) +{ + //TODO: implement method + std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl; + event.Skip(); +} + +void +wxCDMProjectDescriptionPanel::OnBtnSetVersion(wxCommandEvent& event) +{ + //TODO: implement method + std::cerr << "Event OnBtnSetVersion not implemented" << std::endl; + event.Skip(); +} diff --git a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.h b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.h index 1b2c63b..0c347d8 100644 --- a/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.h +++ b/lib/creaDevManagerLib/wxCDMProjectDescriptionPanel.h @@ -74,13 +74,13 @@ private: //handlers protected: - void OnBtnCreateLibrary(wxCommandEvent& event); - void OnBtnCreateApplication(wxCommandEvent& event); - void OnBtnEditCMakeLists(wxCommandEvent& event); - void OnBtnManagePackages(wxCommandEvent& event); void OnBtnManageLibraries(wxCommandEvent& event); void OnBtnManageApplications(wxCommandEvent& event); + void OnBtnEditCMakeLists(wxCommandEvent& event); + void OnBtnSetBuildPath(wxCommandEvent& event); + void OnBtnOpenFolder(wxCommandEvent& event); + void OnBtnSetVersion(wxCommandEvent& event); }; #endif /* WXCDMPROJECTDESCRIPTIONPANEL_H_ */