Ignore:
Timestamp:
Jan 25, 2013, 2:54:08 PM (11 years ago)
Author:
garnier
Message:
  • Restaurer la config refonctionne
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc

    r282 r284  
    6262    unsigned int k;
    6363   
    64     // add first dropZone
    65     ligneFaisceauLayout_->addWidget(new GWt_elementLigneFaisceau());
    66    
    6764    for(k = 0; k < (unsigned)nbElem; k++)
    6865    {
    6966        abstractElement* ptr = pspa_->getDataManager()->getCollection()->getElementPointerFromIndex(k);
    70         /*      GWt_abstractElement* gw = GWt_abstractElement::ajoute(ptr);
     67                GWt_abstractElement* gw = GWt_abstractElement::ajoute(ptr);
    7168         if(gw == NULL) {
    72          cerr << "GWt_LigneFaisceau::restaure element type " << ptr->getNomdElement().getElementName() << " est inconnu " << endl;
     69/*
     70 GWt_dialog warningDialog("PSPA : restore configuration", " Element type "+ptr->getNomdElement().getElementName()+" not reconized", GWt_dialog::Error,true,true);
     71             warningDialog.exec();
     72*/
    7373         }
    7474         gw->setLabelWidget();
    75          */
     75         
    7676        nObjets_[ptr->getNomdElement().getElementType()].incr();
    77         GWt_elementLigneFaisceau* dropZone = new GWt_elementLigneFaisceau(ptr);
    7877       
    79         /*      dropZone->addElement(gw->getWidget());
    80          */
    81         ligneFaisceauLayout_->addWidget(dropZone,0);
     78        ligneFaisceauLayout_->addWidget(new GWt_elementLigneFaisceau(ptr),1);
    8279       
    8380       
     
    8986         */
    9087    }
     88    manageLineFaisceauLayout();
    9189   
    9290    pspa_->updateSelections();
     
    132130                    index = a+1;
    133131                }
    134                 //                printf("ELEM : %s ‰d\n",elem->getElementName()->text().toUTF8 ().c_str() , a);
    135             } else {
    136                 printf("NOT an elem %d\n",a);
    137132            }
    138133           
     
    145140        }
    146141    }
     142    manageLineFaisceauLayout();
     143   
     144}
     145
     146
     147void GWt_LigneFaisceau::manageLineFaisceauLayout() {
    147148    // special : hide/setVisible arrow :
    148149    for (int a=0; a< ligneFaisceauLayout_->count(); a++) {
    149150        GWt_elementLigneFaisceau* elem = static_cast <GWt_elementLigneFaisceau*> (ligneFaisceauLayout_->itemAt(a)->widget ());
    150151        if (elem) {
    151             printf("ELEM : %s n",elem->getElementName()->text().toUTF8 ().c_str());
    152152            if ((a == 0) && (a == (ligneFaisceauLayout_->count()-1))) {
    153153                elem->getDropZoneLeft()->setStyleClass("elementLigneFaiseau_transparent");
    154154                elem->getDropZoneRight()->setStyleClass("elementLigneFaiseau_transparent");
    155155                elem->getDropZoneLeft()->widget(0)->setHidden(true);
    156                 printf(" -------   -------\n");
     156                printf(" - -  %d\n",a);
    157157            } else if (a == 0){
    158158                elem->getDropZoneLeft()->setStyleClass("elementLigneFaiseau_transparent");
    159159                elem->getDropZoneRight()->setStyleClass("elementLigneFaiseau_line");
    160160                elem->getDropZoneLeft()->widget(0)->setHidden(true);
    161                 printf(" -------   DROIT\n");
     161                printf(" - D %d\n",a);
    162162            } else if (a == (ligneFaisceauLayout_->count()-1)){
    163163                elem->getDropZoneLeft()->setStyleClass("elementLigneFaiseau_line");
    164164                elem->getDropZoneRight()->setStyleClass("elementLigneFaiseau_transparent");
    165165                elem->getDropZoneLeft()->widget(0)->setHidden(false);
    166                 printf(" GAUCHE    -----\n");
    167166               
     167                printf(" L - %d\n",a);
    168168            } else {
    169169                elem->getDropZoneLeft()->setStyleClass("elementLigneFaiseau_line");
    170170                elem->getDropZoneRight()->setStyleClass("elementLigneFaiseau_line");
    171171                elem->getDropZoneLeft()->widget(0)->setHidden(false);
    172                 printf(" GAUCHE    DROIT\n");
     172                printf(" L D %d\n",a);
    173173            }
    174174        }
Note: See TracChangeset for help on using the changeset viewer.