Changeset 197 in PSPA
- Timestamp:
- Dec 17, 2012, 5:21:22 PM (12 years ago)
- Location:
- Interface_Web/branches/insertionsElements
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/branches/insertionsElements/include/GWt_dropZoneLigneFaiseau.h
r195 r197 18 18 GWt_dropZoneLigneFaiseau(PspaApplication*,bool linkImage = true); 19 19 ~GWt_dropZoneLigneFaiseau(); 20 20 void addElement(WContainerWidget* elem); 21 21 22 22 private: -
Interface_Web/branches/insertionsElements/src/GWt_LigneFaisceau.cc
r195 r197 56 56 int nbElem = pspa_->getDataManager()->beamLineSize(); 57 57 unsigned int k; 58 59 // add first dropZone 60 hbox_->addWidget(new GWt_dropZoneLigneFaiseau(pspa_,false)); 61 58 62 for(k = 0; k < (unsigned)nbElem; k++) 59 63 { … … 66 70 gw->updateLabelWidget(); 67 71 nObjets_[ptr->getName().getElementType()].incr(); 68 hbox_->addWidget(gw->getWidget()); 69 // FIXME 70 // WSignalMapper<GWt_abstractElement *> *mapper= new WSignalMapper<GWt_abstractElement *>(this); 71 // mapper->mapped().connect(this,&GWt_LigneFaisceau::onClick); 72 // mapper->mapConnect(gw->getButton()->doubleClicked(),gw); 72 GWt_dropZoneLigneFaiseau* dropZone = new GWt_dropZoneLigneFaiseau(pspa_); 73 dropZone->addElement(gw->getWidget()); 74 hbox_->addWidget(dropZone); 75 76 if (k < ((unsigned)nbElem-1)) { 77 hbox_->addWidget(new GWt_dropZoneLigneFaiseau(pspa_)); 78 } else { 79 hbox_->addWidget(new GWt_dropZoneLigneFaiseau(pspa_,false)); 80 } 73 81 } 74 82 -
Interface_Web/branches/insertionsElements/src/GWt_dropZoneLigneFaiseau.cc
r195 r197 2 2 3 3 #include "GWt_dropZoneLigneFaiseau.h" 4 #include "nomdElements.h" 4 5 5 6 #include <Wt/WCssDecorationStyle> … … 124 125 125 126 pspa_->addConsoleMessage(e.getElementName()); 127 126 128 abstractElement* ptr = pspa_->getDataManager()->addElement(eType); 127 // FIXME 128 // ptr->setLabel(createLabel(e,nObjets_[eType].incr())); 129 129 130 ptr->setLabel(getElementNumberInBeamLine(e)); 130 131 … … 187 188 abstractElement_ = gw->getWidget(); 188 189 addWidget(abstractElement_); 189 // change strech (useful if it was the last one 190 // change strech (useful if it was the last one) 190 191 layout->setStretchFactor(this,0); 191 192 … … 267 268 268 269 269 std::string GWt_dropZoneLigneFaiseau::getElementNumberInBeamLine(nomdElements el){ 270 void GWt_dropZoneLigneFaiseau::addElement(WContainerWidget* elem){ 271 clear(); 272 abstractElement_ = elem; 273 addWidget(abstractElement_); 274 275 insertMessage_ = NULL; 276 linkImage_ = NULL; 277 } 278 279 std::string GWt_dropZoneLigneFaiseau::getElementNumberInBeamLine(nomdElements elem){ 270 280 string str = ""; 271 281 … … 274 284 for (int a=0; a<wc->count(); a++) { 275 285 if (static_cast <GWt_abstractElement*> (wc->widget (a))) { 276 pspa_->addConsoleMessage("type trouvé"); 286 GWt_abstractElement* ab = static_cast <GWt_abstractElement*> (wc->widget (a)); 287 /* 288 printf("1--->%d\n",ab->getElement()); 289 printf("2--->%d\n",ab->getElement()->getLenghtOfElement()); 290 printf("3--->%d\n",ab->getElement()->getName().getElementType()); 291 printf("4--->%d\n",elem.getElementType()); 292 293 if (static_cast <GWt_abstractElement*> (wc->widget (a))->getElement()->getName().getElementType() == elem.getElementType()) { 294 pspa_->addConsoleMessage("type trouvé"); 295 } else { 296 pspa_->addConsoleMessage("type trouvé NOT "); 297 } 298 */ 299 277 300 } 278 301 } … … 285 308 286 309 if(n < 10) { 287 str= el .getElementLabel()+"0"+number;310 str= elem.getElementLabel()+"0"+number; 288 311 } else { 289 str= el .getElementLabel()+" "+number;312 str= elem.getElementLabel()+" "+number; 290 313 } 291 314 } 292 315 293 316 return str; 294 295 } 317 }
Note: See TracChangeset
for help on using the changeset viewer.