Changeset 396 in PSPA for Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc
- Timestamp:
- Mar 22, 2013, 9:37:45 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/branches/12_03_12-managerComboBox/pspaWT/sources/userInterface/src/GWt_sectionToExecute.cc
r390 r396 1 1 #include <Wt/WText> 2 #include <Wt/WVBoxLayout> 3 #include <Wt/WHBoxLayout> 4 #include <Wt/WContainerWidget> 5 #include <Wt/WImage> 6 2 7 #include "GWt_sectionToExecute.h" 8 #include "GWt_softwarePanel.h" 3 9 4 5 GWt_sectionToExecute::GWt_sectionToExecute(Wt::WComboBox* first,Wt::WComboBox* last,Wt::WComboBox* soft) 10 GWt_sectionToExecute::GWt_sectionToExecute(Wt::WComboBox* first,Wt::WComboBox* last,Wt::WComboBox* soft,GWt_softwarePanel* sPanel) 6 11 :WContainerWidget(), 7 12 firstElement(first), 8 13 lastElement(last), 9 software(soft) 14 software(soft), 15 softwarePanel(sPanel) 10 16 { 11 addWidget(new Wt::WText(" fromC : ")); 12 addWidget(first); 13 addWidget(new Wt::WText(" toC : ")); 14 addWidget(last); 15 addWidget(soft); 17 Wt::WGridLayout* mainContainerLayout = new Wt::WGridLayout(); 18 19 mainContainerLayout->addWidget(new Wt::WText(" from : "),0,0); 20 mainContainerLayout->addWidget(first,0,1); 21 mainContainerLayout->addWidget(new Wt::WText(" to : "),0,2); 22 mainContainerLayout->addWidget(last,0,3); 23 mainContainerLayout->addWidget(soft,0,4); 24 25 // add errors and warning layout 26 warningsContainer_ = new Wt::WContainerWidget(); 27 errorsContainer_ = new Wt::WContainerWidget(); 28 29 Wt::WContainerWidget* warningsAndErrorsContainer = new Wt::WContainerWidget(); 30 Wt::WVBoxLayout* vLayoutContainer = new Wt::WVBoxLayout(); 31 32 vLayoutContainer->addWidget(warningsContainer_); 33 vLayoutContainer->addWidget(errorsContainer_); 34 vLayoutContainer->addStretch (100); 35 36 Wt::WHBoxLayout* hLayoutContainerWarnings = new Wt::WHBoxLayout(); 37 Wt::WHBoxLayout* hLayoutContainerErrors = new Wt::WHBoxLayout(); 38 39 40 // fill containers 41 Wt::WImage* imgWarning = new WImage ("/htdocs/warning.png"); 42 Wt::WImage* imgError = new WImage ("/htdocs/error.png"); 43 44 // resize images 45 imgWarning->resize(20,20); 46 imgError->resize(20,20); 47 48 warningsLabel_ = new Wt::WLabel("--warnings---"); 49 errorsLabel_ = new Wt::WLabel("---errors--"); 50 51 hLayoutContainerWarnings->addWidget(imgWarning); 52 hLayoutContainerWarnings->addWidget(warningsLabel_); 53 hLayoutContainerErrors->addWidget(imgError); 54 hLayoutContainerErrors->addWidget(errorsLabel_); 55 56 warningsAndErrorsContainer->addWidget(warningsLabel_); 57 warningsAndErrorsContainer->addWidget(errorsLabel_); 58 59 60 // set Layouts 61 warningsContainer_->setLayout(hLayoutContainerWarnings); 62 errorsContainer_->setLayout(hLayoutContainerErrors); 63 64 warningsAndErrorsContainer->setLayout(vLayoutContainer); 65 66 // add warnings and errors containers 67 mainContainerLayout->addWidget(warningsAndErrorsContainer,0,5,2,1); 68 mainContainerLayout->addWidget(new WLabel("--"),1,1); 69 70 this->setLayout(mainContainerLayout); 71 72 73 firstElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections); 74 lastElement->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections); 75 software->activated().connect(softwarePanel,&GWt_softwarePanel::updateSections); 16 76 } 17 77 18 78 19 GWt_sectionToExecute::GWt_sectionToExecute(Wt::WLineEdit* first,Wt::WLineEdit* last,Wt::WComboBox* soft)20 :WContainerWidget(),21 firstElementLineEdit(first),22 lastElementLineEdit(last),23 software(soft)24 {;25 addWidget(new Wt::WText(" fromLE : "));26 addWidget(first);27 addWidget(new Wt::WText(" toLE : "));28 addWidget(last);29 addWidget(soft);30 }31 32 33 34 79 void GWt_sectionToExecute::setFirstElementCurrentSelection(Wt::WString txt){ 80 for (int a=0; a< firstElement->count(); a++) { 81 if (firstElement->itemText(a) == txt) { 82 firstElement->setCurrentIndex (a); 83 return; 84 } 85 } 35 86 } 36 87 37 88 void GWt_sectionToExecute::setLastElementCurrentSelection(Wt::WString txt){ 89 for (int a=0; a< lastElement->count(); a++) { 90 if (lastElement->itemText(a) == txt) { 91 lastElement->setCurrentIndex (a); 92 return; 93 } 94 } 38 95 } 39 96 … … 48 105 49 106 50 void GWt_sectionToExecute::setFirstElementLineEditCurrentText(Wt::WString txt){ 51 firstElementLineEdit->setText(txt); 107 void GWt_sectionToExecute::manageWarningsAndErrors(){ 108 if (warningsLabel_->text() == "") { 109 warningsContainer_->hide(); 110 } else { 111 warningsContainer_->show(); 112 } 113 if (errorsLabel_->text() == "") { 114 errorsContainer_->hide(); 115 } else { 116 errorsContainer_->show(); 117 } 118 52 119 } 53 54 void GWt_sectionToExecute::setLastElementLineEditCurrentText(Wt::WString txt){55 lastElementLineEdit->setText(txt);56 }57
Note: See TracChangeset
for help on using the changeset viewer.