std::vector<modelCDMIProjectTreeNode*> parents = this->appli->GetParents();
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()));
+ 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 < (int)(parents.size())-1)
std::vector<modelCDMApplication*> applications = this->appli->GetApplications();
for (int i = 0; i < (int)(applications.size()); i++)
{
- wxHyperlinkCtrl* pApplicationlk = new wxHyperlinkCtrl(propertiesPanel,ID_LINK_SELECT_APPLICATION, crea::std2wx(applications[i]->GetName().c_str()), crea::std2wx(applications[i]->GetName().c_str()));
- pApplicationlk->SetWindowStyle(wxALIGN_LEFT);
+ wxHyperlinkCtrl* pApplicationlk = new wxHyperlinkCtrl(propertiesPanel,ID_LINK_SELECT_APPLICATION, crea::std2wx(applications[i]->GetName().c_str()), crea::std2wx(applications[i]->GetName().c_str()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE);
+ pApplicationlk->SetWindowStyle(wxALIGN_LEFT | wxNO_BORDER);
std::string tt = "Name: " + applications[i]->GetName() + "\n";
tt += "Location: " + applications[i]->GetPath();
pApplicationlk->SetToolTip(crea::std2wx(tt.c_str()));
void wxCDMAppliDescriptionPanel::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->appli->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->SetClientData(application);
- wxPostEvent(this->GetParent(), *newEvent);
- event.Skip();
- }
+ wxTextEntryDialog* appDlg = new wxTextEntryDialog(
+ this,
+ wxT("Enter the new application name (NO white spaces)"),
+ wxT("New Application - creaDevManager"),
+ wxT(""),
+ wxOK | wxCANCEL
+ );
+
+ if (appDlg->ShowModal() == wxID_OK)
+ {
+ std::string applicationName = crea::wx2std(appDlg->GetValue());
+ //check name
+ if(applicationName.size() > 0)
+ {
+ wxArrayString types;
+ types.Add(wxT("Console Application"));
+ types.Add(wxT("GUI Application (wxWidgets)"));
+ int applicationType = wxGetSingleChoiceIndex(
+ wxT("Select the application type"),
+ wxT("New Application - creaDevManager"),
+ types
+ );
+
+ if (applicationType != -1)
+ {
+ std::string* result;
+ //create library
+ modelCDMIProjectTreeNode* application = this->appli->CreateApplication(applicationName, applicationType ,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->SetClientData(application);
+ wxPostEvent(this->GetParent(), *newEvent);
+ event.Skip();
+ }
+ }
+ else
+ {
+ wxMessageBox(crea::std2wx("Invalid application name, please try again with a valid name."),_T("New Application - Error!"),wxOK | wxICON_INFORMATION);
+ }
+ }
}
void wxCDMAppliDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)