Changeset 399 in PSPA
- Timestamp:
- Mar 27, 2013, 5:14:47 PM (11 years ago)
- 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 5 5 PSPA - Plateforme de simulation en physique des accélérateurs 6 6 ========================================================= 7 8 27 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 7 19 8 20 22 Mars : Laurent Garnier -
Interface_Web/branches/12_03_12-managerComboBox/pspaWT/htdocs/pspa.css
r376 r399 8 8 9 9 #Wt-btn { 10 background-repeat: no ;10 background-repeat: no-repeat; 11 11 } 12 12 … … 145 145 .beamLineElementActions .parameters { 146 146 background-image: url("advanced.png"); 147 background-repeat: no ;147 background-repeat: no-repeat; 148 148 display: inline; 149 149 } … … 151 151 .beamLineElementActions .trash { 152 152 background-image: url("trash.png"); 153 background-repeat: no ;153 background-repeat: no-repeat; 154 154 display: inline; 155 155 } … … 180 180 } 181 181 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 182 201 *|*:-moz-any-link:not(svg|a) { 183 202 text-decoration: underline; -
Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/controler/src/abstractElement.cc
r373 r399 117 117 } 118 118 119 if ((tb == TBoolOk) || (tb == TBoolIgnore)) { 119 if (prog == nomDeLogiciel::unknownSoftware){ 120 tb = TBoolOk; 121 } 122 123 if ((tb == TBoolOk) || (tb == TBoolIgnore)) { 120 124 if (prog == nomDeLogiciel::parmela) { 121 125 abstractSoftware_ = new softwareParmela(); -
Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/include/GWt_dialog.h
r336 r399 38 38 */ 39 39 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_; 40 47 }; 41 48 #endif -
Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/include/GWt_sectionToExecute.h
r396 r399 4 4 #include <Wt/WContainerWidget> 5 5 #include <Wt/WComboBox> 6 #include <Wt/W Label>6 #include <Wt/WText> 7 7 8 8 class GWt_softwarePanel; … … 60 60 GWt_softwarePanel* softwarePanel; 61 61 62 Wt::W Label* errorsLabel_;63 Wt::W Label* warningsLabel_;62 Wt::WText* errorsLabel_; 63 Wt::WText* warningsLabel_; 64 64 65 65 Wt::WContainerWidget* warningsContainer_; -
Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/include/GWt_softwarePanel.h
r395 r399 40 40 void fillComboWithElements(Wt::WComboBox* cBox); 41 41 void fillComboWithSoftwares(Wt::WComboBox* cBox); 42 42 Wt::WContainerWidget* createAddDeletePushButtons(); 43 43 44 dataManager* dtmanage_; 44 45 WPushButton *exec_go_; -
Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_dialog.cc
r385 r399 3 3 #include <Wt/WText> 4 4 #include <Wt/WBreak> 5 #include <Wt/WVBoxLayout> 5 6 #include <Wt/WHBoxLayout> 6 7 #include <Wt/WPushButton> … … 19 20 titleBar()->decorationStyle().setBackgroundColor (WColor(70,180,220)); 20 21 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 21 31 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); 30 33 } 31 34 } … … 112 115 113 116 117 void GWt_dialog::addVContent(WContainerWidget* wc) { 114 118 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 209 209 setBGColor(WColor(getGWt_AbstractElement()->getAbstractElement()->getAbstractSoftware()->getColor())); 210 210 softwareName_->setText(getGWt_AbstractElement()->getAbstractElement()->getAbstractSoftware()->getName()); 211 212 // no abstract software 213 } else { 214 setBGColor(WColor("#FFFFFF")); 215 softwareName_->setText(""); 211 216 } 212 217 } -
Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_pspaApplication.cc
r397 r399 172 172 console_ = new GWt_console(); 173 173 174 // manage sizes 174 175 console_->setMinimumSize(300,100); 175 176 // executeWidget_->setMinimumSize(500,100); 177 176 178 mainGridLayout->addWidget(console_, 3, 2,2,1); 177 179 … … 973 975 void PspaApplication::removeBeamLine() { 974 976 createBeamLine(); 975 } 977 executeWidget_->updateSections(); 978 } -
Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc
r397 r399 2 2 #include <Wt/WVBoxLayout> 3 3 #include <Wt/WHBoxLayout> 4 #include <Wt/WGridLayout> 4 5 #include <Wt/WContainerWidget> 5 6 #include <Wt/WImage> … … 15 16 softwarePanel(sPanel) 16 17 { 17 Wt::W HBoxLayout* mainContainerLayout = new Wt::WHBoxLayout();18 Wt::WGridLayout* mainContainerLayout = new Wt::WGridLayout(); 18 19 mainContainerLayout->setContentsMargins(0,0,0,0); 19 20 … … 26 27 labelAndComboInsideContainerLayout->setContentsMargins(0,0,0,0); 27 28 28 labelAndComboInsideContainerLayout->addWidget(new Wt::WText(" from :"));29 labelAndComboInsideContainerLayout->addWidget(new Wt::WText("from : ")); 29 30 labelAndComboInsideContainerLayout->addWidget(first); 30 labelAndComboInsideContainerLayout->addWidget(new Wt::WText(" to :"));31 labelAndComboInsideContainerLayout->addWidget(new Wt::WText("to : ")); 31 32 labelAndComboInsideContainerLayout->addWidget(last); 32 33 labelAndComboInsideContainerLayout->addWidget(soft); … … 39 40 labelAndComboContainer->setLayout(labelAndComboContainerLayout); 40 41 41 // add label and Combo containers42 mainContainerLayout->addWidget(labelAndComboContainer);43 44 42 45 43 // add errors and warning layout … … 48 46 49 47 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(); 55 49 56 50 Wt::WHBoxLayout* hLayoutContainerWarnings = new Wt::WHBoxLayout(); … … 58 52 59 53 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); 72 56 hLayoutContainerWarnings->addWidget(warningsLabel_); 73 hLayoutContainerErrors->addWidget(imgError);74 57 hLayoutContainerErrors->addWidget(errorsLabel_); 75 58 … … 82 65 errorsContainer_->setLayout(hLayoutContainerErrors); 83 66 84 warningsAndErrorsContainer->setLayout(vLayoutContainer); 67 vWarningsAndErrorsLayoutContainer->addWidget(errorsContainer_); 68 vWarningsAndErrorsLayoutContainer->addWidget(warningsContainer_); 69 vWarningsAndErrorsLayoutContainer->addStretch (100); 85 70 71 warningsAndErrorsContainer->setLayout(vWarningsAndErrorsLayoutContainer); 72 73 // add label and Combo containers 74 mainContainerLayout->addWidget(labelAndComboContainer,0,0); 86 75 // add warnings and errors containers 87 // mainContainerLayout->addWidget(warningsAndErrorsContainer);76 mainContainerLayout->addWidget(warningsAndErrorsContainer,1,0); 88 77 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 91 87 92 88 firstElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections); -
Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_serverFileSelector.cc
r347 r399 70 70 WContainerWidget *buttonContainer = new WContainerWidget(); 71 71 WHBoxLayout* hButtonLayout = new WHBoxLayout(); 72 buttonContainer->setLayout(hButtonLayout);73 72 74 73 WPushButton *annule = new WPushButton("cancel"); … … 80 79 submit->clicked().connect(this, &Wt::WDialog::accept); 81 80 81 buttonContainer->setLayout(hButtonLayout); 82 82 83 // overload the container already present83 // add the container already present 84 84 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); 90 87 88 treeContainer->resize(400,300); 89 treeContainer->setOverflow(WContainerWidget::OverflowAuto); 90 91 91 } 92 92 -
Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
r397 r399 12 12 #include <Wt/WBreak> 13 13 #include <Wt/WApplication> 14 #include <Wt/WVBoxLayout> 14 15 15 16 #include "GWt_softwarePanel.h" … … 32 33 exec_go_->clicked().connect(this, &GWt_softwarePanel::executer); 33 34 34 // preparation du bouton add35 WPushButton* exec_add = new WPushButton("add");36 exec_add->clicked().connect(this, &GWt_softwarePanel::addSectionToExecuteW);37 38 // preparation du bouton delete39 WPushButton* exec_delete = new WPushButton("delete");40 exec_delete->clicked().connect(this, &GWt_softwarePanel::deleteSectionToExecuteW);41 35 42 36 // preparation du bouton push_ok … … 49 43 50 44 contenuSections_ = new WContainerWidget(); 51 contenuSections_->addWidget(exec_add);52 contenuSections_->addWidget(exec_delete);53 45 // contenuSections_->addWidget(exec_ok); 54 46 contenuSections_->addWidget(exec_go_); … … 115 107 } 116 108 117 WLineEdit* lineFrom = new WLineEdit(premierElementLabel);118 WLineEdit* lineTo = new WLineEdit(dernierElementLabel);119 120 109 WComboBox* lineFromCombo = new WComboBox(); 121 110 WComboBox* lineToCombo = new WComboBox(); … … 131 120 sections.push_back(newSection); 132 121 122 Wt::WContainerWidget* container = new Wt::WContainerWidget(); 123 Wt::WGridLayout* containerLayout = new Wt::WGridLayout(); 124 containerLayout->setContentsMargins(0,0,0,0); 125 133 126 // 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); 136 136 } 137 137 … … 262 262 if ( current > dtmanage_->getBeamLineSize() ) 263 263 { 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); 265 265 warningDialog.exec(); 266 266 return false; … … 276 276 if ( numeroFin < current || numeroFin > dtmanage_->getBeamLineSize()) 277 277 { 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); 279 279 warningDialog.exec(); 280 280 return false; … … 300 300 { 301 301 bool caMarche = true; 302 trivaluedBool tbResume = TBoolOk;303 302 304 303 // initialize dataManager … … 310 309 } 311 310 312 string diagnostic; 313 311 string diagnosticErrors; 312 string diagnosticWarnings; 313 314 314 for (int a = 0; a< sections.size(); a++) 315 315 { … … 327 327 dtmanage_->createSoftwareConnexion(prog)); 328 328 329 diagnosticErrors = ""; 330 diagnosticWarnings = ""; 331 329 332 // check sections 330 333 for (int i=debut-1; i<fin; i++) { … … 333 336 trivaluedBool tb = pspa_->getBeamLine()->getAbstractElement(i)->setSoftware(prog.getString()); 334 337 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 336 340 caMarche = false; 337 tbResume = tb; 341 342 // intialize thissoftware 343 pspa_->getBeamLine()->getAbstractElement(i)->setSoftware(nomDeLogiciel::unknownSoftware); 344 338 345 } 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 343 349 } 350 pspa_->getBeamLine()->update(i); 344 351 } 345 352 } 346 353 } 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 } 362 358 363 359 return caMarche; … … 475 471 476 472 } 473 474 475 Wt::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.