Changeset 339
- Timestamp:
- 06/03/10 14:07:34 (14 years ago)
- Location:
- trunk/yao/src/interface/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/interface/src/ContextWindow.cpp
r338 r339 19 19 //! \brief Implementation of the Context window for visual_YAO. 20 20 21 ContextWindow::ContextWindow( Table <Constant> *aConstantTable, QWidget *parent) : QWidget(parent) {21 ContextWindow::ContextWindow(Context *aContext, Table <Constant> *aConstantTable, QWidget *parent) : QWidget(parent) { 22 22 23 23 this->setWindowTitle("Directive Option."); … … 25 25 compteur = 0; 26 26 localConstantTable = aConstantTable; 27 m_localContext = aContext; 27 28 m_ContextLayoutH1 = new QHBoxLayout; 28 29 m_ContextLayoutH2 = new QHBoxLayout; … … 60 61 } 61 62 62 63 64 63 m_checkBoxO_GRADTEST = new QCheckBox("O_GRADTEST") ; 65 64 m_checkBoxO_VARINCR = new QCheckBox("O_VARINCR") ; … … 86 85 87 86 m_contextTableView = new QTableView ; 88 87 89 88 m_contextTableView->setModel(contextModele); 90 89 m_contextTableView->setEditTriggers(QAbstractItemView::NoEditTriggers); /*!< this ligne give no edit mode*/ … … 93 92 m_contextTableView->resizeColumnsToContents(); 94 93 94 O_EXTOBJModele = new QStandardItemModel(0, 1) ; 95 95 96 m_O_EXTOBJListView = new QListView ; 96 97 m_O_EXTOBJListView->setModel(O_EXTOBJModele); 97 98 m_O_DBGLayoutG = new QGridLayout; 98 99 m_O_DBGLayoutG->addWidget(m_checkBoxO_DBG_NANF, 0, 0); … … 144 145 connect(m_ContextHelpButton, SIGNAL(clicked()), this, SLOT(callContextHelp())); 145 146 147 148 connect(m_addButtonO_EXTOBJ, SIGNAL(clicked()), this, SLOT(addO_EXTOBJRow())); 149 150 connect(m_delButtonO_EXTOBJ, SIGNAL(clicked()), this, SLOT(deleteO_EXTOBJRow())); 151 146 152 setLayout(m_layoutGContext); 147 153 setFixedWidth(baseSize().width() + 645); … … 158 164 159 165 } 160 166 /**************************************** Implémentation de la méthode addO_EXTOBJRow() *****************************************************************/ 167 void ContextWindow::addO_EXTOBJRow() { 168 169 O_EXTOBJModele->appendRow(new QStandardItem(m_comboContextO_EXTOBJ->currentText())); 170 m_comboContextO_EXTOBJ->setCurrentIndex(0); 171 } 172 173 /**************************************** Implémentation de la méthode deleteO_EXTOBJRow() *****************************************************************/ 174 void ContextWindow::deleteO_EXTOBJRow() { 175 176 QItemSelectionModel *selection = m_O_EXTOBJListView->selectionModel(); 177 O_EXTOBJIndex = selection->currentIndex(); 178 if (!O_EXTOBJIndex.isValid()) 179 return; 180 QVariant element = O_EXTOBJModele->data(O_EXTOBJIndex, Qt::DisplayRole); 181 int r = O_EXTOBJIndex.row(); 182 if (selection->hasSelection()) { 183 O_EXTOBJModele->removeRows(m_O_EXTOBJListView->currentIndex().row(), 1); 184 //localHeaderList->erase(localHeaderList->begin() + r); 185 //if(isHeaderListEmpty()) m_delHatButton->setDisabled(true); 186 } 187 //cout << "Salut" << endl; 188 } 161 189 /*************************************** Implémentation de la méthode eraseDataFromLineEdit() ****************************************************************/ 162 190 void ContextWindow::eraseDataFromLineEdit() { … … 176 204 m_checkBoxO_DBG_TRC_LWARD->setChecked(false); 177 205 m_checkBoxO_DBG_TRC_AWARD->setChecked(false); 178 179 180 206 181 207 } -
trunk/yao/src/interface/src/HatNameWindow.cpp
r329 r339 14 14 /*************************************** The class constructor: HatNameWindow() ********************************************************************/ 15 15 HatNameWindow::HatNameWindow(vector <string> *aHeaderList, Table <Constant> *aConstantTable, QWidget *parent) : QWidget(parent), modeleFichiers(NULL), 16 vueFichiers(NULL), modeleHatName(NULL), localHeaderList(NULL), localConstantTable(NULL)16 hatView(NULL), modeleHatName(NULL), localHeaderList(NULL), localConstantTable(NULL) 17 17 18 18 { … … 46 46 for (vector <string>::iterator it = localHeaderList->begin(); it != localHeaderList->end(); it++) 47 47 modeleHatName->appendRow(new QStandardItem(it->c_str())); 48 vueFichiers= new QListView;49 vueFichiers->setModel(modeleHatName);48 hatView = new QListView; 49 hatView->setModel(modeleHatName); 50 50 51 51 m_boutonouvrir->setIcon(QIcon("Images/icons/openfile.png")); //Affichage d'une image sur le bouton "ouvrir" … … 57 57 m_layoutGHatName->addWidget(m_boutonouvrir, 0, 3, Qt::AlignLeft); 58 58 59 m_layoutGHatName->addWidget( vueFichiers, 2, 1, 7, 2);59 m_layoutGHatName->addWidget(hatView, 2, 1, 7, 2); 60 60 61 61 m_layoutGHatName->addWidget(m_boutonAjouter, 3, 3); … … 193 193 void HatNameWindow::deleteHatRow() { 194 194 195 QItemSelectionModel *selection = vueFichiers->selectionModel(); //Un ensemble sur les éléments selectionnés195 QItemSelectionModel *selection = hatView->selectionModel(); //Un ensemble sur les éléments selectionnés 196 196 index = selection->currentIndex(); //Précision de l'élément courant selectionné 197 197 … … 203 203 if (selection->hasSelection()) // Evite certains effets indésirables: suppression de la derniere ligne aprÚs clic sur le vide. 204 204 { 205 modeleHatName->removeRows( vueFichiers->currentIndex().row(), 1);// Le 2Úme parametre indique le nombre de ligne à supprimer205 modeleHatName->removeRows(hatView->currentIndex().row(), 1);// Le 2Úme parametre indique le nombre de ligne à supprimer 206 206 localHeaderList->erase(localHeaderList->begin() + r);//On met à jour la structure de données en supprimant aussi l'élement. 207 207 //m_tableView->resizeRowToContents(c - 1); // columnCountChanged(c , c-1); … … 292 292 HatNameWindow::~HatNameWindow() { 293 293 294 // delete vueFichiers;294 // delete hatView; 295 295 } 296 296 /****************************************************************************************************************************************************/ -
trunk/yao/src/interface/src/MainWindow.cpp
r336 r339 342 342 if (m_ContextCopy == NULL) { //to test if the object is already created. 343 343 344 m_ContextCopy = new ContextWindow(&theCon stantTable); //mwc.getContext();344 m_ContextCopy = new ContextWindow(&theContext, &theConstantTable); //mwc.getContext(); 345 345 espace->addWindow(m_ContextCopy)->move(5, 0); 346 346 m_ContextCopy->show(); -
trunk/yao/src/interface/src/include/ContextWindow.hpp
r337 r339 18 18 #include <QGroupBox> 19 19 #include <QStandardItemModel> 20 #include <QItemSelectionModel> 20 21 #include <QModelIndex> 21 22 #include <QFileDialog> … … 37 38 38 39 public : 39 ContextWindow(yao:: Table <yao::Constant> *aConstantTable, QWidget *parent=0);40 ContextWindow(yao::Context *aContext, yao::Table <yao::Constant> *aConstantTable, QWidget *parent=0); 40 41 QStringList getContextData(); 41 42 bool testContenu(int anInt); … … 47 48 void saveContextData(); 48 49 void addContextRow(); 50 void addO_EXTOBJRow(); 51 void deleteO_EXTOBJRow(); 49 52 void deleteContextRow(); 50 53 void callContextHelp(); … … 101 104 102 105 QStandardItemModel *contextModele; 106 QStandardItemModel *O_EXTOBJModele; 103 107 QModelIndex index; 108 QModelIndex O_EXTOBJIndex; 104 109 105 110 QTableView *m_contextTableView; 106 111 QListView *m_O_EXTOBJListView ; 107 112 108 yao::Context *m_ theContext;113 yao::Context *m_localContext; 109 114 std::vector<std::string> anVector; 110 115 yao::Table <yao::Constant> *localConstantTable; -
trunk/yao/src/interface/src/include/HatNameWindow.hpp
r320 r339 119 119 QStringList listeFichiers; 120 120 QStringListModel *modeleFichiers; 121 QListView * vueFichiers;121 QListView *hatView; 122 122 123 123 QStandardItemModel *modeleHatName; … … 131 131 std::string localProjectName; 132 132 yao::Table <yao::Constant> *localConstantTable; 133 int i;134 133 }; 135 134 #endif -
trunk/yao/src/interface/src/include/MainWindow.hpp
r329 r339 8 8 //#include "../Translator.hpp" 9 9 10 11 10 #include "MainWindowController.hpp" 12 11 #include "../help/Enforcer.hpp" 13 12 #include "../help/FilePath.hpp" 14 13 #include "../YAOObjects/Modul.hpp" 15 14 16 15 #include <QtGui> 17 16 #include <QMainWindow> 18 17 #include <QWorkspace> 19 #include <QPushButton>20 #include <QTabWidget>21 #include <QWidget>22 #include <QCloseEvent>23 24 18 25 19 #include "ConnectionWindow.hpp" … … 36 30 #include "ContextWindow.hpp" 37 31 #include "OrderWindow.hpp" 38 39 #include "../YAOObjects/Table.hpp"40 #include "../YAOObjects/Constant.hpp"41 #include "../YAOObjects/Trajectory.hpp"42 #include "../YAOObjects/Operator.hpp"43 #include "../YAOObjects/Modul.hpp"44 32 45 33 /*! … … 93 81 void createNewProjectWindow(); 94 82 void helpMessage(); 95 //void callHatModel();96 83 void createDefvalWindow(); 97 84 void createHatNameWindow(); … … 115 102 void openPathWindow(); 116 103 void setTitle(); 117 //void setWindowTitle(const QString &title);118 104 void hatUpdate(); 119 105 void hatUpdate(QString choix ); … … 227 213 yao::Table <yao::Constant> theConstantTable; 228 214 std::vector <string> theHeaderList; 215 yao::Context theContext; 229 216 yao::Table <yao::Trajectory> theTrajectoryTable; 230 217 yao::Table <yao::Space> theSpaceTable;
Note: See TracChangeset
for help on using the changeset viewer.