Changeset 469 in PSPA for Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
- Timestamp:
- Dec 19, 2013, 3:53:53 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_softwarePanel.cc
r468 r469 67 67 abstractElement* dernierElement = NULL; 68 68 69 int premierIndex = 0;70 int dernierIndex = 0;71 72 69 std::string premierElementLabel = ""; 73 70 std::string dernierElementLabel = ""; … … 84 81 fillComboWithElements(lineToCombo); 85 82 86 // set selection 87 lineFromCombo->setCurrentIndex(premierIndex); 88 lineToCombo->setCurrentIndex(dernierIndex); 83 // set to first 84 lineFromCombo->setCurrentIndex(0); 85 // set to last 86 lineToCombo->setCurrentIndex(lineToCombo->count()); 89 87 90 88 WComboBox* softCombo = new WComboBox(); 91 fillComboWithSoftwares(softCombo); 89 sector * sector = UIsector_->getSectorControler(); 90 sectionToExecute* sect = UIsector_->getSectorControler()->getSectionsToExecute()[a]; 91 abstractSoftware* abs = sect->getSoftware(); 92 93 fillComboWithSoftwares(softCombo,UIsector_->getSectorControler()->getSectionsToExecute()[a]->getSoftware()->getName()); 94 95 // disable the "to" comboBox 96 lineToCombo->disable(); 97 98 // disable the first "from" comboBox 99 if (a==0) { 100 lineFromCombo->disable(); 101 } 102 // disable the last "to" comboBox 103 if (a==UIsector_->getSectorControler()->getSectionsToExecute().size()-1) { 104 lineToCombo->disable(); 105 } 92 106 93 107 // Add the sectionToExecute Widget 94 GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(UIsectionsToExecute_.size()),this,UIsector_); 95 108 GWt_sectionToExecute* newSection = new GWt_sectionToExecute(lineFromCombo,lineToCombo,softCombo,createAddDeletePushButtons(a),UIsector_->getSectorControler()->getSectionsToExecute()[a],UIsector_); 109 110 // FIXME ? 96 111 stringstream st; 97 112 st << UIsectionsToExecute_.size(); … … 103 118 UIsectionsToExecute_.push_back(newSection); 104 119 contenuSections_->addWidget(newSection); 105 updateSections();120 // updateSections(); 106 121 107 122 … … 116 131 cout << " GWt_softwarePanel::updateSections() " << endl<<endl; 117 132 #endif 118 return; 119 133 134 /* 120 135 // update all sections in order to manage new/deleted items 121 136 for (int a = 0; a < UIsectionsToExecute_.size(); a++) { … … 140 155 // set default values 141 156 updateSectionSelection(); 157 */ 142 158 } 143 159 … … 248 264 if (s > 0) { 249 265 abstractElement* abs = UIsector_->getSectorControler()->getSectionsToExecute()[s-1]->getLastElement(); 250 UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs ));266 UIsector_->getSectorControler()->addSectionToExecute(new sectionToExecute(abs,NULL)); 251 267 UIsector_->getSectorControler()->getSectionsToExecute()[s]->removeLastElement(); 252 268 } … … 290 306 if (cBox == NULL) return; 291 307 292 // get the last item selected293 WString selectedString = cBox->currentText();294 cBox->clear();295 296 308 if (!UIsector_->getSectorControler()) { 297 309 return; … … 306 318 } 307 319 } 308 309 for(int a = 0; a < cBox->count(); a++) { 310 if (cBox->itemText (a) == selectedString) { 311 cBox->setCurrentIndex(a); 312 } 313 } 314 cBox->refresh(); 315 } 316 317 void GWt_softwarePanel::fillComboWithSoftwares(Wt::WComboBox* cBox) 320 } 321 322 void GWt_softwarePanel::fillComboWithSoftwares(Wt::WComboBox* cBox, std::string selected) 318 323 { 319 324 #if BAVARD > 0 … … 329 334 for(k = 0; k <= nb; k++) { //xx 330 335 cBox->addItem(nomDeLogiciel(k).getString()); 331 } 332 cBox->setCurrentIndex(nb); // xx 336 if (nomDeLogiciel(k).getString() == selected) { 337 cBox->setCurrentIndex(cBox->count()-1); 338 } 339 } 333 340 cBox->refresh(); 334 341 }
Note: See TracChangeset
for help on using the changeset viewer.