}
int openFileExplorer(const std::string& file)
- {
- std::string command = FILE_EXPLORER;
+ {
+ std::string command = FILE_EXPLORER;
+
+ if(file != "")
+ command += " \"" + file + "\" &";
+
+ return system(command.c_str());
+ }
- if(file != "")
- command += " \"" + file + "\" &";
+ int openFileWithCommand(const std::string& file, const std::string& command)
+ {
+ std::string comm = command;
+ if(file != "")
+ comm += " \"" + file + "\" &";
- return system(command.c_str());
- }
+ return system(comm.c_str());
+ }
+
+ int openBBEditor()
+ {
+ std::string comm = "bbEditor &";
+ return system(comm.c_str());
+ }
+
+ int openCreaToolsTools()
+ {
+ std::string comm = "creaTools.sh &";
+ return system(comm.c_str());
+ }
+
+ int openTerminal()
+ {
+ std::string comm = TERMINAL + "&";
+ return system(comm.c_str());
+ }
}
static std::string FILE_EXPLORER = "nautilus";
#endif
+ //terminal program
+ #ifdef _WIN32
+ // ------ Windows
+ //TODO: implementation for windows
+ #elif __APPLE__
+ // ------ Apple
+ //TODO: implementation for apple
+ #else
+ static std::string TERMINAL = "gnome-terminal";
+ #endif
+
struct splitter
{
int openTextEditor(const std::string& file = "");
int openFileExplorer(const std::string& file = "");
+ int openFileWithCommand(const std::string& file, const std::string& command);
+ int openBBEditor();
+ int openCreaToolsTools();
+ int openTerminal();
};
#endif /* CDMUTILITIES_H_ */
#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_BUILD_PROJECT 10320
-#define ID_BUTTON_CONFIGURE_BUILD 10321
-#define ID_BUTTON_CONNECT_PROJECT 10322
-#define ID_BUTTON_GOTO_PACKAGE_MANAGER 10323
-#define ID_BUTTON_GOTO_APPLI_MANAGER 10324
-#define ID_BUTTON_GOTO_LIB_MANAGER 10325
+#define ID_BUTTON_BUILD_PROJECT 10322
+#define ID_BUTTON_CONFIGURE_BUILD 10323
+#define ID_BUTTON_CONNECT_PROJECT 10324
-#define ID_LINK_SELECT_PACKAGE 10326
-#define ID_LINK_SELECT_LIBRARY 10327
-#define ID_LINK_SELECT_APPLICATION 10328
-#define ID_LINK_SELECT_BLACKBOX 10329
+#define ID_BUTTON_GOTO_PACKAGE_MANAGER 10325
+#define ID_BUTTON_GOTO_APPLI_MANAGER 10326
+#define ID_BUTTON_GOTO_LIB_MANAGER 10327
+
+#define ID_LINK_SELECT_PACKAGE 10328
+#define ID_LINK_SELECT_LIBRARY 10329
+#define ID_LINK_SELECT_APPLICATION 10330
+#define ID_LINK_SELECT_BLACKBOX 10331
#endif /* CREADEVMANAGERIDS_H_ */
return this->nameApplication;
}
-const std::string& modelCDMApplication::GetMainFile() const
+const std::string& modelCDMApplication::GetExecutableName() const
{
- return this->mainFile;
+ return this->executableName;
}
void modelCDMApplication::SetMainFile(const std::string& fileName)
return true;
}
-bool modelCDMApplication::OpenCMakeListsFile(std::string*& result)
-{
- //TODO: implement method
- return true;
-}
-
const bool modelCDMApplication::Refresh(std::string*& result)
{
//TODO: implement method
~modelCDMApplication();
const std::string& GetNameApplication() const;
- const std::string& GetMainFile() const;
+ const std::string& GetExecutableName() const;
void SetMainFile(const std::string& fileName);
std::string*& result,
const std::string& path = "/"
);
- bool OpenCMakeListsFile(std::string* & result);
virtual const bool Refresh(std::string*& result);
private:
std::string nameApplication;
- std::string mainFile;
+ std::string executableName;
std::vector<modelCDMApplication*> applications;
};
#include<creaWx.h>
#include<wx/dir.h>
+#include "CDMUtilities.h"
+
modelCDMCMakeListsFile::modelCDMCMakeListsFile()
{
}
bool modelCDMCMakeListsFile::OpenFile(std::string*& result)
{
- //TODO: implement method
- return true;
+
+ if (!CDMUtilities::openTextEditor(this->path))
+ return true;
+ else
+ {
+ result = new std::string("Couldn't open CMakeLists file.");
+ return false;
+ }
}
const bool modelCDMCMakeListsFile::Refresh(std::string*& result)
{
}
-bool modelCDMFile::OpenFile(std::string*& result)
+bool modelCDMFile::OpenFile(std::string*& result, const std::string& command)
{
- //TODO: implement method
+ if (!CDMUtilities::openFileWithCommand(path, command))
return true;
+ else
+ {
+ result = new std::string("Couldn't open file with command " + command + ".");
+ return false;
+ }
}
const bool modelCDMFile::Refresh(std::string*& result)
{
- //TODO: implement method
+ std::ifstream in((this->path).c_str());
+ if(!in.is_open())
+ {
+ in.close();
+ return false;
+ }
+ return true;
+}
+
+const bool modelCDMFile::OpenInFileExplorer(std::string*& result) const
+{
+ std::string pth = this->path.substr(0, path.size() - name.size() - 1);
+ if (!CDMUtilities::openFileExplorer(pth))
return true;
+ else
+ {
+ result = new std::string("Couldn't open file.");
+ return false;
+ }
}
modelCDMFile(const std::string& path, const int& level = 3);
~modelCDMFile();
- bool OpenFile(std::string* & result);
+ bool OpenFile(std::string* & result, const std::string& command = "");
virtual const bool Refresh(std::string*& result);
+ const bool OpenInFileExplorer(std::string*& result) const;
};
#endif /* MODELCDMFILE_H_ */
return true;
}
-bool modelCDMLibrary::OpenCMakeListsFile(std::string*& result)
-{
- //TODO: implement method
- return true;
-}
-
const bool modelCDMLibrary::Refresh(std::string*& result)
{
//TODO: implement method
std::string*& result,
const std::string& path = "/"
);
- bool OpenCMakeListsFile(std::string*& result);
virtual const bool Refresh(std::string*& result);
private:
#include "modelCDMPackage.h"
+#include <fstream>
+
#include "creaWx.h"
#include "wx/dir.h"
#include "CDMUtilities.h"
{
this->type = wxDIR_DIRS;
//Get Package Name
+
+ //TODO: set pathMakeLists for windows
+ std::string pathMakeLists = path + "/CMakeLists.txt";
+
+ std::ifstream confFile;
+ confFile.open((pathMakeLists).c_str());
+
+ std::string word;
+ while(confFile.is_open() && !confFile.eof())
+ {
+ //get sets
+ std::getline(confFile,word,'(');
+ std::vector<std::string> wordBits;
+ CDMUtilities::splitter::split(wordBits,word," (\n",CDMUtilities::splitter::no_empties);
+
+ if(wordBits[wordBits.size()-1] == "SET")
+ {
+ //get package name
+ std::getline(confFile,word,')');
+ CDMUtilities::splitter::split(wordBits, word, " ", CDMUtilities::splitter::no_empties);
+ if(wordBits[0] == "BBTK_PACKAGE_NAME")
+ {
+ word = wordBits[1];
+ for (int i = 2; i < wordBits.size(); i++)
+ {
+ word += " " + wordBits[i];
+ }
+ wordBits.clear();
+ CDMUtilities::splitter::split(wordBits, word, "\"", CDMUtilities::splitter::no_empties);
+
+ this->namePackage = wordBits[0];
+ }
+ else if(wordBits[0] == "${BBTK_PACKAGE_NAME}_AUTHOR")
+ {
+ word = wordBits[1];
+ for (int i = 2; i < wordBits.size(); i++)
+ {
+ word += " " + wordBits[i];
+ }
+ wordBits.clear();
+ CDMUtilities::splitter::split(wordBits, word, "\"", CDMUtilities::splitter::no_empties);
+
+ this->authors = wordBits[0];
+ }
+ else if(wordBits[0] == "${BBTK_PACKAGE_NAME}_DESCRIPTION")
+ {
+ word = wordBits[1];
+ for (int i = 2; i < wordBits.size(); i++)
+ {
+ word += " " + wordBits[i];
+ }
+ wordBits.clear();
+ CDMUtilities::splitter::split(wordBits, word, "\"", CDMUtilities::splitter::no_empties);
+
+ this->description = wordBits[0];
+ }
+ else if(wordBits[0] == "${BBTK_PACKAGE_NAME}_MAJOR_VERSION")
+ {
+ this->version = wordBits[1];
+ }
+ else if(wordBits[0] == "${BBTK_PACKAGE_NAME}_MINOR_VERSION")
+ {
+ this->version += "." + wordBits[1];
+ }
+ else if(wordBits[0] == "${BBTK_PACKAGE_NAME}_BUILD_VERSION")
+ {
+ this->version += "." + wordBits[1];
+ }
+ }
+ }
+
std::vector<std::string> words;
std::string delimiters;
//TODO::fix for windows
delimiters = "/";
CDMUtilities::splitter::split(words, path, delimiters, CDMUtilities::splitter::no_empties);
this->name = words[words.size()-1];
- this->namePackage = this->name;
this->level = level;
this->path = path;
bool modelCDMPackage::SetAuthors(const std::string& authors, std::string*& result)
{
- //TODO: implement method
+ std::vector<std::string> words;
+ CDMUtilities::splitter::split(words, authors, ",\n", CDMUtilities::splitter::no_empties);
+ std::string authorsReal = words[0];
+ for (int i = 1; i < words.size(); i++)
+ {
+ authorsReal += "/" + words[i];
+ }
+
+ std::string line;
+ //opening original cmakelists
+ std::ifstream in((this->path + "/CMakeLists.txt").c_str());
+ if( !in.is_open())
+ {
+ result = new std::string("CMakeLists.txt file failed to open.");
+ return false;
+ }
+ //opening temporal cmakelists
+ std::ofstream out((this->path + "/CMakeLists.txt.tmp").c_str());
+ if( !out.is_open())
+ {
+ result = new std::string("CMakeLists.txt.tmp file failed to open.");
+ return false;
+ }
+ //copying contents from original to temporal and making changes
+ while (getline(in, line))
+ {
+ if(line.find("SET(${BBTK_PACKAGE_NAME}_AUTHOR") != std::string::npos)
+ line = "SET(${BBTK_PACKAGE_NAME}_AUTHOR \"" + authorsReal + "\")";
+ out << line << std::endl;
+ }
+ in.close();
+ out.close();
+ //delete old file and rename new file
+ std::string renameCommand = "mv " + this->path + "/CMakeLists.txt.tmp " + this->path + "/CMakeLists.txt";
+ if(system(renameCommand.c_str()))
+ {
+ result = new std::string("An error occurred while running '" + renameCommand + "'.");
+ return false;
+ }
+
+ this->authors = authorsReal;
return true;
}
bool modelCDMPackage::SetVersion(const std::string& version, std::string*& result)
{
- //TODO: implement method
+ std::vector<std::string> vers;
+ CDMUtilities::splitter::split(vers, version, " .", CDMUtilities::splitter::no_empties);
+
+
+ std::string line;
+ //opening original cmakelists
+ std::ifstream in((this->path + "/CMakeLists.txt").c_str());
+ if( !in.is_open())
+ {
+ result = new std::string("CMakeLists.txt file failed to open.");
+ return false;
+ }
+ //opening temporal cmakelists
+ std::ofstream out((this->path + "/CMakeLists.txt.tmp").c_str());
+ if( !out.is_open())
+ {
+ result = new std::string("CMakeLists.txt.tmp file failed to open.");
+ return false;
+ }
+ //copying contents from original to temporal and making changes
+ while (getline(in, line))
+ {
+ if(line.find("SET(${BBTK_PACKAGE_NAME}_MAJOR_VERSION") != std::string::npos)
+ line = "SET(${BBTK_PACKAGE_NAME}_MAJOR_VERSION " + vers[0] + ")";
+ else if(line.find("SET(${BBTK_PACKAGE_NAME}_VERSION") != std::string::npos)
+ line = "SET(${BBTK_PACKAGE_NAME}_MINOR_VERSION " + vers[1] + ")";
+ else if(line.find("SET(${BBTK_PACKAGE_NAME}_BUILD_VERSION") != std::string::npos)
+ line = "SET(${BBTK_PACKAGE_NAME}_BUILD_VERSION " + vers[2] + ")";
+ out << line << std::endl;
+ }
+ in.close();
+ out.close();
+ //delete old file and rename new file
+ std::string renameCommand = "mv " + this->path + "/CMakeLists.txt.tmp " + this->path + "/CMakeLists.txt";
+ if(system(renameCommand.c_str()))
+ {
+ result = new std::string("An error occurred while running '" + renameCommand + "'.");
+ return false;
+ }
+
+ this->version = vers[0] + "." + vers[1] + "." + vers[2];
return true;
}
bool modelCDMPackage::SetDescription(const std::string& description, std::string*& result)
{
- //TODO: implement method
+ std::vector<std::string> words;
+ CDMUtilities::splitter::split(words, description, " \n", CDMUtilities::splitter::no_empties);
+ std::string descriptionReal = words[0];
+ for (int i = 1; i < words.size(); i++)
+ {
+ descriptionReal += " " + words[i];
+ }
+
+ std::string line;
+ //opening original cmakelists
+ std::ifstream in((this->path + "/CMakeLists.txt").c_str());
+ if( !in.is_open())
+ {
+ result = new std::string("CMakeLists.txt file failed to open.");
+ return false;
+ }
+ //opening temporal cmakelists
+ std::ofstream out((this->path + "/CMakeLists.txt.tmp").c_str());
+ if( !out.is_open())
+ {
+ result = new std::string("CMakeLists.txt.tmp file failed to open.");
+ return false;
+ }
+ //copying contents from original to temporal and making changes
+ while (getline(in, line))
+ {
+ if(line.find("SET(${BBTK_PACKAGE_NAME}_DESCRIPTION") != std::string::npos)
+ line = "SET(${BBTK_PACKAGE_NAME}_DESCRIPTION \"" + descriptionReal + "\")";
+ out << line << std::endl;
+ }
+ in.close();
+ out.close();
+ //delete old file and rename new file
+ std::string renameCommand = "mv " + this->path + "/CMakeLists.txt.tmp " + this->path + "/CMakeLists.txt";
+ if(system(renameCommand.c_str()))
+ {
+ result = new std::string("An error occurred while running '" + renameCommand + "'.");
+ return false;
+ }
+
+ this->description = descriptionReal;
return true;
}
return true;
}
-bool modelCDMPackage::OpenCMakeListsFile(std::string*& result)
-{
- //TODO: implement method
- return true;
-}
-
const bool modelCDMPackage::Refresh(std::string*& result)
{
//TODO: implement method
const std::string& categories = "empty",
const std::string& description = "no description"
);
- bool OpenCMakeListsFile(std::string*& result);
virtual const bool Refresh(std::string*& result);
private:
wxFlexGridSizer* propertiesGridSizer = new wxFlexGridSizer(4, 2, 9, 15);
- wxStaticText *pMainFile = new wxStaticText(propertiesPanel, -1, wxT("Main File"));
+ wxStaticText *pMainFile = new wxStaticText(propertiesPanel, -1, wxT("Executable Name"));
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."));
+ wxStaticText* pMainFiletc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(this->application->GetExecutableName()));
+ wxButton* pMainFilebt = new wxButton(propertiesPanel, ID_BUTTON_SET_VERSION, wxT("Set"));
+ pMainFilebt->SetToolTip(wxT("Set the name of the executable file for the application."));
pMainFilesz->Add(pMainFiletc, 0, wxALIGN_CENTER_VERTICAL, 0);
pMainFilesz->Add(pMainFilebt, 0, wxALIGN_CENTER | wxLEFT, 10);
createFolderbt->SetToolTip(wxT("Create a new Folder inside the application folder."));
wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt file inside this application."));
+ editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMApplicationDescriptionPanel::OnCMakeMouseEnter,NULL,this);
+ editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMApplicationDescriptionPanel::OnCMakeMouseExit,NULL,this);
wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Application Folder"));
openFolderbt->SetToolTip(wxT("Open the application folder in the file explorer."));
void wxCDMApplicationDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl;
+ std::string* result;
+ if(!this->application->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->application->GetCMakeLists() != NULL)
+ {
+ int CMId = this->application->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+
event.Skip();
}
void wxCDMApplicationDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl;
+ std::string* result;
+ if(!this->application->OpenInFileExplorer(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
+}
+
+void wxCDMApplicationDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(this->application->GetCMakeLists() != NULL)
+ {
+ int CMId = this->application->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ event.Skip();
+}
+
+void wxCDMApplicationDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->application->GetCMakeLists() != NULL)
+ {
+ int CMId = this->application->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
event.Skip();
}
void OnBtnCreateFolder(wxCommandEvent& event);
void OnBtnEditCMakeLists(wxCommandEvent& event);
void OnBtnOpenFolder(wxCommandEvent& event);
+ void OnCMakeMouseEnter(wxMouseEvent& event);
+ void OnCMakeMouseExit(wxMouseEvent& event);
};
void wxCDMCMakeListsDescriptionPanel::OnBtnOpenInEditor(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnOpenInEditor not implemented" << std::endl;
- event.Skip();
+ std::string* result;
+ if(!this->cMakeLists->OpenFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
}
void wxCDMCMakeListsDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl;
- event.Skip();
+ std::string* result;
+ if(!this->cMakeLists->OpenInFileExplorer(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
}
BEGIN_EVENT_TABLE(wxCDMFileDescriptionPanel, wxPanel)
EVT_BUTTON(ID_BUTTON_PREV, wxCDMFileDescriptionPanel::OnBtnReturn)
-EVT_MENU(ID_BUTTON_OPEN_FOLDER, wxCDMFileDescriptionPanel::OnBtnOpenFolder)
-EVT_MENU(ID_BUTTON_OPEN_COMMAND, wxCDMFileDescriptionPanel::OnBtnOpenWithCommand)
+EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMFileDescriptionPanel::OnBtnOpenFolder)
+EVT_BUTTON(ID_BUTTON_OPEN_COMMAND, wxCDMFileDescriptionPanel::OnBtnOpenWithCommand)
END_EVENT_TABLE()
wxCDMFileDescriptionPanel::wxCDMFileDescriptionPanel(
void wxCDMFileDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnOpenContainingFolder not implemented" << std::endl;
- event.Skip();
+ std::string* result;
+ if(!this->file->OpenInFileExplorer(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
}
void wxCDMFileDescriptionPanel::OnBtnOpenWithCommand(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnOpenWithCommand not implemented" << std::endl;
- event.Skip();
+ //get command
+ wxString commandEx = wxGetTextFromUser(
+ _T("Enter the command to execute file"),
+ _T("Execute File - creaDevManager"),
+ _T("")
+ );
+ //check name
+ if(commandEx.Len() > 0)
+ {
+ std::string* result;
+ if(!this->file->OpenFile(result, crea::wx2std(commandEx)))
+ wxMessageBox(crea::std2wx(*result),_T("Execute File - Error!"),wxOK | wxICON_ERROR);
+ }
}
void CreateControls();
+
private:
modelCDMFile* file;
BEGIN_EVENT_TABLE(wxCDMFolderDescriptionPanel, wxPanel)
EVT_BUTTON(ID_BUTTON_PREV, wxCDMFolderDescriptionPanel::OnBtnReturn)
-EVT_MENU(ID_BUTTON_OPEN_FOLDER, wxCDMFolderDescriptionPanel::OnBtnOpenInExplorer)
-EVT_MENU(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMFolderDescriptionPanel::OnBtnEditCMakeLists)
+EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMFolderDescriptionPanel::OnBtnOpenInExplorer)
+EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMFolderDescriptionPanel::OnBtnEditCMakeLists)
END_EVENT_TABLE()
wxCDMFolderDescriptionPanel::wxCDMFolderDescriptionPanel(
{
wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
editCMakebt->SetToolTip(wxT("Open the CMakeLists.txt file in this folder with the default text editor."));
+ editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMFolderDescriptionPanel::OnCMakeMouseEnter,NULL,this);
+ editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMFolderDescriptionPanel::OnCMakeMouseExit,NULL,this);
actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5);
}
void wxCDMFolderDescriptionPanel::OnBtnOpenInExplorer(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnOpenInExplorer not implemented" << std::endl;
- event.Skip();
+ std::string* result;
+ if(!this->folder->OpenInFileExplorer(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
}
void wxCDMFolderDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl;
+ std::string* result;
+ if(!this->folder->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->folder->GetCMakeLists() != NULL)
+ {
+ int CMId = this->folder->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+}
+
+void wxCDMFolderDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(this->folder->GetCMakeLists() != NULL)
+ {
+ int CMId = this->folder->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ event.Skip();
+}
+
+void wxCDMFolderDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->folder->GetCMakeLists() != NULL)
+ {
+ int CMId = this->folder->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
event.Skip();
}
void OnBtnEditCMakeLists(wxCommandEvent& event);
void OnBtnOpenInExplorer(wxCommandEvent& event);
+ void OnCMakeMouseEnter(wxMouseEvent& event);
+ void OnCMakeMouseExit(wxMouseEvent& event);
+
};
#endif /* WXCDMLIBDESCRIPTIONPANEL_H_ */
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."));
+ editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibraryDescriptionPanel::OnCMakeMouseEnter,NULL,this);
+ editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMLibraryDescriptionPanel::OnCMakeMouseExit,NULL,this);
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."));
void wxCDMLibraryDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl;
+ std::string* result;
+ if(!this->library->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->library->GetCMakeLists() != NULL)
+ {
+ int CMId = this->library->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+
+ event.Skip();
+}
+
+void wxCDMLibraryDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
+{
+ std::string* result;
+ if(!this->library->OpenInFileExplorer(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
+}
+
+void wxCDMLibraryDescriptionPanel::OnCMakeMouseEnter(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(this->library->GetCMakeLists() != NULL)
+ {
+ int CMId = this->library->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
event.Skip();
}
-void
-wxCDMLibraryDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
+void wxCDMLibraryDescriptionPanel::OnCMakeMouseExit(wxMouseEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl;
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->library->GetCMakeLists() != NULL)
+ {
+ int CMId = this->library->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
event.Skip();
}
void OnBtnCreateFolder(wxCommandEvent& event);
void OnBtnEditCMakeLists(wxCommandEvent& event);
void OnBtnOpenFolder(wxCommandEvent& event);
+ void OnCMakeMouseEnter(wxMouseEvent& event);
+ void OnCMakeMouseExit(wxMouseEvent& event);
};
{
std::cerr << "Event OnMenuBBTKGraphicalEditor not implemented" << std::endl;
event.Skip();
+ if(CDMUtilities::openBBEditor())
+ {
+ wxMessageBox( wxT("Can't open the BB Graphical Editor. Please check your Crea Tools installation."), wxT("Refresh Project - Error"), wxICON_ERROR);
+ }
}
void wxCDMMainFrame::OnMenuMiniTools(wxCommandEvent& event)
{
- std::cerr << "Event OnMenuMiniTools not implemented" << std::endl;
- event.Skip();
+ if(CDMUtilities::openCreaToolsTools())
+ {
+ wxMessageBox( wxT("Can't open the Minitools. Please check your Crea Tools installation."), wxT("Refresh Project - Error"), wxICON_ERROR);
+ }
}
void wxCDMMainFrame::OnMenuCodeEditor(wxCommandEvent& event)
{
- std::cerr << "Event OnMenuCodeEditor not implemented" << std::endl;
- event.Skip();
+ if(CDMUtilities::openTextEditor())
+ {
+ wxMessageBox( wxT("Can't open the Text Editor. Please check the default text editor command in the Crea Development Manager settings (Edit -> Settings)."), wxT("Refresh Project - Error"), wxICON_ERROR);
+ }
}
void wxCDMMainFrame::OnMenuCommandLine(wxCommandEvent& event)
{
- std::cerr << "Event OnMenuCommandLine not implemented" << std::endl;
- event.Skip();
+ if(CDMUtilities::openTerminal())
+ {
+ wxMessageBox( wxT("Can't open Terminal. Please check the default terminal command in the Crea Development Manager settings (Edit -> Settings)."), wxT("Refresh Project - Error"), wxICON_ERROR);
+ }
}
//Help Menu
#include "creaDevManagerIds.h"
#include "images/PkIcon64.xpm"
+#include <wx/textdlg.h>
+#include "CDMUtilities.h"
+
BEGIN_EVENT_TABLE(wxCDMPackageDescriptionPanel, wxPanel)
EVT_BUTTON(ID_BUTTON_PREV, wxCDMPackageDescriptionPanel::OnBtnReturn)
+EVT_BUTTON(ID_BUTTON_SET_AUTHOR, wxCDMPackageDescriptionPanel::OnBtnSetAuthor)
+EVT_BUTTON(ID_BUTTON_SET_VERSION, wxCDMPackageDescriptionPanel::OnBtnSetVersion)
+EVT_BUTTON(ID_BUTTON_SET_DESCRIPTION, wxCDMPackageDescriptionPanel::OnBtnSetDescription)
EVT_HYPERLINK(ID_LINK_SELECT_BLACKBOX, wxCDMPackageDescriptionPanel::OnLnkBlackBoxSelect)
EVT_BUTTON(ID_BUTTON_CREATE_BLACKBOX, wxCDMPackageDescriptionPanel::OnBtnCreateBlackBox)
EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMPackageDescriptionPanel::OnBtnEditCMakeLists)
// author
wxBoxSizer* pAuthorsz = new wxBoxSizer(wxHORIZONTAL);
- wxStaticText* pAuthortc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(this->package->GetAuthors()));
- wxButton* pAuthorbt = new wxButton(propertiesPanel, ID_BUTTON_SET_VERSION, wxT("Change"));
+ this->authortc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(this->package->GetAuthors()));
+ wxButton* pAuthorbt = new wxButton(propertiesPanel, ID_BUTTON_SET_AUTHOR, wxT("Change"));
pAuthorbt->SetToolTip(wxT("Update the author/s of the package."));
- pAuthorsz->Add(pAuthortc, 0, wxALIGN_CENTER_VERTICAL, 0);
+ pAuthorsz->Add(this->authortc, 1, wxALIGN_CENTER_VERTICAL);
pAuthorsz->Add(pAuthorbt, 0, wxALIGN_CENTER | wxLEFT, 10);
// version
wxBoxSizer* pVersionsz = new wxBoxSizer(wxHORIZONTAL);
- wxStaticText* pVersiontc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(this->package->GetVersion()));
+ this->versiontc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(this->package->GetVersion()));
wxButton* pVersionbt = new wxButton(propertiesPanel, ID_BUTTON_SET_VERSION, wxT("Set"));
pVersionbt->SetToolTip(wxT("Update the version of the package."));
- pVersionsz->Add(pVersiontc, 0, wxALIGN_CENTER_VERTICAL, 0);
+ pVersionsz->Add(this->versiontc, 1, wxALIGN_CENTER_VERTICAL);
pVersionsz->Add(pVersionbt, 0, wxALIGN_CENTER | wxLEFT, 10);
// description
wxBoxSizer* pDescriptionsz = new wxBoxSizer(wxHORIZONTAL);
- wxStaticText* pDescriptiontc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(this->package->GetDescription()));
- wxButton* pDescriptionbt = new wxButton(propertiesPanel, ID_BUTTON_SET_VERSION, wxT("Change"));
+ this->descriptiontc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(this->package->GetDescription()));
+ wxButton* pDescriptionbt = new wxButton(propertiesPanel, ID_BUTTON_SET_DESCRIPTION, wxT("Change"));
pDescriptionbt->SetToolTip(wxT("Update the description of the project."));
- pDescriptionsz->Add(pDescriptiontc, 0, wxALIGN_CENTER_VERTICAL, 0);
+ pDescriptionsz->Add(this->descriptiontc, 1, wxALIGN_CENTER_VERTICAL);
pDescriptionsz->Add(pDescriptionbt, 0, wxALIGN_CENTER | wxLEFT, 10);
propertiesGridSizer->Add(pAuthor, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
propertiesGridSizer->Add(pDescription, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
propertiesGridSizer->Add(pDescriptionsz, 1, wxEXPAND);
+ propertiesGridSizer->AddGrowableCol(1,1);
+
propertiesPanelSizer -> Add(propertiesGridSizer, 1, wxEXPAND);
propertiesPanel->SetSizer(propertiesPanelSizer);
propertiesPanelSizer->Fit(propertiesPanel);
- propertiesBox->Add(propertiesPanel, 0, wxALL, 5);
+ propertiesBox->Add(propertiesPanel, 0, wxEXPAND | wxALL, 5);
sizer->Add(propertiesBox, 0, wxEXPAND | wxALL, 10);
wxPostEvent(this->GetParent(), *newEvent);
}
+void wxCDMPackageDescriptionPanel::OnBtnSetAuthor(wxCommandEvent& event)
+{
+ //get author from user
+ wxTextEntryDialog* authDlg = new wxTextEntryDialog(
+ this,
+ wxT("Enter the new authors name. Separate each author with a '/'."),
+ wxT("Change Package Author - creaDevManager"),
+ crea::std2wx(this->package->GetAuthors()),
+ wxTE_MULTILINE | wxOK | wxCANCEL
+ );
+
+ if (authDlg->ShowModal() == wxID_OK)
+ {
+ std::string authorsStr = crea::wx2std(authDlg->GetValue());
+ //check name
+ if(authorsStr.size() > 0)
+ {
+ std::string* result;
+ if(!this->package->SetAuthors(authorsStr, result))
+ wxMessageBox(crea::std2wx(*result),_T("Change Package Author - Error!"),wxOK | wxICON_ERROR);
+ }
+ this->authortc->SetLabel(crea::std2wx(this->package->GetAuthors()));
+ this->authortc->GetParent()->GetSizer()->RecalcSizes();
+ }
+
+}
+
+void wxCDMPackageDescriptionPanel::OnBtnSetVersion(wxCommandEvent& event)
+{
+ //get version
+ wxString versionWx = wxGetTextFromUser(
+ wxT("Enter the new version name"),
+ wxT("Change Package Version - creaDevManager"),
+ crea::std2wx(this->package->GetVersion())
+ );
+ //check name
+ std::vector<std::string> parts;
+ CDMUtilities::splitter::split(parts, crea::wx2std(versionWx), " .", CDMUtilities::splitter::no_empties);
+ if(parts.size() == 3)
+ {
+ std::string* result;
+ if(!this->package->SetVersion(crea::wx2std(versionWx), result))
+ wxMessageBox(crea::std2wx(*result),_T("Change Package Version - Error!"),wxOK | wxICON_ERROR);
+ }
+ else
+ {
+ wxMessageBox(crea::std2wx("The version format is incorrect, please follow the following format:\nX.Y.Z\nX: Major Version\nY: Minor Version\nZ: Build Version"),_T("Set Project Version - Error!"),wxOK | wxICON_ERROR);
+ }
+ this->versiontc->SetLabel(crea::std2wx(this->package->GetVersion()));
+}
+
+void wxCDMPackageDescriptionPanel::OnBtnSetDescription(wxCommandEvent& event)
+{
+ //get author from user
+ wxTextEntryDialog* descDlg = new wxTextEntryDialog(
+ this,
+ wxT("Edit the package description."),
+ wxT("Change Package Description - creaDevManager"),
+ crea::std2wx(this->package->GetDescription()),
+ wxTE_MULTILINE | wxOK | wxCANCEL
+ );
+
+ if (descDlg->ShowModal() == wxID_OK)
+ {
+ std::string descriptionStr = crea::wx2std(descDlg->GetValue());
+ //check name
+ if(descriptionStr.size() > 0)
+ {
+ std::string* result;
+ if(!this->package->SetDescription(descriptionStr, result))
+ wxMessageBox(crea::std2wx(*result),_T("Change Package Description - Error!"),wxOK | wxICON_ERROR);
+ }
+ this->descriptiontc->SetLabel(crea::std2wx(this->package->GetDescription()));
+ this->descriptiontc->GetParent()->GetSizer()->RecalcSizes();
+ }
+}
+
void wxCDMPackageDescriptionPanel::OnLnkBlackBoxSelect(wxHyperlinkEvent& event)
{
int bbId = 0;
void wxCDMPackageDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl;
+ std::string* result;
+ if(!this->package->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
void wxCDMPackageDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl;
- event.Skip();
+ std::string* result;
+ if(!this->package->OpenInFileExplorer(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open Folder - Error!"),wxOK | wxICON_ERROR);
}
void wxCDMPackageDescriptionPanel::OnMouseEnter(wxMouseEvent& event)
private:
modelCDMPackage* package;
+ wxStaticText* authortc;
+ wxStaticText* versiontc;
+ wxStaticText* descriptiontc;
//handlers
protected:
void OnBtnReturn(wxCommandEvent& event);
+
+ void OnBtnSetAuthor(wxCommandEvent& event);
+ void OnBtnSetVersion(wxCommandEvent& event);
+ void OnBtnSetDescription(wxCommandEvent& event);
+
void OnLnkBlackBoxSelect(wxHyperlinkEvent& event);
+
void OnBtnCreateBlackBox(wxCommandEvent& event);
void OnBtnEditCMakeLists(wxCommandEvent& event);
void OnBtnOpenFolder(wxCommandEvent& event);
-
void OnMouseEnter(wxMouseEvent& event);
void OnMouseExit(wxMouseEvent& event);
-
void OnCMakeMouseEnter(wxMouseEvent& event);
void OnCMakeMouseExit(wxMouseEvent& event);
actionsPanelSizer->Add(createPkgbt, 0, wxALL, 5);
wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt file of this project."));
+ editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageManagerPanel::OnCMakeMouseEnter,NULL,this);
+ editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMPackageManagerPanel::OnCMakeMouseExit,NULL,this);
actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5);
actionsPanel->SetSizer(actionsPanelSizer);
void wxCDMPackageManagerPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnCreatePackage not implemented" << std::endl;
- event.Skip();
+ std::string* result;
+ if(!this->project->OpenCMakeListsFile(result))
+ wxMessageBox(crea::std2wx(*result),_T("Open CMakeLists File - Error!"),wxOK | wxICON_ERROR);
+
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->project->GetCMakeLists() != NULL)
+ {
+ int CMId = this->project->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
}
void wxCDMPackageManagerPanel::OnMouseEnter(wxMouseEvent& event)
event.Skip();
}
+void wxCDMPackageManagerPanel::OnCMakeMouseEnter(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_SELECTED);
+
+ if(this->project->GetCMakeLists() != NULL)
+ {
+ int CMId = this->project->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ event.Skip();
+}
+
+void wxCDMPackageManagerPanel::OnCMakeMouseExit(wxMouseEvent& event)
+{
+ wxCommandEvent* newEvent = new wxCommandEvent(wxEVT_COMMAND_LIST_ITEM_DESELECTED);
+
+ if(this->project->GetCMakeLists() != NULL)
+ {
+ int CMId = this->project->GetCMakeLists()->GetId();
+ newEvent->SetInt(CMId);
+ newEvent->SetId(0);
+ wxPostEvent(this->GetParent(), *newEvent);
+ }
+ event.Skip();
+}
+
void OnMouseEnter(wxMouseEvent& event);
void OnMouseExit(wxMouseEvent& event);
+ void OnCMakeMouseEnter(wxMouseEvent& event);
+ void OnCMakeMouseExit(wxMouseEvent& event);
};
#endif /* WXCDMPACKAGEMANAGERPANEL_H_ */
this->versiontc = new wxStaticText(propertiesPanel, wxID_ANY, crea::std2wx(this->project->GetVersion()));
wxButton* pVersionbt = new wxButton(propertiesPanel, ID_BUTTON_SET_VERSION, wxT("Set"));
pVersionbt->SetToolTip(wxT("Update the version of the project."));
- pVersionsz->Add(this->versiontc, 0, wxALIGN_CENTER_VERTICAL, 0);
- pVersionsz->Add(pVersionbt, 0, wxALIGN_CENTER | wxLEFT, 10);
+ pVersionsz->Add(this->versiontc, 1, wxALIGN_CENTER, 1);
+ pVersionsz->Add(pVersionbt, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10);
// versionDate
this->versionDatetc = 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));
+ //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(pSourceLocationtc, 1, wxALIGN_CENTER, 1);
pSourceLocationsz->Add(pSourceLocationbt, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10);
// buildLocation
wxBoxSizer* pBuildLocationsz = new wxBoxSizer(wxHORIZONTAL);
this->buildPathtc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetBuildPath()));
- this->buildPathtc->SetMaxSize(wxSize(350,-1));
+ //this->buildPathtc->SetMaxSize(wxSize(350,-1));
wxButton* pBuildLocationbt = new wxButton(propertiesPanel, ID_BUTTON_SET_BUILD_PATH, wxT("Choose"));
pBuildLocationbt->SetToolTip(wxT("Select a new location for compiling the project."));
- pBuildLocationsz->Add(this->buildPathtc, 0, wxALIGN_CENTER, 0);
+ pBuildLocationsz->Add(this->buildPathtc, 1, wxALIGN_CENTER, 1);
pBuildLocationsz->Add(pBuildLocationbt, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10);
propertiesGridSizer->Add(pVersion, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
propertiesGridSizer->AddGrowableCol(1,1);
- propertiesPanelSizer-> Add(propertiesGridSizer, 0, wxALL | wxEXPAND, 5);
+ propertiesPanelSizer-> Add(propertiesGridSizer, 1, wxALL | wxEXPAND, 5);
//SetPanel sizer and box
propertiesPanel->SetSizer(propertiesPanelSizer);
propertiesPanelSizer->Fit(propertiesPanel);
- propertiesBox->Add(propertiesPanel, 0, wxEXPAND);
+ propertiesBox->Add(propertiesPanel, 1, wxEXPAND);
sizer->Add(propertiesBox, 0, wxEXPAND | wxALL, 10);
//----------------------------------Project Actions--------------------------------------
// package manager
wxButton* packageMgrbt = new wxButton(actionsPanel, ID_BUTTON_GOTO_PACKAGE_MANAGER, _T("Package Manager"));
packageMgrbt->SetToolTip(wxT("Find the current available packages into this project. You can also create new Packages in this section."));
- actionsPanelSizer->Add(packageMgrbt, 0, wxALL, 5);
+ actionsPanelSizer->Add(packageMgrbt, 1, wxALL, 5);
// lib manager
// show only if there is a lib folder
if(this->project->GetLib() != NULL)
libMgrbt->SetToolTip(wxT("Find the current available libraries into this project. You can also create new Libraries in this section as well as edit the lib folder's CMakeLists.txt file."));
libMgrbt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnLibMouseEnter,NULL,this);
libMgrbt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnLibMouseExit,NULL,this);
- actionsPanelSizer->Add(libMgrbt, 0, wxALL, 5);
+ actionsPanelSizer->Add(libMgrbt, 1, wxALL, 5);
}
// appli manager
// show only if there is a appli folder
appliMgrbt->SetToolTip(wxT("Find the current available applications into this project. You can also create new Applications in this section as well as edit the appli folder's CMakeLists.txt file."));
appliMgrbt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnAppliMouseEnter,NULL,this);
appliMgrbt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnAppliMouseExit,NULL,this);
- actionsPanelSizer->Add(appliMgrbt, 0, wxALL, 5);
+ actionsPanelSizer->Add(appliMgrbt, 1, wxALL, 5);
}
// edit CMakeLists file
wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
editCMakebt->SetToolTip(wxT("Edit the CMakeLists.txt file of this project."));
editCMakebt->Connect(wxEVT_ENTER_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnCMakeMouseEnter,NULL,this);
editCMakebt->Connect(wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&wxCDMProjectDescriptionPanel::OnCMakeMouseExit,NULL,this);
- actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5);
+ actionsPanelSizer->Add(editCMakebt, 1, wxALL, 5);
//SetPanel sizer and box
actionsPanel->SetSizer(actionsPanelSizer);
actionsPanelSizer->Fit(actionsPanel);
- actionsBox->Add(actionsPanel, 0, wxALL, 5);
+ actionsBox->Add(actionsPanel, 1, wxALL | wxEXPAND, 5);
sizer->Add(actionsBox, 0, wxEXPAND | wxALL, 10);
void wxCDMProjectDescriptionPanel::OnBtnSetVersion(wxCommandEvent& event)
{
- //TODO: implement method
- std::cerr << "Event OnBtnSetVersion not implemented" << std::endl;
- event.Skip();
-
- //get name
+ //get version
wxString libraryName = wxGetTextFromUser(
wxT("Enter the new version name"),
- wxT("New Library - creaDevManager"),
+ wxT("Change Project Version - creaDevManager"),
crea::std2wx(this->project->GetVersion())
);
//check name