Changeset 359 in PSPA for Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc
- Timestamp:
- Mar 4, 2013, 6:08:02 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc
r343 r359 138 138 139 139 // update labels 140 elem->getGWt_AbstractElement()->updateLabelAndToolTipWidget(); 141 140 if (elem->getGWt_AbstractElement()) { 141 elem->getGWt_AbstractElement()->updateLabelAndToolTipWidget(); 142 } 142 143 // one element 143 144 if ((a == 0) && (a == (ligneFaisceauLayout_->count()-1))) { … … 210 211 211 212 abstractElement* GWt_LigneFaisceau::getAbstractElement(int i){ 212 int index = 0; 213 214 // first if 1 215 // i--; 216 217 for (int a=0; a< ligneFaisceauLayout_->count(); a++) { 218 if (GWt_elementLigneFaisceau* elem = dynamic_cast <GWt_elementLigneFaisceau*> (ligneFaisceauLayout_->itemAt(a)->widget ())) { 219 if (index == i) { 220 printf("GWt_LigneFaisceau::getAbstractElement %d %s\n",i,elem->getGWt_AbstractElement()->getAbstractElement()->getLabel().c_str()); 221 return elem->getGWt_AbstractElement()->getAbstractElement(); 222 } 223 index ++; 224 } 225 } 226 return NULL; 213 int index = 0; 214 if (i < 0) { 215 return NULL; 216 } 217 218 // first if 1 219 // i--; 220 for (int a=0; a< ligneFaisceauLayout_->count(); a++) { 221 if (ligneFaisceauLayout_->itemAt(a)) { 222 223 if (GWt_elementLigneFaisceau* elem = dynamic_cast <GWt_elementLigneFaisceau*> (ligneFaisceauLayout_->itemAt(a)->widget ())) { 224 if (index == i) { 225 if (elem->getGWt_AbstractElement()) { 226 return elem->getGWt_AbstractElement()->getAbstractElement(); 227 } 228 } 229 index ++; 230 } 231 } 232 } 233 return NULL; 227 234 } 228 235 … … 238 245 } 239 246 247 240 248 vector <abstractElement*> GWt_LigneFaisceau::getAllAbstractElements() 241 249 { … … 249 257 } 250 258 259 void GWt_LigneFaisceau::update(int i){ 260 int index = 0; 261 262 // first if 1 263 // i--; 264 265 for (int a=0; a< ligneFaisceauLayout_->count(); a++) { 266 if (GWt_elementLigneFaisceau* elem = dynamic_cast <GWt_elementLigneFaisceau*> (ligneFaisceauLayout_->itemAt(a)->widget ())) { 267 if (index == i) { 268 elem->setBGColor(WColor(elem->getGWt_AbstractElement()->getAbstractElement()->getAbstractSoftware()->getColor())); 269 } 270 index ++; 271 } 272 } 273 } 274
Note: See TracChangeset
for help on using the changeset viewer.