]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/wxCDMAppliDescriptionPanel.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / wxCDMAppliDescriptionPanel.cpp
index 249ddfef5943a9e8aaa291b3ca015171938db968..778525fe842d8b309ea8a5017bb5a4daedc904de 100644 (file)
@@ -44,6 +44,7 @@ EVT_BUTTON(ID_BUTTON_PREV, wxCDMAppliDescriptionPanel::OnBtnReturn)
 EVT_HYPERLINK(ID_LINK_SELECT_APPLICATION, wxCDMAppliDescriptionPanel::OnLnkApplicationSelect)
 EVT_BUTTON(ID_BUTTON_CREATE_APPLICATION, wxCDMAppliDescriptionPanel::OnBtnCreateApplication)
 EVT_BUTTON(ID_BUTTON_EDIT_CMAKELISTSFILE, wxCDMAppliDescriptionPanel::OnBtnEditCMakeLists)
+EVT_BUTTON(ID_BUTTON_OPEN_FOLDER, wxCDMAppliDescriptionPanel::OnBtnOpenFolder)
 END_EVENT_TABLE()
 
 wxCDMAppliDescriptionPanel::wxCDMAppliDescriptionPanel(
@@ -89,39 +90,54 @@ void wxCDMAppliDescriptionPanel::CreateControls()
   sizer->Add(returnbt, 0, wxALIGN_CENTER | wxALL, 5);
 
   //Title
-  sizer->Add(new wxStaticText(this, -1, _("Applications")),0, wxALIGN_CENTER, 0);
+  sizer->Add(new wxStaticText(this, -1, _("Application Management")),0, wxALIGN_CENTER, 0);
 
   //Image
   sizer->Add(new wxStaticBitmap(this, -1, wxBitmap(ApIcon64)),0, wxALIGN_CENTER, 0);
 
   //Applications
-  wxStaticBox* propertiesBox = new wxStaticBox(this, -1, _T("&Available Applications"));
-  wxStaticBoxSizer* propertiesBoxInnerSizer = new wxStaticBoxSizer(propertiesBox, wxVERTICAL);
+  wxStaticBoxSizer* propertiesBox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("A&vailable Applications"));
+  propertiesBox->GetStaticBox()->SetToolTip(wxT("Select any of the available applications to see its details or the modify them."));
+  wxPanel* propertiesPanel = new wxPanel(this);
+  wxBoxSizer* propertiesPanelSizer = new wxBoxSizer(wxVERTICAL);
 
   std::vector<modelCDMApplication*> applications = this->appli->GetApplications();
   for (int i = 0; i < applications.size(); i++)
     {
-      wxHyperlinkCtrl* pLibrarylk = new wxHyperlinkCtrl(this,ID_LINK_SELECT_APPLICATION, crea::std2wx(applications[i]->GetName().c_str()), crea::std2wx(applications[i]->GetName().c_str()));
-      propertiesBoxInnerSizer -> Add(pLibrarylk, 0, wxALIGN_LEFT | wxALL, 5);
+      wxHyperlinkCtrl* pLibrarylk = new wxHyperlinkCtrl(propertiesPanel,ID_LINK_SELECT_APPLICATION, crea::std2wx(applications[i]->GetName().c_str()), crea::std2wx(applications[i]->GetName().c_str()));
+      std::string tt = "Name: " + applications[i]->GetName() + "\n";
+      tt += "Location: " + applications[i]->GetPath();
+      pLibrarylk->SetToolTip(crea::std2wx(tt.c_str()));
+      propertiesPanelSizer -> Add(pLibrarylk, 0, wxALIGN_LEFT | wxALL, 5);
     }
 
-  sizer -> Add(propertiesBoxInnerSizer, 0, wxEXPAND | wxALL, 10);
+  propertiesPanel->SetSizer(propertiesPanelSizer);
+  propertiesPanelSizer->Fit(propertiesPanel);
+  propertiesBox->Add(propertiesPanel, 0, wxALL, 5);
+  sizer -> Add(propertiesBox, 0, wxEXPAND | wxALL, 10);
 
   //Actions
-  wxStaticBox* actionsBox = new wxStaticBox(this, -1, _T("&Actions"));
-  wxStaticBoxSizer* actionsBoxInnerSizer = new wxStaticBoxSizer(actionsBox, wxVERTICAL);
-  sizer -> Add(actionsBoxInnerSizer, 1, wxEXPAND | wxALL, 20);
+  wxStaticBoxSizer* actionsBox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Actions"));
+  actionsBox->GetStaticBox()->SetToolTip(wxT("Create a new application or make any change to the appli's CMakeLists.txt file by selecting the desired action."));
+  wxPanel* actionsPanel = new wxPanel(this);
+  wxBoxSizer* actionsPanelSizer = new wxBoxSizer(wxHORIZONTAL);
 
-  wxButton* createApplicationbt = new wxButton(this, ID_BUTTON_CREATE_APPLICATION, _T("Create Application"));
+  wxButton* createApplicationbt = new wxButton(actionsPanel, ID_BUTTON_CREATE_APPLICATION, _T("Create Application"));
   createApplicationbt->SetToolTip(wxT("Create a new application for this project."));
-  actionsBoxInnerSizer->Add(createApplicationbt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20);
-  wxButton* editCMakebt = new wxButton(this, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
+  actionsPanelSizer->Add(createApplicationbt, 0, wxALL, 5);
+  wxButton* editCMakebt = new wxButton(actionsPanel, ID_BUTTON_EDIT_CMAKELISTSFILE, _T("Edit CMakeLists File"));
   editCMakebt->SetToolTip(wxT("Open the system default text editor to edit the CMakeLists.txt file."));
-  actionsBoxInnerSizer->Add(editCMakebt, 0, wxEXPAND | wxRIGHT | wxLEFT, 20);
+  actionsPanelSizer->Add(editCMakebt, 0, wxALL, 5);
+  wxButton* openFolderbt = new wxButton(actionsPanel, ID_BUTTON_OPEN_FOLDER, _T("Open Applications Folder"));
+  openFolderbt->SetToolTip(wxT("Open the appli folder in the file explorer."));
+  actionsPanelSizer->Add(openFolderbt, 0, wxALL, 5);
 
-  //Assign sizer
-  actionsBoxInnerSizer->SetSizeHints(this);
+  actionsPanel->SetSizer(actionsPanelSizer);
+  actionsPanelSizer->Fit(actionsPanel);
+  actionsBox->Add(actionsPanel, 0, wxALL, 5);
+  sizer -> Add(actionsBox, 0, wxEXPAND | wxALL, 10);
 
+  //Assign sizer
   SetSizer(sizer);
   sizer->SetSizeHints(this);
 }
@@ -194,3 +210,11 @@ void wxCDMAppliDescriptionPanel::OnBtnReturn(wxCommandEvent& event)
   newEvent->SetId(0);
   wxPostEvent(this->GetParent(), *newEvent);
 }
+
+void
+wxCDMAppliDescriptionPanel::OnBtnOpenFolder(wxCommandEvent& event)
+{
+  //TODO: implement method
+  std::cerr << "Event OnBtnOpenFolder not implemented" << std::endl;
+  event.Skip();
+}