Changeset 344


Ignore:
Timestamp:
06/17/10 17:54:19 (14 years ago)
Author:
yerima
Message:

Adding for the constantwindow.ui file in the directory ui.

Location:
trunk/yao/src/interface
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/yao/src/interface/Main.cpp

    r343 r344  
    11//! \file    Main.cpp 
    22//! \brief   Main function for visual_YAO. 
    3 //! \version 2009/11/09 (yyyy/mm/dd) 
    4 //! \author  MAYAKI Abdouramane & MAYOMBO Alexis. 
     3//! \version 2010/06/17 (yyyy/mm/dd) 
     4//! \author  MAYAKI Abdouramane. 
    55 
    66/* 
     
    1818#include <exception> 
    1919#include "src/include/MainWindow.hpp" 
    20 //#include "src/Include/MainWindowController.hpp" 
     20//#include "src/include/MainWindowController.hpp" 
    2121//#include "BasicWindow.hpp" 
    2222//#include <iostream> 
     
    4040        QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); 
    4141 
    42                 //MainWindowController *fen1 = new MainWindowController; fen1->show(); 
     42                //MainWindowController *fen1 = new MainWindowController; //fen1->show(); 
    4343                //MainWindowController m_mwc ;//= MainWindowController::getInstance();  
    4444//      try { 
    4545                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-"); 
    4752                fen1.show(); 
    4853 
  • trunk/yao/src/interface/src/ConstantWindow.cpp

    r341 r344  
    2222/*************************************************************** The constructor **********************************************************************/ 
    2323ConstantWindow::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. */ 
    2626        m_localConstantTable    = aConstantTable; 
    2727        localHeaderList         = aHeaderList; 
     
    2929        //localConstantController = aConstantController; 
    3030                 
    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. */ 
    4141                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. */ 
    4343 
    4444        modele = new  QStandardItemModel(0, 2);//Nombre de lignes et colonnes du modÚle. 
     
    5353        //      modele->setHorizontalHeaderLabels(QStringList() << "Constante(s)" << "Valeur(s)"); /*!< displays the QTableWidget */ 
    5454        //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. */ 
    5656                m_tableView->setModel(modele); 
    5757                m_tableView->setEditTriggers(QAbstractItemView::NoEditTriggers); /*!< this ligne give no edit mode*/ 
     
    6161        //QHeaderView *horiz = new QHeaderView(Qt::Horizontal); 
    6262 
    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. 
    7575 
    7676 
     
    8181        //connect(this, SIGNAL(dataAdded()), this, SLOT(saveData())); /*!< This slot save data in structure */   
    8282         
    83         setFixedWidth(baseSize().width() + 305); 
     83        setFixedWidth(baseSize().width() + 320); 
    8484        //      move(0, 0); 
    8585} 
  • trunk/yao/src/interface/src/ContextWindow.cpp

    r341 r344  
    147147        m_comboContextO_EXTOBJ->setCurrentIndex(0); 
    148148} 
     149/**********************************************************************/ 
     150void 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 
    149166 
    150167/**************************************** Implémentation de la méthode deleteO_EXTOBJRow() **********************************************************/ 
  • trunk/yao/src/interface/src/MainWindow.cpp

    r341 r344  
    319319        connect(m_ConstantCopy, SIGNAL(rowIsAdded()), this, SLOT(hatUpdate())); 
    320320        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. 
    322322 
    323323} 
     
    332332        } 
    333333 
    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. 
    335335} 
    336336/********************************************* Implementation of the method createContextWindow() *************************************************/ 
     
    344344        } 
    345345 
    346         //connect(m_ContextCopy, SIGNAL(contextWindowIsClosed(int)), this, SLOT(initializeWindow(int))); 
     346        connect(m_ContextCopy, SIGNAL(contextWindowIsClosed(int)), this, SLOT(initializeWindow(int))); 
    347347} 
    348348/********************************************* Implementation of the method createTrajectoryWindow() ************************************************/ 
     
    355355        m_trajCopy->show();  
    356356 
    357         m_trajCopy = NULL; 
     357        //m_trajCopy = NULL; 
    358358        } 
    359359 
    360         //connect(m_ContextCopy, SIGNAL(contextWindowIsClosed(int)), this, SLOT(initializeWindow(int))); 
     360        connect(m_trajCopy, SIGNAL(trajectoryWindowIsClosed(int)), this, SLOT(initializeWindow(int))); 
    361361} 
    362362/********************************************* Implementation of the method createSpaceWindow() ************************************************/ 
     
    419419                case 6: {  
    420420                                m_operaCopy = NULL;  
    421                                 break; 
    422                         } 
    423                 case 7: {  
     421                        }       break; 
     422                case 7: {                
    424423                                m_netwardCopy = NULL;  
    425424                                break; 
     
    741740 } 
    742741/********************************************* Implementation of the method setWindowTitle(const QString &title) ***********************************/ 
    743 //void MainWindow::setWindowTitle(const QString &title) { 
    744  
    745 //      QWidget::setWindowTitle(title); 
    746 //} 
     742void 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} 
    747751 /************************************** Implementation of the method createFile(string data, string extension) ************************************/ 
    748752void MainWindow::createFile(string data, string extension) { 
  • trunk/yao/src/interface/src/MainWindowController.cpp

    r341 r344  
    2727//      return instance; 
    2828//} 
    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//} 
    3035/********************************************************* isStringLiteral(string aString) **********************************************************/ 
    3136bool MainWindowController::isStringLiteral(string aString) { 
  • trunk/yao/src/interface/src/TrajectoryWindow.cpp

    r341 r344  
    491491        } 
    492492*/ 
     493/***********************************************************************/ 
     494void TrajectoryWindow::closeEvent(QCloseEvent *event) { 
     495 
     496        emit trajectoryWindowIsClosed(4);        
     497} 
  • trunk/yao/src/interface/src/include/ConstantWindow.hpp

    r341 r344  
    1010#include "HatNameWindow.hpp" 
    1111#include "MainWindowController.hpp" 
     12#include "../../ui_constantwindow.h" 
    1213 
    13 class ConstantWindow : public QWidget { 
     14class ConstantWindow : public QWidget, Ui::ConstantWindow { 
    1415 
    1516        Q_OBJECT; 
     
    4647        private: 
    4748                 
    48                 QLabel  *m_nameLabel; 
     49                /*QLabel  *m_nameLabel; 
    4950                QLabel  *m_valueLabel; 
    5051   
     
    5960                  
    6061                QGridLayout *m_layoutGrid;               
    61  
     62                */ 
    6263                yao::Table <yao::Constant> *m_localConstantTable; 
    6364                yao::Constant *m_localConstant; 
     
    6970                QStandardItemModel *modele; 
    7071                QModelIndex index; 
    71                 QTableView *m_tableView; 
     72                //QTableView *m_tableView; 
    7273                MainWindowController *localMwc; 
    7374                //ConstantWindowController *localConstantController; 
  • trunk/yao/src/interface/src/include/ContextWindow.hpp

    r341 r344  
    2828    Q_OBJECT 
    2929 
    30     public : 
     30        public : 
    3131                ContextWindow(yao::Context *aContext, yao::Table <yao::Constant> *aConstantTable, MainWindowController *mwc, QWidget *parent=0); 
    3232                QStringList getContextData(); 
     
    3434                void eraseDataFromLineEdit();  
    3535 
    36     private slots: 
     36        private slots: 
    3737 
    3838                //void enregistrerContext(); 
     
    4444                void deleteContextRow(); 
    4545                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 : 
    4756 
    4857                QFileDialog *projetContext; 
  • trunk/yao/src/interface/src/include/MainWindow.hpp

    r341 r344  
    6363                        std::string getProjectPath();  
    6464                        void directivesManager(); 
     65                        void setActiveProject(const bool aBool); 
     66                        bool isActiveProject(); 
    6567                        // void creerRepertoire(); 
    6668                        // void genererConstant(); 
     
    224226                        yao::Table <yao::Operator> theOperaTable; 
    225227                        yao::Table <yao::Modul> theModulTable; 
    226  
     228                         
     229                        bool m_activeProject; 
     230                         
    227231}; 
    228232#endif // FENETREPRINCIPALE_HPP 
  • trunk/yao/src/interface/src/include/MainWindowController.hpp

    r341 r344  
    3333                //ConstantWindow *getConstant(); 
    3434                void setConstant(); 
     35                template <class T> T Min(T x, T y){ 
     36                 
     37                return x<y ? x:y;  
    3538 
     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                //} 
    3645                void setFileListController(std::string fileController); 
    3746                std::string getProjectNameFromMWC(); 
  • trunk/yao/src/interface/src/include/TrajectoryWindow.hpp

    r341 r344  
    119119                //char type; 
    120120                //int compteur;          
    121           
     121        protected:  
     122                void closeEvent(QCloseEvent *event);  
     123        
     124        signals: 
     125                void trajectoryWindowIsClosed(int anInt); 
     126   
    122127}; 
    123128 
Note: See TracChangeset for help on using the changeset viewer.