#include "wxCDMMainFrame.h"
#include "creaDevManagerIds.h"
-#include "images/PrIcon.xpm"
+#include "images/PrIcon64.xpm"
BEGIN_EVENT_TABLE(wxCDMProjectDescriptionPanel, wxPanel)
EVT_BUTTON(ID_BUTTON_CREATE_PACKAGE, wxCDMProjectDescriptionPanel::OnBtnCreatePackage)
sizer->Add(new wxStaticText(this, -1, _("Project")),0, wxALIGN_CENTER, 0);
//Image
- sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(PrIcon)),0, wxALIGN_CENTER, 0);
+ sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(PrIcon64)),0, wxALIGN_CENTER, 0);
//Project Name
sizer->Add(new wxStaticText(this, -1, crea::std2wx(this->project->GetName())),0, wxALIGN_CENTER, 0);
void wxCDMProjectDescriptionPanel::OnBtnCreateLibrary(wxCommandEvent& event)
{
- //implement method
- std::cerr << "Event OnBtnCreatePackage not implemented" << std::endl;
+ //get name
wxString libraryName = wxGetTextFromUser(
_T("Enter the new library name"),
_T("New Library - creaDevManager"),
_T("")
);
- std::string* result;
- modelCDMIProjectTreeNode* library = this->project->CreateLibrary(crea::wx2std(libraryName),result);
- if(library == NULL)
+ //check name
+ if(libraryName.Len() > 0)
{
- wxMessageBox(crea::std2wx(*result),_T("New Library - Error!"),wxOK | wxICON_ERROR);
+ 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();
- return;
}
- wxMessageBox(crea::std2wx("Library successfully created."),_T("New Library - Success!"),wxOK | wxICON_INFORMATION);
-
- //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)