EVT_BUTTON(ID_BUTTON_GOTO_LIB_MANAGER, wxCDMProjectDescriptionPanel::OnBtnManageLibraries)
EVT_BUTTON(ID_BUTTON_GOTO_APPLI_MANAGER, wxCDMProjectDescriptionPanel::OnBtnManageApplications)
EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists)
-
+EVT_BUTTON(ID_BUTTON_SET_BUILD_PATH, wxCDMProjectDescriptionPanel::OnBtnSetBuildPath)
+EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMProjectDescriptionPanel::OnBtnOpenFolder)
+EVT_BUTTON(ID_BUTTON_SET_VERSION, wxCDMProjectDescriptionPanel::OnBtnSetVersion)
END_EVENT_TABLE()
wxCDMProjectDescriptionPanel::wxCDMProjectDescriptionPanel(
// versionDate
wxStaticText* pVersionDatetc = 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));
+ 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(pSourceLocationbt, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, 10);
// buildLocation
wxBoxSizer* pBuildLocationsz = new wxBoxSizer(wxHORIZONTAL);
wxStaticText* pBuildLocationtc = new wxStaticText(propertiesPanel, -1, crea::std2wx(this->project->GetBuildPath()));
propertiesGridSizer->Add(pVersionDate, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
propertiesGridSizer->Add(pVersionDatetc, 1, wxEXPAND);
propertiesGridSizer->Add(pSourceLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
- propertiesGridSizer->Add(pSourceLocationtc, 1, wxEXPAND);
+ propertiesGridSizer->Add(pSourceLocationsz, 1, wxEXPAND);
propertiesGridSizer->Add(pBuildLocation, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
propertiesGridSizer->Add(pBuildLocationsz, 1, wxEXPAND);
//SetPanel sizer and box
propertiesPanel->SetSizer(propertiesPanelSizer);
propertiesPanelSizer->Fit(propertiesPanel);
- propertiesBox->Add(propertiesPanel, 1, wxEXPAND);
+ propertiesBox->Add(propertiesPanel, 0, wxEXPAND);
sizer->Add(propertiesBox, 0, wxEXPAND | wxALL, 10);
//----------------------------------Project Actions--------------------------------------
//actions StaticBoxSizer
wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxHORIZONTAL,this, _T("&Actions"));
+ actionsBox->GetStaticBox()->SetToolTip(wxT("Go to any of the content managers of the project or edit the project's CMakeLists.txt file by selecting any of the available actions."));
//actions Panel
wxPanel* actionsPanel = new wxPanel(this);
//actions Sizer
//SetPanel sizer and box
actionsPanel->SetSizer(actionsPanelSizer);
actionsPanelSizer->Fit(actionsPanel);
- actionsBox->Add(actionsPanel, 1, wxEXPAND);
+ actionsBox->Add(actionsPanel, 0, wxALL, 5);
sizer->Add(actionsBox, 0, wxEXPAND | wxALL, 10);
sizer->SetSizeHints(this);
}
-
-void wxCDMProjectDescriptionPanel::OnBtnCreateLibrary(wxCommandEvent& event)
-{
- //get name
- wxString libraryName = wxGetTextFromUser(
- _T("Enter the new library name"),
- _T("New Library - creaDevManager"),
- _T("")
- );
- //check name
- if(libraryName.Len() > 0)
- {
- 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();
- }
-}
-
-void wxCDMProjectDescriptionPanel::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->project->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->SetInt(application->GetId());
- wxPostEvent(this->GetParent(), *newEvent);
- event.Skip();
- }
-}
-
-void wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
-{
- //TODO: implement method
- std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl;
- event.Skip();
-}
-
void
wxCDMProjectDescriptionPanel::OnBtnManagePackages(wxCommandEvent& event)
{
wxPostEvent(this->GetParent(), *newEvent);
event.Skip();
}
+
+void wxCDMProjectDescriptionPanel::OnBtnEditCMakeLists(wxCommandEvent& event)
+{
+ //TODO: implement method
+ std::cerr << "Event OnBtnEditCMakeLists not implemented" << std::endl;
+ event.Skip();
+}
+
+void
+wxCDMProjectDescriptionPanel::OnBtnSetBuildPath(wxCommandEvent& event)
+{
+ //TODO: implement method
+ std::cerr << "Event OnBtnSetBuildPath not implemented" << std::endl;
+ event.Skip();
+}
+
+void
+wxCDMProjectDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
+{
+ //TODO: implement method
+ std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl;
+ event.Skip();
+}
+
+void
+wxCDMProjectDescriptionPanel::OnBtnSetVersion(wxCommandEvent& event)
+{
+ //TODO: implement method
+ std::cerr << "Event OnBtnSetVersion not implemented" << std::endl;
+ event.Skip();
+}