Index: /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc	(revision 406)
+++ /Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc	(revision 407)
@@ -83,5 +83,5 @@
   if (a<0) return;
   if (a>= jobList_.size()) return;
-  delete jobList_[a];
+  jobList_.erase (jobList_.begin()+a);
 }
 
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h	(revision 406)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_pspaApplication.h	(revision 407)
@@ -103,5 +103,4 @@
   void dessinerPhaseSpace();
 
-  void old_dessinerHistogramme();
   void dessinerHistogramme();
 
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sectionToExecute.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sectionToExecute.h	(revision 406)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_sectionToExecute.h	(revision 407)
@@ -11,5 +11,5 @@
 {
     public :
-    GWt_sectionToExecute(Wt::WComboBox*,Wt::WComboBox*,Wt::WComboBox*,GWt_softwarePanel* sPanel);
+    GWt_sectionToExecute(Wt::WComboBox*,Wt::WComboBox*,Wt::WComboBox*,Wt::WContainerWidget* buttonPanel,GWt_softwarePanel* sPanel);
 
     ~GWt_sectionToExecute() {;}
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h	(revision 406)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_softwarePanel.h	(revision 407)
@@ -34,5 +34,5 @@
     //    void checkSectionSelection();
     bool updateSectionSelection();
-    void deleteSectionToExecuteW();
+    void deleteSectionToExecuteW(int section);
     string getSelection();
     void executer();
@@ -40,5 +40,5 @@
     void fillComboWithElements(Wt::WComboBox* cBox);
     void fillComboWithSoftwares(Wt::WComboBox* cBox);
-    Wt::WContainerWidget* createAddDeletePushButtons();
+    Wt::WContainerWidget* createAddDeletePushButtons(int sectionIndex);
 
     dataManager* dtmanage_;
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc	(revision 406)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc	(revision 407)
@@ -2,4 +2,5 @@
 #include <string.h>
 #include <vector>
+#include <ctime>
 
 #include "GWt_pspaApplication.h"
@@ -575,5 +576,7 @@
 {
   
-  GWt_dialog* envDialog = new GWt_dialog("enveloppe",toto,false);
+  std::time_t result = std::time(NULL);
+  
+  GWt_dialog* envDialog = new GWt_dialog(WString("enveloppe&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(")+std::asctime(std::localtime(&result))+")",toto,false);
   eDialog_.push_back(envDialog);
   envDialog->setMinimumSize(400,400);
@@ -618,6 +621,7 @@
     return;
   }
-
-  GWt_dialog* phaseSpaceDialog = new GWt_dialog("phase space",toto,false);
+  
+  std::time_t result = std::time(NULL);
+  GWt_dialog* phaseSpaceDialog = new GWt_dialog(WString("phase space&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(")+std::asctime(std::localtime(&result))+")",toto,false);
   eDialog_.push_back(phaseSpaceDialog);
   phaseSpaceDialog->setMinimumSize(400,400);
@@ -852,135 +856,5 @@
 }
 
-void PspaApplication::old_dessinerHistogramme()
-{
-  // pour mon test : histo en energie
-  toto_->clear();
-  
-  GWt_dialog* histoDialog = new GWt_dialog("histogramme",toto_,false);
-  eDialog_.push_back(histoDialog);
-  histoDialog->setMinimumSize(400,400);
-  histoDialog->setClosable(true);
-  
-  // int index = choixHistoDessin_->currentIndex();    
-  // particleBeam* beam = dtmanage_->getDiagnosticBeam(index);
-   string elementLabel = choixHistoDessin_->currentText().toUTF8();    
-   particleBeam* beam = dtmanage_->getDiagnosticBeam(elementLabel);
-  if (beam == NULL) {
-    GWt_dialog warningBeamState("histogram","the beam does not exist at the end of this element !", GWt_dialog::Error, false,true);
-    warningBeamState.exec();
-    return;
-  }
-  
-  if (!beam->particleRepresentationOk()) {
-    GWt_dialog warningBeamState("histogram", "the beam state does not allow providing a drawing with macroparticles !", GWt_dialog::Error, false,true);
-    warningBeamState.exec();
-    return;
-  }
-
-  histoDialog->show();
-  vector<double> xcor;
-  vector<int> hist;
-  double out[3]= {0.0};
-
-  unsigned iabs= choixVariableHisto_->currentIndex();  
-  beam->histogramme(iabs,xcor,hist,out);
-
-  cout<<"xcor.size()= "<<xcor.size()<<", hist.size()= "<<hist.size()<<endl;
-  //////////////////////////////////////////////////////////////////////////////////
-
-  WContainerWidget *w= histoDialog->contents();
-  int n = hist.size();
-  int nbpts= 2*(n+1);
-  WStandardItemModel *model = new WStandardItemModel(nbpts,2,w);
-
-  int j= 0;
-  model->setData(j,0,xcor[0]);
-  model->setData(j,1,0.0);
-  j++;
-  model->setData(j,0,xcor[0]);
-  model->setData(j,1,hist[0]);
-  j++;
-
-  for (int i = 1; i < n; ++i) {
-    model->setData(j,0,xcor[i]);
-    model->setData(j,1,hist[i-1]);
-    j++;
-    model->setData(j,0,xcor[i]);
-    model->setData(j,1,hist[i]);
-    j++;
-  }
-
-  model->setData(j,0,xcor[n]);
-  model->setData(j,1,hist[n-1]);
-  j++;
-  model->setData(j,0,xcor[n]);
-  model->setData(j,1,0.0);
-
-  // legendes
-  string unites[2];
-  if(iabs == 0 || iabs == 1 || iabs == 2) {
-    unites[0]= unites[1]= " mm";
-  }
-  if(iabs == 3 || iabs == 4) {
-    unites[0]= unites[1]= " mrad";
-  }
-  if(iabs == 5) {
-    unites[0]= " MeV"; unites[1]= " KeV";
-  }
-
-  new WText(" entries : "+ mixedTools::intToString((int)out[0]),w);
-  new WBreak(w);
-  new WText(" mean : "+ mixedTools::doubleToString(out[1])+unites[0],w);
-  new WBreak(w);
-  new WText(" sigma rms : "+ mixedTools::doubleToString(out[2])+unites[1],w);
-    
-  WCartesianChart *chart = new WCartesianChart(w);
-
-  if(iabs == 0) chart->setTitle("x-coordinate");
-  if(iabs == 1) chart->setTitle("y-coordinate");
-  if(iabs == 2) chart->setTitle("z-coordinate");
-  if(iabs == 3) chart->setTitle("xp-divergence");
-  if(iabs == 4) chart->setTitle("yp-devergence");
-  if(iabs == 5) chart->setTitle("kinetic energy");
-  
-  chart->setModel(model);        // set the model
-  chart->setXSeriesColumn(0);    // set the column that holds the categories
-  chart->setLegendEnabled(false); // enable the legend
-    
-  // Provide space for the X and Y axis and title.
-  chart->setPlotAreaPadding(200, Right);
-  chart->setPlotAreaPadding(80, Left);
-  chart->setPlotAreaPadding(40, Top | Bottom);
-    
-  chart->setType(ScatterPlot);
-    
-  WAxis& axis = chart->axis(XAxis);
-  axis.setLabelFormat("%.3f");
-  axis.setGridLinesEnabled(true);
-
-  if(iabs == 0) axis.setTitle(WString(" x (mm)"));
-  if(iabs == 1) axis.setTitle(WString(" y (mm)"));
-  if(iabs == 2) axis.setTitle(WString(" z (mm)"));
-  if(iabs == 3) axis.setTitle(WString(" xp (mrad)"));
-  if(iabs == 4) axis.setTitle(WString(" yp (mrad)"));
-  if(iabs == 5) axis.setTitle(WString(" dEcin/Ecin (%)"));
-  
-  chart->axis(Y1Axis).setGridLinesEnabled(true);
-  //chart->axis(Y1Axis).setTitle(WString("legende y"));
-    
-  WDataSeries s(1, LineSeries);
-  s.setFillRange(ZeroValueFill);
-  chart->addSeries(s);
-    
-  chart->resize(800, 400);
-  chart->setMargin(10, Top | Bottom);
-  chart->setMargin(WLength::Auto, Left | Right);
-    
-  LegendLocation location = LegendOutside;
-  Side side = Right;
-  AlignmentFlag alignment = AlignMiddle;
-  chart->setLegendLocation(location, side, alignment);
-  chart->setLegendStyle(chart->legendFont(), WPen(black), WBrush(WColor(0xFF, 0xFA, 0xE5)));
-}
+
 
 void PspaApplication::removeBeamLine() {
@@ -1076,5 +950,6 @@
   toto_->clear();
   
-  GWt_dialog* histoDialog = new GWt_dialog("histogramme",toto_,false);
+  std::time_t result = std::time(NULL);
+  GWt_dialog* histoDialog = new GWt_dialog(WString("histogramme&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(")+std::asctime(std::localtime(&result))+")",toto_,false);
   eDialog_.push_back(histoDialog);
   histoDialog->setMinimumSize(400,400);
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc	(revision 406)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc	(revision 407)
@@ -9,5 +9,5 @@
 #include "GWt_softwarePanel.h"
 
-GWt_sectionToExecute::GWt_sectionToExecute(Wt::WComboBox* first,Wt::WComboBox* last,Wt::WComboBox* soft,GWt_softwarePanel* sPanel)
+GWt_sectionToExecute::GWt_sectionToExecute(Wt::WComboBox* first,Wt::WComboBox* last,Wt::WComboBox* soft,Wt::WContainerWidget* buttonPanel, GWt_softwarePanel* sPanel)
 :WContainerWidget(),
 firstElement(first),
@@ -32,4 +32,7 @@
     labelAndComboInsideContainerLayout->addWidget(last);
     labelAndComboInsideContainerLayout->addWidget(soft);
+
+    // add buttons
+    labelAndComboInsideContainerLayout->addWidget(buttonPanel);
 
     labelAndComboInsideContainer->setLayout(labelAndComboInsideContainerLayout);
@@ -89,5 +92,5 @@
     lastElement->setMinimumSize(80,12);
     software->setMinimumSize(80,12);
-    
+        
     firstElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
     lastElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
Index: /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
===================================================================
--- /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 406)
+++ /Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc	(revision 407)
@@ -129,10 +129,16 @@
   fillComboWithSoftwares(softCombo);
 
-  GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo, lineToCombo, softCombo,this);
+  GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo, lineToCombo, softCombo,createAddDeletePushButtons(sections_.size()),this);
+
+  stringstream st;
+  st << sections_.size();
+
+  // this is the mean to identify this section!
+  newSection->setObjectName(st.str());
 
   // push back on sections vector
   sections_.push_back(newSection);
 
-  Wt::WContainerWidget* container = new Wt::WContainerWidget();
+/*  Wt::WContainerWidget* container = new Wt::WContainerWidget();
   Wt::WGridLayout* containerLayout = new Wt::WGridLayout();
   containerLayout->setContentsMargins(0,0,0,0);
@@ -142,10 +148,12 @@
   
   // add buttons
-  containerLayout->addWidget(createAddDeletePushButtons(),0,1);
+  containerLayout->addWidget(createAddDeletePushButtons(sections_.size()-1),0,1);
 
   container->setLayout(containerLayout);
+*/
   
   // add to sections
-  contenuSections_->addWidget(container);  
+//  contenuSections_->addWidget(container);
+  contenuSections_->addWidget(newSection);
 }
 
@@ -374,13 +382,23 @@
 }
 
-void GWt_softwarePanel::deleteSectionToExecuteW()
-{
-/*  if ( dtmanage_->getJobListSize() == 0 ) return;
-  // delete from dataManager
-  dtmanage_->clearSectionToExecute(dtmanage_->getJobListSize()-1);
-
-  // delete from User Interface
-  sections_.pop_back();
-*/
+void GWt_softwarePanel::deleteSectionToExecuteW(int sectionLabel)
+{
+  stringstream st;
+  st << sectionLabel;
+  std::string sectionName = st.str();
+  
+  if ( dtmanage_->getJobListSize() == 0 ) return;
+  for (unsigned int sectionIndex = 0; sectionIndex< sections_.size(); sectionIndex++) {
+    if (sections_[sectionIndex]->objectName() == sectionName) {
+
+      // delete from dataManager
+      dtmanage_->clearSectionToExecute(sectionIndex);
+
+      // delete from User Interface
+      contenuSections_->removeWidget(sections_[sectionIndex]);
+      delete sections_[sectionIndex];
+      sections_.erase (sections_.begin()+sectionIndex);
+    }
+  }  
 }
 
@@ -494,5 +512,5 @@
 
 
-Wt::WContainerWidget* GWt_softwarePanel::createAddDeletePushButtons() {
+Wt::WContainerWidget* GWt_softwarePanel::createAddDeletePushButtons(int sectionNumber) {
 
   WContainerWidget* buttonContainer= new WContainerWidget();
@@ -510,5 +528,6 @@
   WPushButton* exec_delete = new WPushButton("-");
   //  warningsContainer_->setStyleClass("warningsContainer");
-  exec_delete->clicked().connect(this, &GWt_softwarePanel::deleteSectionToExecuteW);
+
+  exec_delete->clicked().connect(boost::bind(&GWt_softwarePanel::deleteSectionToExecuteW, this, sectionNumber));
   exec_delete->setStyleClass("roundButton");
   exec_delete->setMaximumSize(20,20);
