#include "images/PkIcon64.xpm"
#include "wxCDMNewBlackBoxDialog.h"
+#include "wxCDMPackageConfigurationDialog.h"
#include <wx/textdlg.h>
#include "CDMUtilities.h"
EVT_BUTTON(ID_BUTTON_CREATE_BLACKBOX, wxCDMPackageDescriptionPanel::OnBtnCreateBlackBox)
EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMPackageDescriptionPanel::OnBtnEditCMakeLists)
EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMPackageDescriptionPanel::OnBtnOpenFolder)
+EVT_BUTTON(ID_BUTTON_CHOOSE, wxCDMPackageDescriptionPanel::OnBtnConfigurePackage)
END_EVENT_TABLE()
wxCDMPackageDescriptionPanel::wxCDMPackageDescriptionPanel(
)
{
wxPanel::Create(parent, id, pos, size, style);
+ // this part makes the scrollbars show up
+ this->FitInside(); // ask the sizer about the needed size
+ this->SetScrollRate(5, 5);
+
this->package = package;
CreateControls();
return TRUE;
//Links to return
wxBoxSizer *linksSizer = new wxBoxSizer(wxHORIZONTAL);
std::vector<modelCDMIProjectTreeNode*> parents = this->package->GetParents();
- for (int i = 0; i < parents.size(); i++)
+ for (int i = 0; i < (int)(parents.size()); i++)
{
- wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()));
- returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + "."));
+ wxHyperlinkCtrl* returnLnk = new wxHyperlinkCtrl(this, ID_BUTTON_PREV, crea::std2wx(parents[parents.size()-1-i]->GetName()), crea::std2wx(parents[parents.size()-1-i]->GetPath()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE);
+ returnLnk->SetWindowStyle(wxNO_BORDER);
+ returnLnk->SetToolTip(crea::std2wx("Return to " + parents[parents.size()-1-i]->GetName() + "."));
linksSizer->Add(returnLnk, 0, wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT, 5);
- if (i < parents.size()-1)
- {
- linksSizer->Add(new wxStaticText(this,wxID_ANY, wxT("/")), 0, wxALIGN_CENTER, 0);
- }
+ linksSizer->Add(new wxStaticText(this,wxID_ANY, wxT("/")), 0, wxALIGN_CENTER, 0);
}
+
+ linksSizer->Add(new wxStaticText(this, wxID_ANY, crea::std2wx(this->package->GetName())), 0, wxALIGN_CENTER, 0);
+
sizer->Add(linksSizer, 0, wxALIGN_CENTER | wxALL, 5);
//Header
std::vector<modelCDMBlackBox*> blackBoxes = this->package->GetSrc()->GetBlackBoxes();
- for (int i = 0; i < blackBoxes.size(); i++)
+ for (int i = 0; i < (int)(blackBoxes.size()); i++)
{
if(blackBoxes[i] != NULL)
{
- wxHyperlinkCtrl* pBBlk = new wxHyperlinkCtrl(BBPanel,ID_LINK_SELECT_BLACKBOX, crea::std2wx(blackBoxes[i]->GetName().c_str()), crea::std2wx(blackBoxes[i]->GetName().c_str()));
- pBBlk->SetWindowStyle(wxALIGN_LEFT);
+ wxHyperlinkCtrl* pBBlk = new wxHyperlinkCtrl(BBPanel,ID_LINK_SELECT_BLACKBOX, crea::std2wx(blackBoxes[i]->GetName().c_str()), crea::std2wx(blackBoxes[i]->GetName().c_str()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE);
+ pBBlk->SetWindowStyle(wxALIGN_LEFT | wxNO_BORDER);
std::string tt = "Author: " + blackBoxes[i]->GetAuthors() + "\nDescription: " + blackBoxes[i]->GetDescription() + "\nCategories: " + blackBoxes[i]->GetCategories();
pBBlk->SetToolTip(crea::std2wx(tt));
pBBlk->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageDescriptionPanel::OnMouseEnter,NULL,this);
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);
std::vector<modelCDMIProjectTreeNode*> parents = this->package->GetParents();
std::string parentURL = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
//std::cout << parentURL << std::endl;
- for (int i = 0; i < parents.size(); i++)
+ for (int i = 0; i < (int)(parents.size()); i++)
{
if (parents[i]->GetPath() == parentURL)
{
{
modelCDMBlackBox* bb;
std::vector<modelCDMBlackBox*> bbs = this->package->GetSrc()->GetBlackBoxes();
- for (int i = 0; i < bbs.size(); i++)
+ for (int i = 0; i < (int)(bbs.size()); i++)
{
if(bbs[i]->GetName() == crea::wx2std(event.GetURL()))
{
}
}
+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;
modelCDMFile* bbHeader = NULL;
std::vector<modelCDMBlackBox*> boxes = this->package->GetSrc()->GetBlackBoxes();
- for (int i = 0; i < boxes.size(); i++)
+ for (int i = 0; i < (int)(boxes.size()); i++)
{
if(boxes[i]->GetName() == BBName)
{
std::string BBName = crea::wx2std(((wxHyperlinkCtrl*)event.GetEventObject())->GetURL());
modelCDMFile* bbHeader = NULL;
std::vector<modelCDMBlackBox*> boxes = this->package->GetSrc()->GetBlackBoxes();
- for (int i = 0; i < boxes.size(); i++)
+ for (int i = 0; i < (int)(boxes.size()); i++)
{
if(boxes[i]->GetName() == BBName)
{