Changeset 299 in PSPA
- Timestamp:
- Jan 30, 2013, 11:49:18 AM (12 years ago)
- Location:
- Interface_Web/trunk/pspaWT
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface_Web/trunk/pspaWT/History
r297 r299 5 5 PSPA - Plateforme de simulation en physique des accélérateurs 6 6 ========================================================= 7 8 30 Janvier 2012 Laurent Garnier 9 - dataManager : Ajout de la méthode removeElement() 10 - GWt_elementLigneFaisceau : Amélioration de la gestion interne à cette classe 11 - GWt_dialog : Changement du format du message de std::string en WString 12 - GWt_LigneFaisceau,GWt_abstractElement : 13 Possibilité de suppression d'un élement par double-click sur celui-ci 14 - GWt_elementLigneFaisceau : Ajout d'une méthode pour récupérer l'abstract element 15 16 29 janvier 2013 Guy Le Meur 17 18 - création d'un classe abstractSoftware pour interfacer l'ajout de logiciels. 19 classes héritées softwareParmela, softwareTransport 7 20 8 21 29 Janvier 2012 Laurent Garnier … … 94 107 95 108 96 29 janvier 2013 Guy Le Meur97 98 - création d'un classe abstractSoftware pour interfacer l'ajout de logiciels.99 classes héritées softwareParmela, softwareTransport -
Interface_Web/trunk/pspaWT/sources/controler/include/dataManager.h
r295 r299 49 49 50 50 abstractElement* addElement(typedElement elemType); 51 void removeElement(string); 51 52 string getLabelFromElementNumero(int numero); 52 53 void initializeExecution(string workingDir); -
Interface_Web/trunk/pspaWT/sources/controler/src/dataManager.cc
r298 r299 13 13 return elementsGallery_.addElement(elemType); 14 14 } 15 16 17 void dataManager::removeElement(string elem) { 18 elementsGallery_.eraseElement(elem); 19 } 20 15 21 16 22 string dataManager::getLabelFromElementNumero(int numero) -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_dialog.h
r272 r299 37 37 @param okButton: true if you want a "ok" button at the end 38 38 */ 39 GWt_dialog(WString titre, std::string message, iconType icon=NoIcon, bool modal=false, bool okButton=false);39 GWt_dialog(WString titre, WString message, iconType icon=NoIcon, bool modal=false, bool okButton=false); 40 40 }; 41 41 #endif -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_elementLigneFaisceau.h
r292 r299 57 57 } 58 58 59 inline GWt_abstractElement* getElement() { 60 return abstractElement_; 61 } 62 59 63 private: 60 64 … … 67 71 68 72 GWt_dropZoneLigneFaisceau* dropZoneLeft_; 69 WContainerWidget* dragElementZone_;70 73 GWt_dropZoneLigneFaisceau* dropZoneRight_; 71 74 WText* elementName_; -
Interface_Web/trunk/pspaWT/sources/userInterface/include/GWt_ligneFaisceau.h
r289 r299 45 45 */ 46 46 void addElement(typedElement eType, GWt_dropZoneLigneFaisceau* dropContainer); 47 47 void removeElement(GWt_abstractElement*); 48 48 49 ~GWt_LigneFaisceau() { 49 50 if(nObjets_ != NULL) delete[] nObjets_; -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_abstractElement.cc
r294 r299 13 13 #include "GWt_fit.h" 14 14 #include "GWt_draggableImage.h" 15 #include "GWt_LigneFaisceau.h" 15 16 16 17 #include "mixedTools.h" … … 26 27 { 27 28 abstractElement_ = elem; 29 setStyleClass("beamLineIcon"); 30 28 31 } 29 32 … … 37 40 image_->doubleClicked().connect(this,&GWt_abstractElement::doubleClicked); 38 41 image_->clicked().connect(this,&GWt_abstractElement::clicked); 39 42 addWidget(image_); 40 43 } 41 44 … … 100 103 void GWt_abstractElement::doubleClicked() 101 104 { 102 cout << "mouse key was double clicked on this widget" << endl; 105 GWt_dialog warningDialog("PSPA : Delete element",WString("Delete '")+WString(getElement()->getLabel())+"' ?", GWt_dialog::Warning,true,true); 106 warningDialog.exec(); 107 108 // get LigneFaiseau widget and add new elementLigneFaiseau 109 GWt_LigneFaisceau* ligneFaisceau = NULL; 110 if ( static_cast<GWt_LigneFaisceau*> (wApp->findWidget ("ligneFaisceau"))) { 111 ligneFaisceau = static_cast<GWt_LigneFaisceau*> (wApp->findWidget ("ligneFaisceau")); 112 } else { 113 return; 114 } 115 116 ligneFaisceau->removeElement(this); 103 117 } 104 118 -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_dialog.cc
r272 r299 32 32 GWt_dialog::GWt_dialog( 33 33 WString titre, 34 std::string message,34 WString message, 35 35 iconType icon, 36 36 bool modal, … … 78 78 79 79 // changement des "\n" par des <br> 80 size_t pos = message. find("\n", 0);80 size_t pos = message.toUTF8().find("\n", 0); 81 81 82 82 while(pos != std::string::npos) { 83 vLayout->addWidget(new Wt::WText(WString::fromUTF8(message. substr(0,pos))));84 message = message. substr(pos+1);85 pos = message. find("\n");83 vLayout->addWidget(new Wt::WText(WString::fromUTF8(message.toUTF8 ().substr(0,pos)))); 84 message = message.toUTF8 ().substr(pos+1); 85 pos = message.toUTF8 ().find("\n"); 86 86 vLayout->addWidget(new Wt::WBreak()); 87 87 } 88 vLayout->addWidget(new Wt::WText( WString::fromUTF8(message)));88 vLayout->addWidget(new Wt::WText(message)); 89 89 90 90 -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_elementLigneFaisceau.cc
r293 r299 77 77 // add first line : initialize arrow and link images 78 78 dropZoneLeft_ = new GWt_dropZoneLigneFaisceau(pspa_); 79 dragElementZone_ = new WContainerWidget();80 79 dropZoneRight_ = new GWt_dropZoneLigneFaisceau(pspa_); 81 80 82 81 // change object name in order to manage css : 83 dragElementZone_->setStyleClass("beamLineIcon");84 82 dropZoneRight_->resize(10,30); 85 83 … … 93 91 94 92 gridLayout->addWidget (dropZoneLeft_,0,0); 95 gridLayout->addWidget (dragElementZone_,0,1);96 93 gridLayout->addWidget (dropZoneRight_,0,2); 97 94 … … 126 123 } 127 124 if (abstractElement_ != NULL) { 128 dragElementZone_->addWidget(abstractElement_->getImage());129 dragElementZone_->setMaximumSize(32,32);130 dragElementZone_->setMinimumSize(32,32);131 dragElementZone_->setToolTip(abstractElement_->print());125 gridLayout->addWidget (abstractElement_,0,1); 126 abstractElement_->setMaximumSize(32,32); 127 abstractElement_->setMinimumSize(32,32); 128 abstractElement_->setToolTip(abstractElement_->print()); 132 129 } 133 130 } … … 144 141 gridLayout->setColumnStretch (2,1); 145 142 146 // dragElementZone_->addWidget(firstTimeInsertMessage_);147 // gridLayout->addWidget (new WText("Drag elements here"),0,0);148 149 143 // set layout 150 144 setLayout(gridLayout); 151 //addWidget(new WText("Drag elements here"));152 145 } 153 146 -
Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_ligneFaisceau.cc
r292 r299 67 67 68 68 nObjets_[ptr->getNomdElement().getElementType()].incr(); 69 69 70 70 ligneFaisceauLayout_->addWidget(new GWt_elementLigneFaisceau(ptr,pspa_),1); 71 71 … … 92 92 return; 93 93 } 94 94 95 95 // add the element to the datamanager 96 96 abstractElement* ptr = pspa_->getDataManager()->addElement(eType); … … 166 166 } 167 167 } 168 169 } 170 168 } 169 170 171 void GWt_LigneFaisceau::removeElement(GWt_abstractElement* abstractElement) { 172 if (abstractElement == NULL) 173 return; 174 175 // remove Widget 176 // - GWt_abstractElement is an element of the GWt_elementLigneFaisceau_ 177 178 int index = -1; 179 for (int a=0; a< ligneFaisceauLayout_->count(); a++) { 180 GWt_elementLigneFaisceau* elem = static_cast <GWt_elementLigneFaisceau*> (ligneFaisceauLayout_->itemAt(a)->widget ()); 181 if (elem) { 182 if (elem->getElement() == abstractElement) { 183 index = a; 184 } 185 } 186 } 187 188 if (index != -1) { 189 // remove element from the list 190 pspa_->getDataManager()->removeElement(abstractElement->getElement()->getLabel()); 191 192 ligneFaisceauLayout_->removeItem(ligneFaisceauLayout_->itemAt(index)); 193 delete abstractElement; 194 195 // manage widgets if necessary 196 manageLineFaisceauLayout(); 197 } 198 199 200 } 201
Note: See TracChangeset
for help on using the changeset viewer.