Changeset 399 in PSPA


Ignore:
Timestamp:
Mar 27, 2013, 5:14:47 PM (11 years ago)
Author:
garnier
Message:

Mise en place des comboBox et changement de l'aspect visuel

Location:
Interface_Web/branches/12_03_12-managerComboBox/pspaWT
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/History

    r397 r399  
    55     PSPA - Plateforme de simulation en physique des accélérateurs
    66     =========================================================
     7
     827 Mars : Laurent Garnier
     9- pspa.css : Ajout de styles pour divers containers (buttons...)
     10- abstractElement.cc : Correction d'un bug dans setSoftware() qui ne mettait pas
     11  le software a jour si celui ci était "unknow"
     12- GWt_elementLigneFaisceau.cc : Correction d'un bug qui ne mettait pas à jour la
     13  couleur du sofware sur un chanegement
     14- GWt_serverFileSelector,GWt_dialog : Améliorations de l'aspect visuel
     15- GWt_sectionToExecute.cc : Mise en application des comboBox
     16- GWt_pspaApplication.cc : Correction d'un bug qui ne remettait pas a jour les sections
     17  lors de l'effacement des composants
     18- GWt_softwarePanel.cc : Mise en place des comboBox et suppression des dialogBox
    719
    82022 Mars : Laurent Garnier
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/htdocs/pspa.css

    r376 r399  
    88
    99#Wt-btn {
    10    background-repeat: no;
     10   background-repeat: no-repeat;
    1111}
    1212
     
    145145.beamLineElementActions .parameters {
    146146    background-image: url("advanced.png");
    147     background-repeat: no;
     147    background-repeat: no-repeat;
    148148    display: inline;
    149149}
     
    151151.beamLineElementActions .trash {
    152152    background-image: url("trash.png");
    153     background-repeat: no;
     153    background-repeat: no-repeat;
    154154    display: inline;
    155155}
     
    180180}
    181181
     182.warningsContainer {
     183    background-image: url("warning20_20.png");
     184    border: 2px solid #FFDD88;
     185    background-repeat: no-repeat;
     186    padding: 0px 25px;
     187}
     188
     189.errorsContainer {
     190    background-image: url("error20_20.png");
     191    border: 2px solid #FF0000;
     192    background-repeat: no-repeat;
     193    padding: 0px 25px;
     194}
     195
     196.roundButton {
     197    border: 1px solid #BBBBBB;
     198    border-radius: 0.7em 0.7em 0.7em 0.7em;
     199}
     200
    182201*|*:-moz-any-link:not(svg|a) {
    183202    text-decoration: underline;
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/controler/src/abstractElement.cc

    r373 r399  
    117117  }
    118118 
    119   if ((tb == TBoolOk) || (tb == TBoolIgnore)) {
     119  if (prog == nomDeLogiciel::unknownSoftware){
     120    tb = TBoolOk;
     121  }
     122   
     123          if ((tb == TBoolOk) || (tb == TBoolIgnore)) {
    120124    if (prog == nomDeLogiciel::parmela) {
    121125      abstractSoftware_ = new softwareParmela();
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/include/GWt_dialog.h

    r336 r399  
    3838     */
    3939    GWt_dialog(WString titre, WString message, iconType icon=NoIcon, bool modal=false, bool okButton=false);
     40
     41    /** Add a v content to this widget
     42    */
     43    void addVContent(WContainerWidget* wc);
     44   
     45    private :
     46    WVBoxLayout* vDialogLayout_;
    4047};
    4148#endif
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/include/GWt_sectionToExecute.h

    r396 r399  
    44#include <Wt/WContainerWidget>
    55#include <Wt/WComboBox>
    6 #include <Wt/WLabel>
     6#include <Wt/WText>
    77
    88class GWt_softwarePanel;
     
    6060    GWt_softwarePanel* softwarePanel;
    6161
    62     Wt::WLabel* errorsLabel_;
    63     Wt::WLabel* warningsLabel_;
     62    Wt::WText* errorsLabel_;
     63    Wt::WText* warningsLabel_;
    6464
    6565    Wt::WContainerWidget* warningsContainer_;
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/include/GWt_softwarePanel.h

    r395 r399  
    4040    void fillComboWithElements(Wt::WComboBox* cBox);
    4141    void fillComboWithSoftwares(Wt::WComboBox* cBox);
    42    
     42    Wt::WContainerWidget* createAddDeletePushButtons();
     43
    4344    dataManager* dtmanage_;
    4445    WPushButton *exec_go_;
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_dialog.cc

    r385 r399  
    33#include <Wt/WText>
    44#include <Wt/WBreak>
     5#include <Wt/WVBoxLayout>
    56#include <Wt/WHBoxLayout>
    67#include <Wt/WPushButton>
     
    1920    titleBar()->decorationStyle().setBackgroundColor (WColor(70,180,220));
    2021   
     22    WContainerWidget* widgt = new WContainerWidget(contents());
     23    vDialogLayout_ = new WVBoxLayout();
     24    widgt->setLayout(vDialogLayout_);
     25   
     26    setClosable(true);
     27    setModal (modal);
     28    setResizable(true);
     29    show();
     30   
    2131    if (wc != NULL) {
    22         WContainerWidget* widgt = new WContainerWidget(contents());
    23         WHBoxLayout* hLayout = new WHBoxLayout();
    24         hLayout->addWidget(wc);
    25         widgt->setLayout(hLayout);
    26 
    27         setClosable(true);
    28         setModal (modal);
    29         show();
     32        addVContent(wc);
    3033    }
    3134}
     
    112115
    113116
     117void GWt_dialog::addVContent(WContainerWidget* wc) {
    114118
     119    if (vDialogLayout_) {
     120        vDialogLayout_->addWidget(wc);
     121    }
     122}
     123
     124
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc

    r396 r399  
    209209      setBGColor(WColor(getGWt_AbstractElement()->getAbstractElement()->getAbstractSoftware()->getColor()));
    210210      softwareName_->setText(getGWt_AbstractElement()->getAbstractElement()->getAbstractSoftware()->getName());
     211
     212    // no abstract software
     213    } else {
     214      setBGColor(WColor("#FFFFFF"));
     215      softwareName_->setText("");
    211216    }
    212217  }
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc

    r397 r399  
    172172  console_ = new GWt_console();
    173173
     174  // manage sizes
    174175  console_->setMinimumSize(300,100);
    175  
     176//  executeWidget_->setMinimumSize(500,100);
     177
    176178  mainGridLayout->addWidget(console_, 3, 2,2,1);
    177179 
     
    973975void PspaApplication::removeBeamLine() {
    974976  createBeamLine();
    975 }
     977  executeWidget_->updateSections();
     978}
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc

    r397 r399  
    22#include <Wt/WVBoxLayout>
    33#include <Wt/WHBoxLayout>
     4#include <Wt/WGridLayout>
    45#include <Wt/WContainerWidget>
    56#include <Wt/WImage>
     
    1516softwarePanel(sPanel)
    1617{
    17     Wt::WHBoxLayout* mainContainerLayout = new Wt::WHBoxLayout();
     18    Wt::WGridLayout* mainContainerLayout = new Wt::WGridLayout();
    1819    mainContainerLayout->setContentsMargins(0,0,0,0);
    1920
     
    2627    labelAndComboInsideContainerLayout->setContentsMargins(0,0,0,0);
    2728   
    28     labelAndComboInsideContainerLayout->addWidget(new Wt::WText(" from : "));
     29    labelAndComboInsideContainerLayout->addWidget(new Wt::WText("from&nbsp;:&nbsp;"));
    2930    labelAndComboInsideContainerLayout->addWidget(first);
    30     labelAndComboInsideContainerLayout->addWidget(new Wt::WText(" to : "));
     31    labelAndComboInsideContainerLayout->addWidget(new Wt::WText("to&nbsp;:&nbsp;"));
    3132    labelAndComboInsideContainerLayout->addWidget(last);
    3233    labelAndComboInsideContainerLayout->addWidget(soft);
     
    3940    labelAndComboContainer->setLayout(labelAndComboContainerLayout);
    4041   
    41     // add label and Combo containers
    42     mainContainerLayout->addWidget(labelAndComboContainer);
    43 
    4442           
    4543    // add errors and warning layout
     
    4846
    4947    Wt::WContainerWidget* warningsAndErrorsContainer = new Wt::WContainerWidget();
    50     Wt::WVBoxLayout* vLayoutContainer = new Wt::WVBoxLayout();
    51 
    52     vLayoutContainer->addWidget(warningsContainer_);
    53     vLayoutContainer->addWidget(errorsContainer_);
    54     vLayoutContainer->addStretch (100);
     48    Wt::WVBoxLayout* vWarningsAndErrorsLayoutContainer = new Wt::WVBoxLayout();
    5549   
    5650    Wt::WHBoxLayout* hLayoutContainerWarnings = new Wt::WHBoxLayout();
     
    5852
    5953   
    60     // fill containers
    61     Wt::WImage* imgWarning = new WImage ("/htdocs/warning.png");
    62     Wt::WImage* imgError = new WImage ("/htdocs/error.png");
    63 
    64     // resize images
    65     imgWarning->resize(20,20);
    66     imgError->resize(20,20);
    67    
    68     warningsLabel_ = new Wt::WLabel("");
    69     errorsLabel_ = new Wt::WLabel("");
    70 
    71     hLayoutContainerWarnings->addWidget(imgWarning);
     54    warningsLabel_ = new Wt::WText("",XHTMLText);
     55    errorsLabel_ = new Wt::WText("",XHTMLText);
    7256    hLayoutContainerWarnings->addWidget(warningsLabel_);
    73     hLayoutContainerErrors->addWidget(imgError);
    7457    hLayoutContainerErrors->addWidget(errorsLabel_);
    7558
     
    8265    errorsContainer_->setLayout(hLayoutContainerErrors);
    8366   
    84     warningsAndErrorsContainer->setLayout(vLayoutContainer);
     67    vWarningsAndErrorsLayoutContainer->addWidget(errorsContainer_);
     68    vWarningsAndErrorsLayoutContainer->addWidget(warningsContainer_);
     69    vWarningsAndErrorsLayoutContainer->addStretch (100);
    8570
     71    warningsAndErrorsContainer->setLayout(vWarningsAndErrorsLayoutContainer);
     72
     73    // add label and Combo containers
     74    mainContainerLayout->addWidget(labelAndComboContainer,0,0);
    8675    // add warnings and errors containers
    87 //    mainContainerLayout->addWidget(warningsAndErrorsContainer);
     76    mainContainerLayout->addWidget(warningsAndErrorsContainer,1,0);
    8877
    89     this->setLayout(mainContainerLayout);
    90    
     78    // manage margins
     79    vWarningsAndErrorsLayoutContainer->setContentsMargins(20,0,0,0);
     80    hLayoutContainerWarnings->setContentsMargins(0,0,0,0);
     81    hLayoutContainerErrors->setContentsMargins(0,0,0,0);
     82
     83    setLayout(mainContainerLayout);
     84    warningsContainer_->setStyleClass("warningsContainer");
     85    errorsContainer_->setStyleClass("errorsContainer");
     86
    9187   
    9288    firstElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections);
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_serverFileSelector.cc

    r347 r399  
    7070    WContainerWidget *buttonContainer = new WContainerWidget();
    7171    WHBoxLayout* hButtonLayout = new WHBoxLayout();
    72     buttonContainer->setLayout(hButtonLayout);
    7372   
    7473    WPushButton *annule = new WPushButton("cancel");
     
    8079    submit->clicked().connect(this, &Wt::WDialog::accept);
    8180   
     81    buttonContainer->setLayout(hButtonLayout);
    8282
    83     // overload the container already present
     83    // add the container already present
    8484   
    85     WContainerWidget* widgt = new WContainerWidget(contents());
    86     WVBoxLayout* vLayout = new WVBoxLayout();
    87     vLayout->addWidget(treeContainer);
    88     vLayout->addWidget(buttonContainer);
    89     widgt->setLayout(vLayout);
     85    addVContent(treeContainer);
     86    addVContent(buttonContainer);
    9087   
     88    treeContainer->resize(400,300);
     89    treeContainer->setOverflow(WContainerWidget::OverflowAuto);
     90
    9191}
    9292
  • Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc

    r397 r399  
    1212#include <Wt/WBreak>
    1313#include <Wt/WApplication>
     14#include <Wt/WVBoxLayout>
    1415
    1516#include "GWt_softwarePanel.h"
     
    3233  exec_go_->clicked().connect(this, &GWt_softwarePanel::executer);
    3334 
    34   // preparation du bouton add
    35   WPushButton* exec_add = new WPushButton("add");
    36   exec_add->clicked().connect(this, &GWt_softwarePanel::addSectionToExecuteW);
    37    
    38   // preparation du bouton delete
    39   WPushButton* exec_delete = new WPushButton("delete");
    40   exec_delete->clicked().connect(this, &GWt_softwarePanel::deleteSectionToExecuteW);
    4135   
    4236  // preparation du bouton push_ok
     
    4943 
    5044  contenuSections_ = new WContainerWidget();
    51   contenuSections_->addWidget(exec_add);
    52   contenuSections_->addWidget(exec_delete);
    5345  //  contenuSections_->addWidget(exec_ok);
    5446  contenuSections_->addWidget(exec_go_);
     
    115107  }
    116108
    117   WLineEdit* lineFrom = new WLineEdit(premierElementLabel);
    118   WLineEdit* lineTo = new WLineEdit(dernierElementLabel);
    119 
    120109  WComboBox* lineFromCombo = new WComboBox();
    121110  WComboBox* lineToCombo = new WComboBox();
     
    131120  sections.push_back(newSection);
    132121
     122  Wt::WContainerWidget* container = new Wt::WContainerWidget();
     123  Wt::WGridLayout* containerLayout = new Wt::WGridLayout();
     124  containerLayout->setContentsMargins(0,0,0,0);
     125
    133126  // push back on User interface
    134   contenuSections_->addWidget(newSection);
    135 
     127  containerLayout->addWidget(newSection,0,0);
     128 
     129  // add buttons
     130  containerLayout->addWidget(createAddDeletePushButtons(),0,1);
     131
     132  container->setLayout(containerLayout);
     133 
     134  // add to sections
     135  contenuSections_->addWidget(container); 
    136136}
    137137
     
    262262      if ( current > dtmanage_->getBeamLineSize() )
    263263        {
    264           GWt_dialog warningDialog("PSPA :: verification des sections", " bad section definition !", GWt_dialog::Error,true,true);
     264          GWt_dialog warningDialog("PSPA :: verification des sections", " bad section definition 1 !", GWt_dialog::Error,true,true);
    265265          warningDialog.exec();
    266266          return false;
     
    276276      if ( numeroFin < current || numeroFin > dtmanage_->getBeamLineSize())
    277277        {
    278           GWt_dialog warningDialog("PSPA : Checking of sections", " bad section definition !", GWt_dialog::Error, true,true);
     278          GWt_dialog warningDialog("PSPA : Checking of sections", " bad section definition 2 !", GWt_dialog::Error, true,true);
    279279          warningDialog.exec();
    280280          return false;
     
    300300{
    301301  bool caMarche = true;
    302   trivaluedBool tbResume = TBoolOk;
    303302
    304303  // initialize dataManager
     
    310309  }
    311310 
    312   string diagnostic;
    313    
     311  string diagnosticErrors;
     312  string diagnosticWarnings;
     313 
    314314  for (int a = 0; a< sections.size(); a++)
    315315  {
     
    327327                                   dtmanage_->createSoftwareConnexion(prog));
    328328   
     329    diagnosticErrors = "";
     330    diagnosticWarnings = "";
     331
    329332    // check sections
    330333    for (int i=debut-1; i<fin; i++) {
     
    333336          trivaluedBool tb = pspa_->getBeamLine()->getAbstractElement(i)->setSoftware(prog.getString());
    334337          if (tb  == TBoolError ) {
    335             diagnostic += pspa_->getBeamLine()->getAbstractElement(i)->getNomdElement().getElementName() + " is not allowed with "+ prog.getString()+"\n ";
     338            diagnosticErrors += pspa_->getBeamLine()->getAbstractElement(i)->getLabel() + " is not allowed with "+ prog.getString()+"<br /> ";
     339
    336340            caMarche = false;
    337             tbResume = tb;
     341
     342            // intialize thissoftware
     343            pspa_->getBeamLine()->getAbstractElement(i)->setSoftware(nomDeLogiciel::unknownSoftware);
     344
    338345          } else if ( tb == TBoolIgnore ) {
    339             diagnostic += pspa_->getBeamLine()->getAbstractElement(i)->getNomdElement().getElementName() + " will be ignored by  "+ prog.getString()+"\n ";
    340             if ( tbResume != TBoolError ) tbResume = tb;
    341           } else {
    342             pspa_->getBeamLine()->update(i);
     346            diagnosticWarnings += pspa_->getBeamLine()->getAbstractElement(i)->getLabel() + " will be ignored by  "+ prog.getString()+"<br /> ";
     347           
     348
    343349          }
     350          pspa_->getBeamLine()->update(i);
    344351        }
    345352      }
    346353    }
    347   }
    348  
    349   if ( tbResume == TBoolError ) {
    350     GWt_dialog calculDialog("PSPA check execute : ERROR", diagnostic , GWt_dialog::Error,true,true);
    351     calculDialog.exec();
    352   } else if (tbResume == TBoolIgnore ) {
    353     GWt_dialog calculDialog("PSPA check execute : WARNING", diagnostic , GWt_dialog::Warning,false,true);
    354     calculDialog.exec();
    355   }
    356 
    357   /*
    358     } else if ( essai == warning )  {
    359     GWt_dialog calculDialog("PSPA check execute : warning ", diagnostic , GWt_dialog::Warning, false,true);
    360     calculDialog.exec();
    361   */
     354    // set errors and warnings
     355    sections[a]->setErrors(diagnosticErrors);
     356    sections[a]->setWarnings(diagnosticWarnings);
     357  }
    362358   
    363359  return caMarche;
     
    475471 
    476472}
     473
     474
     475Wt::WContainerWidget* GWt_softwarePanel::createAddDeletePushButtons() {
     476
     477  WContainerWidget* buttonContainer= new WContainerWidget();
     478 
     479  Wt::WHBoxLayout* buttonContainerLayout = new Wt::WHBoxLayout();
     480  buttonContainerLayout->setContentsMargins(0,0,0,0);
     481  // preparation du bouton add
     482  WPushButton* exec_add = new WPushButton("+");
     483  exec_add->clicked().connect(this, &GWt_softwarePanel::addSectionToExecuteW);
     484  exec_add->setStyleClass("roundButton");
     485  exec_add->setMaximumSize(20,20);
     486  exec_add->setToolTip("Add new section");
     487 
     488  // preparation du bouton delete
     489  WPushButton* exec_delete = new WPushButton("-");
     490  //  warningsContainer_->setStyleClass("warningsContainer");
     491  exec_delete->clicked().connect(this, &GWt_softwarePanel::deleteSectionToExecuteW);
     492  exec_delete->setStyleClass("roundButton");
     493  exec_delete->setMaximumSize(20,20);
     494  exec_add->setToolTip("Remove this section");
     495
     496  buttonContainerLayout->addWidget(exec_add);
     497  buttonContainerLayout->addWidget(exec_delete);
     498
     499  buttonContainer->setLayout(buttonContainerLayout);
     500
     501  return buttonContainer;
     502}
Note: See TracChangeset for help on using the changeset viewer.