//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;
//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;
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(
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<modelCDMApplication*> 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);
}
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();
+}
void OnBtnEditCMakeLists(wxCommandEvent& event);
void OnLnkApplicationSelect(wxHyperlinkEvent& event);
void OnBtnReturn(wxCommandEvent& event);
+ void OnBtnOpenFolder(wxCommandEvent& event);
};
#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(
{
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);
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
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();
+}
//handlers
protected:
+ void OnBtnReturn(wxCommandEvent& event);
void OnBtnCreateClass(wxCommandEvent& event);
void OnBtnCreateFolder(wxCommandEvent& event);
void OnBtnEditCMakeLists(wxCommandEvent& event);
+ void OnBtnOpenFolder(wxCommandEvent& event);
};
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(
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<modelCDMLibrary*> 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);
}
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();
+}
void OnBtnEditCMakeLists(wxCommandEvent& event);
void OnLnkLibrarySelect(wxHyperlinkEvent& event);
void OnBtnReturn(wxCommandEvent& event);
+ void OnBtnOpenFolder(wxCommandEvent& event);
};
#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(
{
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
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
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();
+}
//handlers
protected:
+ void OnBtnReturn(wxCommandEvent& event);
void OnBtnCreateClass(wxCommandEvent& event);
void OnBtnCreateFolder(wxCommandEvent& event);
void OnBtnEditCMakeLists(wxCommandEvent& event);
+ void OnBtnOpenFolder(wxCommandEvent& event);
};
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);
void wxCDMMainDescriptionPanel::OnBtnNewProject(wxCommandEvent& event)
{
- event.ResumePropagation(1);
event.Skip();
}
void wxCDMMainDescriptionPanel::OnBtnOpenProject(wxCommandEvent& event)
{
- event.ResumePropagation(1);
event.Skip();
}
{
auiManager.DetachPane(this->panel_Properties);
this->panel_Properties->Destroy();
+ this->panel_Properties = NULL;
}
this->panel_Properties = new wxCDMProjectDescriptionPanel(
{
auiManager.DetachPane(this->panel_Properties);
this->panel_ProjectActions->Destroy();
+ this->panel_ProjectActions = NULL;
}
panel_ProjectActions = new wxCDMProjectActionsPanel(
{
auiManager.DetachPane(this->panel_Properties);
this->panel_Properties->Destroy();
+ this->panel_Properties = NULL;
}
this->panel_Properties = new wxCDMProjectDescriptionPanel(
{
auiManager.DetachPane(this->panel_ProjectActions);
this->panel_ProjectActions->Destroy();
+ this->panel_ProjectActions = NULL;
}
panel_ProjectActions = new wxCDMProjectActionsPanel(
this,
{
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(
{
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(
{
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);
{
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();
}
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();
//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
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(),
}
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;
}
//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
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(
// 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()));
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);
//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
//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);
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)
{
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();
+}
//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_ */