Changeset 344
- Timestamp:
- 06/17/10 17:54:19 (14 years ago)
- Location:
- trunk/yao/src/interface
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/interface/Main.cpp
r343 r344 1 1 //! \file Main.cpp 2 2 //! \brief Main function for visual_YAO. 3 //! \version 20 09/11/09(yyyy/mm/dd)4 //! \author MAYAKI Abdouramane & MAYOMBO Alexis.3 //! \version 2010/06/17 (yyyy/mm/dd) 4 //! \author MAYAKI Abdouramane. 5 5 6 6 /* … … 18 18 #include <exception> 19 19 #include "src/include/MainWindow.hpp" 20 //#include "src/ Include/MainWindowController.hpp"20 //#include "src/include/MainWindowController.hpp" 21 21 //#include "BasicWindow.hpp" 22 22 //#include <iostream> … … 40 40 QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); 41 41 42 //MainWindowController *fen1 = new MainWindowController; fen1->show();42 //MainWindowController *fen1 = new MainWindowController; //fen1->show(); 43 43 //MainWindowController m_mwc ;//= MainWindowController::getInstance(); 44 44 // try { 45 45 MainWindow fen1;// = new MainWindow(&m_mwc); //fen1->show(); 46 46 /*int a=2, b=3; 47 double c=4.65 , d= 3.14; 48 cout << "int, le plus petit est:" << m_mwc.Min(a,b) << endl; 49 cout << "double, le plus petit est: " << m_mwc.Min(c,d) << endl; 50 */ 51 //m_mwc.isStringLiteral("tes-"); 47 52 fen1.show(); 48 53 -
trunk/yao/src/interface/src/ConstantWindow.cpp
r341 r344 22 22 /*************************************************************** The constructor **********************************************************************/ 23 23 ConstantWindow::ConstantWindow(Table <Constant> *aConstantTable, vector <string> *aHeaderList, MainWindowController *mwc, QWidget *parent): QWidget(parent), m_localConstantTable(NULL), localHatWindow(NULL) { /*!< The constructor. */ 24 25 setWindowTitle("Directive Constant."); /*!< To set the window's title. */24 setupUi(this); 25 // setWindowTitle("Directive Constant."); /*!< To set the window's title. */ 26 26 m_localConstantTable = aConstantTable; 27 27 localHeaderList = aHeaderList; … … 29 29 //localConstantController = aConstantController; 30 30 31 m_nameLabel = new QLabel("Nom constante: ", this); /*!< QLabel for Nom de la constante . */32 m_valueLabel = new QLabel("Valeur constante: ", this); /*!< QLabel for Valeur de la constante. */33 34 m_ligneNom = new QLineEdit(this) ; /*!< Name of the QLineEdit. */35 m_ligneValeur = new QLineEdit(this) ; /*!< Value of the QLineEdit. */36 37 m_addButton = new QPushButton("Ajouter", this); /*!< QPushButton for Ajout. */38 m_helpButton = new QPushButton("Aide"); /*!< QPushButton for aide. */39 m_helpButton->setMaximumSize(35, 25);40 m_delButton = new QPushButton("Supprimer", this); /*!< QPushButton for Supprimer. */31 // m_nameLabel = new QLabel("Nom constante: ", this); /*!< QLabel for Nom de la constante . */ 32 // m_valueLabel = new QLabel("Valeur constante: ", this); /*!< QLabel for Valeur de la constante. */ 33 34 // m_ligneNom = new QLineEdit(this) ; /*!< Name of the QLineEdit. */ 35 // m_ligneValeur = new QLineEdit(this) ; /*!< Value of the QLineEdit. */ 36 37 // m_addButton = new QPushButton("Ajouter", this); /*!< QPushButton for Ajout. */ 38 // m_helpButton = new QPushButton("Aide"); /*!< QPushButton for aide. */ 39 // m_helpButton->setMaximumSize(35, 25); 40 // m_delButton = new QPushButton("Supprimer", this); /*!< QPushButton for Supprimer. */ 41 41 if(isConstantTableEmpty()) m_delButton ->setDisabled(true); /*!< setDisabled is true. */ 42 m_quitButton = new QPushButton("Quitter", this); /*!< QPushButton for Quitter. */42 // m_quitButton = new QPushButton("Quitter", this); /*!< QPushButton for Quitter. */ 43 43 44 44 modele = new QStandardItemModel(0, 2);//Nombre de lignes et colonnes du modÚle. … … 53 53 // modele->setHorizontalHeaderLabels(QStringList() << "Constante(s)" << "Valeur(s)"); /*!< displays the QTableWidget */ 54 54 //if (mwc->isStringLiteral("malkj")) cout << "cest bon ça" << endl; else cout << "Oh dommage!" << endl; 55 m_tableView = new QTableView; /*!< QTableWidget's in whitch the objects are listed for thue view. */55 // m_tableView = new QTableView; /*!< QTableWidget's in whitch the objects are listed for thue view. */ 56 56 m_tableView->setModel(modele); 57 57 m_tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); /*!< this ligne give no edit mode*/ … … 61 61 //QHeaderView *horiz = new QHeaderView(Qt::Horizontal); 62 62 63 m_layoutGrid = new QGridLayout; /*!< set QGridLayout m-layoutG */64 m_layoutGrid->addWidget(m_nameLabel , 0, 2);65 m_layoutGrid->addWidget(m_ligneNom , 0, 3, 1, 2);66 m_layoutGrid->addWidget(m_valueLabel , 1, 2);67 m_layoutGrid->addWidget(m_ligneValeur , 1, 3, 1, 2);68 m_layoutGrid->addWidget(m_tableView , 2, 2, 7, 2); /*!< added m_m_tableView in the QGridLayout */69 m_layoutGrid->addWidget(m_addButton , 3, 4); /*!< added m_addButton in the QGridLayout */70 m_layoutGrid->addWidget(m_delButton , 4, 4); /*!< added m_delButton in the QGridLayout */71 m_layoutGrid->addWidget(m_quitButton, 5, 4);72 m_layoutGrid->addWidget(m_helpButton, 8, 4); /*!< m_ helpButton in the QGridLayout */73 74 setLayout(m_layoutGrid); //Activation du gestionnaire principal.63 // m_layoutGrid = new QGridLayout; /*!< set QGridLayout m-layoutG */ 64 // m_layoutGrid->addWidget(m_nameLabel , 0, 2); 65 // m_layoutGrid->addWidget(m_ligneNom , 0, 3, 1, 2); 66 // m_layoutGrid->addWidget(m_valueLabel , 1, 2); 67 // m_layoutGrid->addWidget(m_ligneValeur , 1, 3, 1, 2); 68 // m_layoutGrid->addWidget(m_tableView , 2, 2, 7, 2); /*!< added m_m_tableView in the QGridLayout */ 69 // m_layoutGrid->addWidget(m_addButton , 3, 4); /*!< added m_addButton in the QGridLayout */ 70 // m_layoutGrid->addWidget(m_delButton , 4, 4); /*!< added m_delButton in the QGridLayout */ 71 // m_layoutGrid->addWidget(m_quitButton, 5, 4); 72 // m_layoutGrid->addWidget(m_helpButton, 8, 4); /*!< m_ helpButton in the QGridLayout */ 73 74 // setLayout(m_layoutGrid); //Activation du gestionnaire principal. 75 75 76 76 … … 81 81 //connect(this, SIGNAL(dataAdded()), this, SLOT(saveData())); /*!< This slot save data in structure */ 82 82 83 setFixedWidth(baseSize().width() + 3 05);83 setFixedWidth(baseSize().width() + 320); 84 84 // move(0, 0); 85 85 } -
trunk/yao/src/interface/src/ContextWindow.cpp
r341 r344 147 147 m_comboContextO_EXTOBJ->setCurrentIndex(0); 148 148 } 149 /**********************************************************************/ 150 void ContextWindow::closeEvent(QCloseEvent *event){ 151 152 /* if (!(m_comboHatName->currentText().isEmpty()) && !(m_comboHatName->currentText().isEmpty())) { 153 int ret = QMessageBox::warning(this, tr("Confirmation de fermeture"), tr("Voulez-vous vraiment quitter?"), 154 QMessageBox::Yes | QMessageBox::Default, QMessageBox::Cancel | QMessageBox::Escape); 155 156 if (ret == QMessageBox::Yes) 157 event->accept(); //cout << " test qui marche!" << endl; 158 // event->accept(); 159 else 160 event->ignore(); 161 }*/ 162 163 emit contextWindowIsClosed(3); 164 } 165 149 166 150 167 /**************************************** Implémentation de la méthode deleteO_EXTOBJRow() **********************************************************/ -
trunk/yao/src/interface/src/MainWindow.cpp
r341 r344 319 319 connect(m_ConstantCopy, SIGNAL(rowIsAdded()), this, SLOT(hatUpdate())); 320 320 connect(m_ConstantCopy, SIGNAL(rowIsDeleted(QString )), this, SLOT(hatUpdate(QString ))); 321 connect(m_ConstantCopy, SIGNAL(windowIsClosed(int )), this, SLOT(initializeWindow(int ))); 321 connect(m_ConstantCopy, SIGNAL(windowIsClosed(int )), this, SLOT(initializeWindow(int )));// The signal is in the ConstantWindow.hpp file. 322 322 323 323 } … … 332 332 } 333 333 334 connect(m_hatCopy, SIGNAL(hatWindowIsClosed(int)), this, SLOT(initializeWindow(int))); 334 connect(m_hatCopy, SIGNAL(hatWindowIsClosed(int)), this, SLOT(initializeWindow(int)));// The signal is in the HatNameWindow.hpp file. 335 335 } 336 336 /********************************************* Implementation of the method createContextWindow() *************************************************/ … … 344 344 } 345 345 346 //connect(m_ContextCopy, SIGNAL(contextWindowIsClosed(int)), this, SLOT(initializeWindow(int)));346 connect(m_ContextCopy, SIGNAL(contextWindowIsClosed(int)), this, SLOT(initializeWindow(int))); 347 347 } 348 348 /********************************************* Implementation of the method createTrajectoryWindow() ************************************************/ … … 355 355 m_trajCopy->show(); 356 356 357 m_trajCopy = NULL;357 //m_trajCopy = NULL; 358 358 } 359 359 360 //connect(m_ContextCopy, SIGNAL(contextWindowIsClosed(int)), this, SLOT(initializeWindow(int)));360 connect(m_trajCopy, SIGNAL(trajectoryWindowIsClosed(int)), this, SLOT(initializeWindow(int))); 361 361 } 362 362 /********************************************* Implementation of the method createSpaceWindow() ************************************************/ … … 419 419 case 6: { 420 420 m_operaCopy = NULL; 421 break; 422 } 423 case 7: { 421 } break; 422 case 7: { 424 423 m_netwardCopy = NULL; 425 424 break; … … 741 740 } 742 741 /********************************************* Implementation of the method setWindowTitle(const QString &title) ***********************************/ 743 //void MainWindow::setWindowTitle(const QString &title) { 744 745 // QWidget::setWindowTitle(title); 746 //} 742 void MainWindow::setActiveProject(const bool aBool) { 743 744 m_activeProject = aBool; 745 } 746 /********************************************* Implementation of the method setWindowTitle(const QString &title) ***********************************/ 747 bool MainWindow::isActiveProject() { 748 749 return m_activeProject; 750 } 747 751 /************************************** Implementation of the method createFile(string data, string extension) ************************************/ 748 752 void MainWindow::createFile(string data, string extension) { -
trunk/yao/src/interface/src/MainWindowController.cpp
r341 r344 27 27 // return instance; 28 28 //} 29 29 /*******************************************************************/ 30 //template <class T> void MainWindowController::Min(T x, T y) { 31 32 // cout << "valeurs: " << x << y << endl; 33 //return x<y ? x : y; 34 //} 30 35 /********************************************************* isStringLiteral(string aString) **********************************************************/ 31 36 bool MainWindowController::isStringLiteral(string aString) { -
trunk/yao/src/interface/src/TrajectoryWindow.cpp
r341 r344 491 491 } 492 492 */ 493 /***********************************************************************/ 494 void TrajectoryWindow::closeEvent(QCloseEvent *event) { 495 496 emit trajectoryWindowIsClosed(4); 497 } -
trunk/yao/src/interface/src/include/ConstantWindow.hpp
r341 r344 10 10 #include "HatNameWindow.hpp" 11 11 #include "MainWindowController.hpp" 12 #include "../../ui_constantwindow.h" 12 13 13 class ConstantWindow : public QWidget {14 class ConstantWindow : public QWidget, Ui::ConstantWindow { 14 15 15 16 Q_OBJECT; … … 46 47 private: 47 48 48 QLabel *m_nameLabel;49 /*QLabel *m_nameLabel; 49 50 QLabel *m_valueLabel; 50 51 … … 59 60 60 61 QGridLayout *m_layoutGrid; 61 62 */ 62 63 yao::Table <yao::Constant> *m_localConstantTable; 63 64 yao::Constant *m_localConstant; … … 69 70 QStandardItemModel *modele; 70 71 QModelIndex index; 71 QTableView *m_tableView;72 //QTableView *m_tableView; 72 73 MainWindowController *localMwc; 73 74 //ConstantWindowController *localConstantController; -
trunk/yao/src/interface/src/include/ContextWindow.hpp
r341 r344 28 28 Q_OBJECT 29 29 30 30 public : 31 31 ContextWindow(yao::Context *aContext, yao::Table <yao::Constant> *aConstantTable, MainWindowController *mwc, QWidget *parent=0); 32 32 QStringList getContextData(); … … 34 34 void eraseDataFromLineEdit(); 35 35 36 36 private slots: 37 37 38 38 //void enregistrerContext(); … … 44 44 void deleteContextRow(); 45 45 void callContextHelp(); 46 private : 46 47 protected : 48 void closeEvent(QCloseEvent *event); 49 50 signals : 51 52 void contextWindowIsClosed(int anInt); 53 54 55 private : 47 56 48 57 QFileDialog *projetContext; -
trunk/yao/src/interface/src/include/MainWindow.hpp
r341 r344 63 63 std::string getProjectPath(); 64 64 void directivesManager(); 65 void setActiveProject(const bool aBool); 66 bool isActiveProject(); 65 67 // void creerRepertoire(); 66 68 // void genererConstant(); … … 224 226 yao::Table <yao::Operator> theOperaTable; 225 227 yao::Table <yao::Modul> theModulTable; 226 228 229 bool m_activeProject; 230 227 231 }; 228 232 #endif // FENETREPRINCIPALE_HPP -
trunk/yao/src/interface/src/include/MainWindowController.hpp
r341 r344 33 33 //ConstantWindow *getConstant(); 34 34 void setConstant(); 35 template <class T> T Min(T x, T y){ 36 37 return x<y ? x:y; 35 38 39 } 40 //template <class R, class S, class T> void addRowInTable(R, S, T) { 41 42 // modele->setItem(modele->rowCount(), 0, new QStandardItem(m_ligneNom->text())); 43 44 //} 36 45 void setFileListController(std::string fileController); 37 46 std::string getProjectNameFromMWC(); -
trunk/yao/src/interface/src/include/TrajectoryWindow.hpp
r341 r344 119 119 //char type; 120 120 //int compteur; 121 121 protected: 122 void closeEvent(QCloseEvent *event); 123 124 signals: 125 void trajectoryWindowIsClosed(int anInt); 126 122 127 }; 123 128
Note: See TracChangeset
for help on using the changeset viewer.