Changeset 197 in PSPA


Ignore:
Timestamp:
Dec 17, 2012, 5:21:22 PM (12 years ago)
Author:
garnier
Message:

insertion, correction et ameliorations

Location:
Interface_Web/branches/insertionsElements
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/branches/insertionsElements/include/GWt_dropZoneLigneFaiseau.h

    r195 r197  
    1818  GWt_dropZoneLigneFaiseau(PspaApplication*,bool linkImage = true);
    1919  ~GWt_dropZoneLigneFaiseau();
    20 
     20  void addElement(WContainerWidget* elem);
    2121
    2222 private:
  • Interface_Web/branches/insertionsElements/src/GWt_LigneFaisceau.cc

    r195 r197  
    5656  int nbElem = pspa_->getDataManager()->beamLineSize();
    5757  unsigned int k;
     58
     59  // add first dropZone
     60  hbox_->addWidget(new GWt_dropZoneLigneFaiseau(pspa_,false));
     61
    5862  for(k = 0; k < (unsigned)nbElem; k++)
    5963    {     
     
    6670      gw->updateLabelWidget();
    6771      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      }
    7381    }
    7482
  • Interface_Web/branches/insertionsElements/src/GWt_dropZoneLigneFaiseau.cc

    r195 r197  
    22
    33#include "GWt_dropZoneLigneFaiseau.h"
     4#include "nomdElements.h"
    45
    56#include <Wt/WCssDecorationStyle>
     
    124125
    125126  pspa_->addConsoleMessage(e.getElementName());
     127
    126128  abstractElement* ptr = pspa_->getDataManager()->addElement(eType);
    127   // FIXME
    128   //  ptr->setLabel(createLabel(e,nObjets_[eType].incr()));
     129
    129130  ptr->setLabel(getElementNumberInBeamLine(e));
    130131
     
    187188    abstractElement_ = gw->getWidget();
    188189    addWidget(abstractElement_);
    189     // change strech (useful if it was the last one
     190    // change strech (useful if it was the last one)
    190191    layout->setStretchFactor(this,0);           
    191192
     
    267268
    268269
    269 std::string GWt_dropZoneLigneFaiseau::getElementNumberInBeamLine(nomdElements el){
     270void GWt_dropZoneLigneFaiseau::addElement(WContainerWidget* elem){
     271  clear();
     272  abstractElement_ = elem;
     273  addWidget(abstractElement_);
     274
     275  insertMessage_ = NULL;
     276  linkImage_ = NULL;
     277}
     278
     279std::string GWt_dropZoneLigneFaiseau::getElementNumberInBeamLine(nomdElements elem){
    270280  string str = "";
    271281 
     
    274284    for (int a=0; a<wc->count(); a++) {
    275285      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
    277300      }
    278301    }
     
    285308   
    286309    if(n < 10) {
    287       str= el.getElementLabel()+"0"+number;
     310      str= elem.getElementLabel()+"0"+number;
    288311    } else {
    289     str= el.getElementLabel()+" "+number;
     312    str= elem.getElementLabel()+" "+number;
    290313    }
    291314  }
    292315
    293316  return str;
    294 
    295 }
     317}
Note: See TracChangeset for help on using the changeset viewer.