Fix: Auto include in corresponding CMakeLists files when creating: Libraries, Applications, Packages. It was creating additional line break characters.
Feature: Show included libraries (3rd Party and custom) and checkboxes to include them in: Applications and Libraries. Just shows a test library that doesn't really exist.
#define ID_LINK_SELECT_BLACKBOX 10333
#define ID_CHECK_INCLUDE_LIBRARY 10334
-#define ID_CHECK_INCLUDE_PACKAGE 10335
-#define ID_CHECK_INCLUDE_APPLICATION 10336
+#define ID_CHECK_INCLUDE_3RDLIBRARY 10335
+#define ID_CHECK_INCLUDE_PACKAGE 10336
+#define ID_CHECK_INCLUDE_APPLICATION 10337
-#define ID_CHECKBOX_ENABLE_HELP 10337
-#define ID_CHECKBOX_DISABLE_HELP 10338
-#define ID_CHECKBOX_TOGGLE_HELP 10339
+#define ID_CHECKBOX_ENABLE_HELP 10338
+#define ID_CHECKBOX_DISABLE_HELP 10339
+#define ID_CHECKBOX_TOGGLE_HELP 10340
-#define ID_BUTTON_CHECK_PROJECT 10340
+#define ID_BUTTON_CHECK_PROJECT 10341
#endif /* CREADEVMANAGERIDS_H_ */
while(!CMFile.eof())
{
std::getline(CMFile, line);
+ if (CMFile.eof()) {
+ break;
+ }
if(line != "")
{
std::vector<std::string> segs;
}
}
+
+std::map<std::string, bool> modelCDMApplication::Get3rdPartyLibraries()
+{
+ std::map<std::string, bool> res;
+ res["Test"] = false;
+ return res;
+}
+
+bool modelCDMApplication::Set3rdPartyLibrary(const std::string& library_name, const bool& toInclude)
+{
+ return false;
+}
+
+std::map<std::string, bool> modelCDMApplication::GetCustomLibraries()
+{
+ std::map<std::string, bool> res;
+ res["Test"] = false;
+ return res;
+}
+
+bool modelCDMApplication::SetCustomLibrary(const std::string& library_name, const bool& toInclude)
+{
+ return false;
+}
*/
void CheckStructure(std::map<std::string, bool>& properties);
+ /**
+ * Checks the application's CMakeLists file to check which third party libraries are enabled.
+ * @return A map with the name of the library and if it's included in the CMakeLists file.
+ */
+ std::map<std::string, bool> Get3rdPartyLibraries();
+
+ /**
+ * Sets the 3rd party library inclusion in the application's CMakeLists file.
+ * @return if the operation was successful.
+ */
+ bool Set3rdPartyLibrary(const std::string& library_name, const bool& toInclude);
+
+ /**
+ * Checks the application's CMakeLists file to check which custom libraries are enabled.
+ * @return A map with the name of the library and if it's included in the CMakeLists file.
+ */
+ std::map<std::string, bool> GetCustomLibraries();
+
+ /**
+ * Sets the custom library inclusion in the application's CMakeLists file.
+ * @return if the operation was successful.
+ */
+ bool SetCustomLibrary(const std::string& library_name, const bool& toInclude);
+
private:
/**
* Name of the application executable file.
while(!CMFile.eof())
{
std::getline(CMFile, line);
+ if (CMFile.eof()) {
+ break;
+ }
if(line != "")
{
std::vector<std::string> segs;
{
outs << "\n";
}
+
}
CMFile.close();
}
}
+
+std::map<std::string, bool> modelCDMLibrary::Get3rdPartyLibraries()
+{
+ std::map<std::string, bool> res;
+ res["Test"] = false;
+ return res;
+}
+
+bool modelCDMLibrary::Set3rdPartyLibrary(const std::string& library_name, const bool& toInclude)
+{
+ return false;
+}
+
+std::map<std::string, bool> modelCDMLibrary::GetCustomLibraries()
+{
+ std::map<std::string, bool> res;
+ res["Test"] = false;
+ return res;
+}
+
+bool modelCDMLibrary::SetCustomLibrary(const std::string& library_name, const bool& toInclude)
+{
+ return false;
+}
*/
void CheckStructure(std::map<std::string, bool>& properties);
+ /**
+ * Checks the library CMakeLists file to check which third party libraries are enabled.
+ * @return A map with the name of the library and if it's included in the CMakeLists file.
+ */
+ std::map<std::string, bool> Get3rdPartyLibraries();
+
+ /**
+ * Sets the 3rd party library inclusion in the CMakeLists file.
+ * @return if the operation was successful.
+ */
+ bool Set3rdPartyLibrary(const std::string& library_name, const bool& toInclude);
+
+ /**
+ * Checks the library CMakeLists file to check which custom libraries are enabled.
+ * @return A map with the name of the library and if it's included in the CMakeLists file.
+ */
+ std::map<std::string, bool> GetCustomLibraries();
+
+ /**
+ * Sets the custom library inclusion in the CMakeLists file.
+ * @return if the operation was successful.
+ */
+ bool SetCustomLibrary(const std::string& library_name, const bool& toInclude);
+
private:
/**
* Name of the library node. The name of a library can be different than the library folder name.
while(!CMFile.eof())
{
std::getline(CMFile, line);
+ if (CMFile.eof()) {
+ break;
+ }
if(line != "")
{
std::vector<std::string> segs;
EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMApplicationDescriptionPanel::OnBtnEditCMakeLists)
EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMApplicationDescriptionPanel::OnBtnOpenFolder)
EVT_BUTTON(ID_BUTTON_OPEN_CXX, wxCDMApplicationDescriptionPanel::OnBtnOpenMain)
+EVT_CHECKBOX(ID_CHECK_INCLUDE_3RDLIBRARY, wxCDMApplicationDescriptionPanel::On3rdLibraryChBChange)
+EVT_CHECKBOX(ID_CHECK_INCLUDE_LIBRARY, wxCDMApplicationDescriptionPanel::OnLibraryChBChange)
END_EVENT_TABLE()
wxCDMApplicationDescriptionPanel::wxCDMApplicationDescriptionPanel(
propertiesBox->Add(propertiesPanel, 0, wxEXPAND);
sizer->Add(propertiesBox, 0, wxEXPAND | wxALL, 10);
*/
+
+ //Includes
+ wxStaticBoxSizer* includesBox = new wxStaticBoxSizer(wxHORIZONTAL, this, wxT("&Used Libraries"));
+ wxPanel* includesPanel = new wxPanel(this);
+ wxBoxSizer* includesPanelSizer = new wxBoxSizer(wxVERTICAL);
+
+ //Third Party Libraries
+ wxStaticText* Title1 = new wxStaticText(includesPanel, wxID_ANY, wxT("Third Party Libraries:"));
+ wxFont font = Title1->GetFont();
+ font.SetWeight(wxFONTWEIGHT_BOLD);
+ Title1->SetFont(font);
+ includesPanelSizer->Add(Title1, 0, wxEXPAND | wxALL, 5);
+
+ //inclusion data
+ std::map<std::string, bool> inclusions = this->application->Get3rdPartyLibraries();
+ //includesGrid Sizer
+ wxFlexGridSizer* includesGridSizer = new wxFlexGridSizer(inclusions.size()+1, 2, 0, 5);
+
+ wxStaticText* ChBTitle = new wxStaticText(
+ includesPanel,
+ wxID_ANY,
+ wxT("Included"),
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_CENTER
+ );
+ wxStaticText* LNmTitle = new wxStaticText(
+ includesPanel,
+ wxID_ANY,
+ wxT("Library Name"),
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_LEFT
+ );
+
+ includesGridSizer->Add(ChBTitle, 1, wxEXPAND);
+ includesGridSizer->Add(LNmTitle, 1, wxEXPAND);
+
+ for (std::map<std::string, bool>::iterator it = inclusions.begin(); it != inclusions.end(); ++it) {
+ wxCheckBox* ChBIncl = new wxCheckBox(
+ includesPanel, ID_CHECK_INCLUDE_3RDLIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
+ );
+ ChBIncl->SetToolTip(crea::std2wx("When this box is checked the " + it->first + " library is included in the project configuration for this application."));
+ ChBIncl->SetName(crea::std2wx(it->first));
+ ChBIncl->SetValue(it->second);
+ includesGridSizer->Add(ChBIncl, 1, wxEXPAND);
+
+ wxStaticText* LNmIncl = new wxStaticText(includesPanel, wxID_ANY, crea::std2wx(it->first));
+ includesGridSizer->Add(LNmIncl, 1, wxEXPAND);
+ }
+
+ includesGridSizer->AddGrowableCol(1,1);
+
+ includesPanelSizer->Add(includesGridSizer, 1, wxEXPAND, 0);
+
+ //Custom Libraries
+ wxStaticText* Title2 = new wxStaticText(includesPanel, wxID_ANY, wxT("Custom Libraries:"));
+ font = Title2->GetFont();
+ font.SetWeight(wxFONTWEIGHT_BOLD);
+ Title2->SetFont(font);
+ includesPanelSizer->Add(Title2, 0, wxEXPAND | wxALL, 5);
+
+ //inclusion data
+ std::map<std::string, bool> inclusionsLibs = this->application->GetCustomLibraries();
+ //includesGrid Sizer
+ wxFlexGridSizer* includesLibGridSizer = new wxFlexGridSizer(inclusionsLibs.size()+1, 2, 0, 5);
+
+ wxStaticText* ChBTitle1 = new wxStaticText(
+ includesPanel,
+ wxID_ANY,
+ wxT("Included"),
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_CENTER
+ );
+ wxStaticText* LNmTitle1 = new wxStaticText(
+ includesPanel,
+ wxID_ANY,
+ wxT("Library Name"),
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_LEFT
+ );
+
+ includesLibGridSizer->Add(ChBTitle1, 1, wxEXPAND);
+ includesLibGridSizer->Add(LNmTitle1, 1, wxEXPAND);
+
+ for (std::map<std::string, bool>::iterator it = inclusionsLibs.begin(); it != inclusionsLibs.end(); ++it) {
+ wxCheckBox* ChBIncl = new wxCheckBox(
+ includesPanel, ID_CHECK_INCLUDE_LIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
+ );
+ ChBIncl->SetToolTip(crea::std2wx("When this box is checked the " + it->first + " custom library is included in the project configuration for this application."));
+ ChBIncl->SetName(crea::std2wx(it->first));
+ ChBIncl->SetValue(it->second);
+ includesLibGridSizer->Add(ChBIncl, 1, wxEXPAND);
+
+ wxStaticText* LNmIncl = new wxStaticText(includesPanel, wxID_ANY, crea::std2wx(it->first));
+ includesLibGridSizer->Add(LNmIncl, 1, wxEXPAND);
+ }
+
+ includesLibGridSizer->AddGrowableCol(1,1);
+
+ includesPanelSizer->Add(includesLibGridSizer, 1, wxEXPAND, 0);
+
+ includesPanel->SetSizer(includesPanelSizer);
+ includesPanelSizer->Fit(includesPanel);
+ includesBox->Add(includesPanel, 1, wxEXPAND);
+ sizer -> Add(includesBox, 0, wxALL | wxEXPAND, 10);
+
+
//Actions
//actions StaticBoxSizer
wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Actions"));
this->executableNametc->SetLabel(crea::std2wx(this->application->GetExecutableName()));
}
+void wxCDMApplicationDescriptionPanel::On3rdLibraryChBChange(wxCommandEvent& event)
+{
+ this->application->Set3rdPartyLibrary(crea::wx2std(((wxCheckBox*)event.GetEventObject())->GetName()), ((wxCheckBox*)event.GetEventObject())->GetValue());
+}
+
+void wxCDMApplicationDescriptionPanel::OnLibraryChBChange(wxCommandEvent& event)
+{
+ this->application->SetCustomLibrary(crea::wx2std(((wxCheckBox*)event.GetEventObject())->GetName()), ((wxCheckBox*)event.GetEventObject())->GetValue());
+}
+
void wxCDMApplicationDescriptionPanel::OnBtnCreateClass(wxCommandEvent& event)
{
//get class name from user
/**
* Handles when the set executable name button is pressed.
+ * @param event Unused
*/
void OnBtnSetExeName(wxCommandEvent& event);
+ /**
+ * Handles when a 3rd Party Library checkbox state is changed. It calls to include/exclude the selected application.
+ * @param event CheckBox event.
+ */
+ void On3rdLibraryChBChange(wxCommandEvent& event);
+ /**
+ * Handles when a Custom Library checkbox state is changed. It calls to include/exclude the selected application.
+ * @param event CheckBox event.
+ */
+ void OnLibraryChBChange(wxCommandEvent& event);
/**
* Handles when the create class button is pressed.
*/
EVT_BUTTON(ID_BUTTON_CREATE_FOLDER, wxCDMLibraryDescriptionPanel::OnBtnCreateFolder)
EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMLibraryDescriptionPanel::OnBtnEditCMakeLists)
EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMLibraryDescriptionPanel::OnBtnOpenFolder)
+EVT_CHECKBOX(ID_CHECK_INCLUDE_3RDLIBRARY, wxCDMLibraryDescriptionPanel::On3rdLibraryChBChange)
+EVT_CHECKBOX(ID_CHECK_INCLUDE_LIBRARY, wxCDMLibraryDescriptionPanel::OnLibraryChBChange)
END_EVENT_TABLE()
wxCDMLibraryDescriptionPanel::wxCDMLibraryDescriptionPanel(
propertiesBox->Add(propertiesPanel, 0, wxEXPAND);
sizer->Add(propertiesBox, 0, wxEXPAND | wxALL, 10);
*/
+
+ //Includes
+ wxStaticBoxSizer* includesBox = new wxStaticBoxSizer(wxHORIZONTAL, this, wxT("&Used Libraries"));
+ wxPanel* includesPanel = new wxPanel(this);
+ wxBoxSizer* includesPanelSizer = new wxBoxSizer(wxVERTICAL);
+
+ //Third Party Libraries
+ wxStaticText* Title1 = new wxStaticText(includesPanel, wxID_ANY, wxT("Third Party Libraries:"));
+ wxFont font = Title1->GetFont();
+ font.SetWeight(wxFONTWEIGHT_BOLD);
+ Title1->SetFont(font);
+ includesPanelSizer->Add(Title1, 0, wxEXPAND | wxALL, 5);
+
+ //inclusion data
+ std::map<std::string, bool> inclusions = this->library->Get3rdPartyLibraries();
+ //includesGrid Sizer
+ wxFlexGridSizer* includesGridSizer = new wxFlexGridSizer(inclusions.size()+1, 2, 0, 5);
+
+ wxStaticText* ChBTitle = new wxStaticText(
+ includesPanel,
+ wxID_ANY,
+ wxT("Included"),
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_CENTER
+ );
+ wxStaticText* LNmTitle = new wxStaticText(
+ includesPanel,
+ wxID_ANY,
+ wxT("Library Name"),
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_LEFT
+ );
+
+ includesGridSizer->Add(ChBTitle, 1, wxEXPAND);
+ includesGridSizer->Add(LNmTitle, 1, wxEXPAND);
+
+ for (std::map<std::string, bool>::iterator it = inclusions.begin(); it != inclusions.end(); ++it) {
+ wxCheckBox* ChBIncl = new wxCheckBox(
+ includesPanel, ID_CHECK_INCLUDE_3RDLIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
+ );
+ ChBIncl->SetToolTip(crea::std2wx("When this box is checked the " + it->first + " library is included in the project configuration for this library."));
+ ChBIncl->SetName(crea::std2wx(it->first));
+ ChBIncl->SetValue(it->second);
+ includesGridSizer->Add(ChBIncl, 1, wxEXPAND);
+
+ wxStaticText* LNmIncl = new wxStaticText(includesPanel, wxID_ANY, crea::std2wx(it->first));
+ includesGridSizer->Add(LNmIncl, 1, wxEXPAND);
+ }
+
+ includesGridSizer->AddGrowableCol(1,1);
+
+ includesPanelSizer->Add(includesGridSizer, 1, wxEXPAND, 0);
+
+ //Custom Libraries
+ wxStaticText* Title2 = new wxStaticText(includesPanel, wxID_ANY, wxT("Custom Libraries:"));
+ font = Title2->GetFont();
+ font.SetWeight(wxFONTWEIGHT_BOLD);
+ Title2->SetFont(font);
+ includesPanelSizer->Add(Title2, 0, wxEXPAND | wxALL, 5);
+
+ //inclusion data
+ std::map<std::string, bool> inclusionsLibs = this->library->GetCustomLibraries();
+ //includesGrid Sizer
+ wxFlexGridSizer* includesLibGridSizer = new wxFlexGridSizer(inclusionsLibs.size()+1, 2, 0, 5);
+
+ wxStaticText* ChBTitle1 = new wxStaticText(
+ includesPanel,
+ wxID_ANY,
+ wxT("Included"),
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_CENTER
+ );
+ wxStaticText* LNmTitle1 = new wxStaticText(
+ includesPanel,
+ wxID_ANY,
+ wxT("Library Name"),
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxALIGN_LEFT
+ );
+
+ includesLibGridSizer->Add(ChBTitle1, 1, wxEXPAND);
+ includesLibGridSizer->Add(LNmTitle1, 1, wxEXPAND);
+
+ for (std::map<std::string, bool>::iterator it = inclusionsLibs.begin(); it != inclusionsLibs.end(); ++it) {
+ wxCheckBox* ChBIncl = new wxCheckBox(
+ includesPanel, ID_CHECK_INCLUDE_LIBRARY, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT
+ );
+ ChBIncl->SetToolTip(crea::std2wx("When this box is checked the " + it->first + " custom library is included in the project configuration for this library."));
+ ChBIncl->SetName(crea::std2wx(it->first));
+ ChBIncl->SetValue(it->second);
+ includesLibGridSizer->Add(ChBIncl, 1, wxEXPAND);
+
+ wxStaticText* LNmIncl = new wxStaticText(includesPanel, wxID_ANY, crea::std2wx(it->first));
+ includesLibGridSizer->Add(LNmIncl, 1, wxEXPAND);
+ }
+
+ includesLibGridSizer->AddGrowableCol(1,1);
+
+ includesPanelSizer->Add(includesLibGridSizer, 1, wxEXPAND, 0);
+
+ includesPanel->SetSizer(includesPanelSizer);
+ includesPanelSizer->Fit(includesPanel);
+ includesBox->Add(includesPanel, 1, wxEXPAND);
+ sizer -> Add(includesBox, 0, wxALL | wxEXPAND, 10);
+
+
+
//Actions
wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxHORIZONTAL, this, wxT("&Actions"));
wxPanel* actionsPanel = new wxPanel(this);
this->libraryNametc->SetLabel(crea::std2wx(this->library->GetNameLibrary()));
}
+void wxCDMLibraryDescriptionPanel::On3rdLibraryChBChange(wxCommandEvent& event)
+{
+ this->library->Set3rdPartyLibrary(crea::wx2std(((wxCheckBox*)event.GetEventObject())->GetName()), ((wxCheckBox*)event.GetEventObject())->GetValue());
+}
+
+void wxCDMLibraryDescriptionPanel::OnLibraryChBChange(wxCommandEvent& event)
+{
+ this->library->SetCustomLibrary(crea::wx2std(((wxCheckBox*)event.GetEventObject())->GetName()), ((wxCheckBox*)event.GetEventObject())->GetValue());
+}
+
void wxCDMLibraryDescriptionPanel::OnBtnCreateClass(wxCommandEvent& event)
{
//get class name from user
* @param event Unused.
*/
void OnBtnSetExeName(wxCommandEvent& event);
+ /**
+ * Handles when a 3rd Party Library checkbox state is changed. It calls to include/exclude the selected library.
+ * @param event CheckBox event.
+ */
+ void On3rdLibraryChBChange(wxCommandEvent& event);
+ /**
+ * Handles when a Custom Library checkbox state is changed. It calls to include/exclude the selected library.
+ * @param event CheckBox event.
+ */
+ void OnLibraryChBChange(wxCommandEvent& event);
/**
* Handles when the create class button is pressed.
* @param event Unused.
);
auiManager.AddPane(panel_Properties, wxAuiPaneInfo().BestSize(600,400).CenterPane().Name(wxT("panel_Properties")).Caption(wxT("")).CloseButton(false));
- auiManager.AddPane(tree_Projects, wxAuiPaneInfo().Right().MinSize(300,300).BestSize(300,400).CloseButton(false).Name(wxT("tree_Projects")).Caption(wxT("Project Tree")).CloseButton(false));
+ auiManager.AddPane(tree_Projects, wxAuiPaneInfo().Left().MinSize(300,300).BestSize(300,400).CloseButton(false).Name(wxT("tree_Projects")).Caption(wxT("Project Tree")).CloseButton(false));
auiManager.Update();
//auiManager.LoadPerspective(pers,true);
wxToolTip::Enable(true);