Changeset 464 for trunk/yao


Ignore:
Timestamp:
10/22/10 19:45:23 (14 years ago)
Author:
yerima
Message:

Working on the orderwindow.

Location:
trunk/yao/src/interface/src
Files:
4 edited

Legend:

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

    r460 r464  
    6565        m_axesModel                     = new QStandardItemModel(0, 1) ; 
    6666        m_modulNameModel                = new QStandardItemModel(0, 0) ; 
    67         m_outlineModel                  = new QStandardItemModel(0, 3) ; 
    68                 m_outlineModel->setHorizontalHeaderLabels(QStringList() << "" << "" << "");  
     67        m_outlineModel                  = new QStandardItemModel(0, 4) ; 
     68                m_outlineModel->setHorizontalHeaderLabels(QStringList() << "" << "" << "" << "");  
    6969 
    7070        m_axesListView->setModel(m_axesModel); 
    7171        m_modulNameListView->setModel(m_modulNameModel); 
    7272        m_outlineTreeView1->setModel(m_outlineModel); 
     73         
     74        //connect(m_axesListView, SIGNAL(clicked(QModelIndex)), this, SLOT(deleteAxesRow(QModelIndex))); 
     75        //connect(m_modulNameListView, SIGNAL(clicked(QModelIndex)), this, SLOT(deleteModulRow(QModelIndex))); 
     76         
     77        connect(m_modinspaceDeleteButton, SIGNAL(clicked()), this, SLOT(deleteAxesRow())); 
     78        connect(m_modinspaceDeleteButton, SIGNAL(clicked()), this, SLOT(deleteModulRow())); 
     79 
     80        connect(m_rightAxesButton, SIGNAL(clicked()), this, SLOT(addTheAxesRow())); 
     81        connect(m_rightModulNameButton, SIGNAL(clicked()), this, SLOT(addTheModulRow())); 
     82        //connect(m_modinspaceDeleteButton, SIGNAL(clicked()), this, SLOT(deleteTheRow())); 
     83 
     84} 
     85/******************************** implementation of method ***********************************/ 
     86/*void ModinspaceWindow::callClicked(const QModelIndex &index) { 
     87         
     88        QStandardItem *item = m_axesModel->itemFromIndex(index);         
     89         
     90        //cout << "Voici le text: " << item->text().toStdString() << endl;  
     91         
     92}*/ 
     93/********************************* Implementation of the selectedFunction(QModelIndex index) method  ***********************************/ 
     94void ModinspaceWindow::addTheAxesRow() { 
     95         
     96        if (m_spaceOrOperaNameComboBox->currentText().isEmpty()) { 
     97         
     98                QMessageBox::critical(this, "Avis", "Précisez d'abord l'espace ou l'opérateur avant de faire le choix des axes."); 
     99                return; 
     100        } 
     101 
     102        QString theAxe = m_axesComboBox->currentText(); 
     103 
     104        if (theAxe.isEmpty()) return; 
     105         
     106        m_axesModel->setItem(m_axesModel->rowCount(), 0, new QStandardItem(theAxe));     
     107        m_axesComboBox->setCurrentIndex(0); 
     108} 
     109 
     110/********************************* Implementation of the addInstructionRow()  method *************************************************/ 
     111void ModinspaceWindow::addTheModulRow() { 
     112 
     113        QString theModul = m_modulNameComboBox->currentText(); 
     114 
     115        if (theModul.isEmpty()) return; 
     116         
     117        m_modulNameModel->setItem(m_modulNameModel->rowCount(), 0, new QStandardItem(theModul));         
     118        m_modulNameComboBox->setCurrentIndex(0); 
     119 
     120} 
     121/******************************* Implementation of the deleteModulRow(const QModelIndex &index) method ****************************************/   
     122void ModinspaceWindow::deleteAxesRow() { 
     123         
     124                 
     125        //QStandardItem *item = m_axesModel->itemFromIndex(index);       
     126 
     127        QItemSelectionModel *selectionFromAxes = m_axesListView->selectionModel(); 
     128        //QItemSelectionModel *selectionFromModul = m_modulNameListView->selectionModel(); 
     129 
     130        indexForAxes = selectionFromAxes->currentIndex(); 
     131        //indexForModul = selectionFromModul->currentIndex(); 
     132 
     133        QVariant axesElement = m_axesModel->data(indexForAxes, Qt::DisplayRole); 
     134        //QVariant modulElement = m_modulNameModel->data(indexForModul, Qt::DisplayRole); 
     135         
     136        if(axesElement.toString().isEmpty()) 
     137                return; 
     138                 
     139        //if(!axesElement.toString().isEmpty()) 
     140                m_axesModel->removeRows(m_axesListView->currentIndex().row(), 1);// Le 2Úme parametre indique le nombre de ligne à supprimer 
     141        //else 
     142        //      if(!modulElement.toString().isEmpty())  
     143        //              m_modulNameModel->removeRows(m_modulNameListView->currentIndex().row(), 1);// Le 2Úme parametre indique le nombre de ligne à supprimer 
     144 
    73145 
    74146} 
    75147 
    76 /********************************* Implementation of the selectedFunction(QModelIndex index) method  ***********************************/ 
    77 /*void ModinspaceWindow::selectedFunction(QModelIndex index) { 
     148/******************************* Implementation of the deleteModulRow(const QModelIndex &index) method ****************************************/   
     149void ModinspaceWindow::deleteModulRow() { 
     150         
     151         
     152        //QStandardItem *item = m_modulNameModel->itemFromIndex(index);  
    78153 
    79         QItemSelectionModel *selection = m_proposedParametersListView->selectionModel(); 
    80         //index = selection->currentIndex(); 
    81         QVariant element = m_instructionLeftModel->data(index, Qt::DisplayRole); 
    82         QString chaine = element.toString();//.toStdString(); 
    83         m_fonctionNameLineEdit->setText(chaine); 
    84         //QMessageBox::about(this, "Avis", chaine); 
    85         //int r = index.row(); 
     154        //QItemSelectionModel *selectionFromAxes = m_axesListView->selectionModel(); 
     155        QItemSelectionModel *selectionFromModul = m_modulNameListView->selectionModel(); 
     156 
     157        //indexForAxes = selectionFromAxes->currentIndex(); 
     158        indexForModul = selectionFromModul->currentIndex(); 
     159 
     160        //QVariant axesElement = m_axesModel->data(indexForAxes, Qt::DisplayRole); 
     161        QVariant modulElement = m_modulNameModel->data(indexForModul, Qt::DisplayRole); 
    86162         
    87 }*/ 
     163        if(modulElement.toString().isEmpty()) 
     164                return; 
     165                 
     166        //if(!axesElement.toString().isEmpty()) 
     167        //      m_axesModel->removeRows(m_axesListView->currentIndex().row(), 1);// Le 2Úme parametre indique le nombre de ligne à supprimer 
     168        //else 
     169        //      if(!modulElement.toString().isEmpty())  
     170                        m_modulNameModel->removeRows(m_modulNameListView->currentIndex().row(), 1);// Le 2Úme parametre indique le nombre de ligne à supprimer 
    88171 
    89 /********************************* Implementation of the addInstructionRow()  method *************************************************/ 
    90 /*void ModinspaceWindow::addInstructionRow() { 
    91172 
    92         QString nom  = m_fonctionNameLineEdit->text(); 
    93         QString val  = m_fonctionParameterLineEdit->text(); 
    94          
    95         if (nom.isEmpty()){  
    96    
    97                             QMessageBox::critical(this, "Avertissement", "Le champ \"<I>Nom de la fonction<I>\" est obligatoire! Veuillez sélectionner une fonction parmi celles qui sont proposées dans la partie gauche de la fenêtre."); 
    98                             return; // Arrêt de la méthode 
    99                     } 
    100    
    101           else { 
    102                   //if (!(m_ligneNom->text().isEmpty()) || (m_ligneValeur->text().isEmpty())) { 
    103                     //      m_delButton->setEnabled(true); 
    104                     //      Constant localConstant (Nom.toStdString(), Val.toStdString()); 
    105                     //              m_localConstantTable->push_back(localConstant); 
    106                         m_instructionRightModel->setItem(m_instructionRightModel->rowCount(), 0, new QStandardItem(nom)); 
    107                         m_instructionRightModel->setItem(m_instructionRightModel->rowCount()-1, 1, new QStandardItem(val)); 
    108                                  
    109                         m_fonctionNameLineEdit->setText(""); 
    110                         m_fonctionParameterLineEdit->setText(""); 
    111                   } 
    112  
    113 }*/ 
    114  
     173} 
    115174/***********************************************************************************************************************/ 
    116175/***************************************************** End of file *****************************************************/ 
  • trunk/yao/src/interface/src/include/ModinspaceWindow.hpp

    r460 r464  
    2828                //void addInstructionRow();      
    2929                //void selectedFunction(QModelIndex index); 
     30                void addTheAxesRow();  
     31                void addTheModulRow();  
     32                void deleteAxesRow();  
     33                void deleteModulRow();  
    3034                 
    3135        signals: 
     
    4347                QStandardItemModel *m_modulNameModel; 
    4448                QStandardItemModel *m_outlineModel; 
     49                 
     50                QModelIndex indexForAxes;  
     51                QModelIndex indexForModul;  
    4552                /*QStandardItemModel *m_instructionLeftModel; 
    4653                QStandardItemModel *m_instructionRightModel; 
  • trunk/yao/src/interface/src/ui_/modinspace.ui

    r460 r464  
    88    <y>0</y> 
    99    <width>689</width> 
    10     <height>417</height> 
     10    <height>440</height> 
    1111   </rect> 
    1212  </property> 
     
    2020     <y>50</y> 
    2121     <width>391</width> 
    22      <height>361</height> 
     22     <height>381</height> 
    2323    </rect> 
    2424   </property> 
     
    105105     <rect> 
    106106      <x>20</x> 
    107       <y>330</y> 
     107      <y>350</y> 
    108108      <width>111</width> 
    109109      <height>22</height> 
     
    145145    </layout> 
    146146   </widget> 
    147    <widget class="QWidget" name=""> 
     147   <widget class="QWidget" name="layoutWidget"> 
    148148    <property name="geometry"> 
    149149     <rect> 
    150150      <x>300</x> 
    151151      <y>160</y> 
    152       <width>81</width> 
     152      <width>87</width> 
    153153      <height>62</height> 
    154154     </rect> 
     
    170170     </item> 
    171171    </layout> 
     172   </widget> 
     173   <widget class="QCheckBox" name="m_blocEndCheckBox"> 
     174    <property name="geometry"> 
     175     <rect> 
     176      <x>20</x> 
     177      <y>320</y> 
     178      <width>111</width> 
     179      <height>22</height> 
     180     </rect> 
     181    </property> 
     182    <property name="text"> 
     183     <string>Fin de bloc</string> 
     184    </property> 
    172185   </widget> 
    173186  </widget> 
     
    178191     <y>10</y> 
    179192     <width>271</width> 
    180      <height>401</height> 
     193     <height>421</height> 
    181194    </rect> 
    182195   </property> 
     
    193206      <y>40</y> 
    194207      <width>251</width> 
    195       <height>351</height> 
     208      <height>371</height> 
    196209     </rect> 
    197210    </property> 
  • trunk/yao/src/interface/src/ui_/orderwindow.ui

    r460 r464  
    88    <y>0</y> 
    99    <width>709</width> 
    10     <height>523</height> 
     10    <height>543</height> 
    1111   </rect> 
    1212  </property> 
     
    2020     <y>60</y> 
    2121     <width>691</width> 
    22      <height>421</height> 
     22     <height>441</height> 
    2323    </rect> 
    2424   </property> 
     
    5656    <rect> 
    5757     <x>620</x> 
    58      <y>490</y> 
     58     <y>510</y> 
    5959     <width>81</width> 
    6060     <height>27</height> 
     
    6969    <rect> 
    7070     <x>10</x> 
    71      <y>490</y> 
     71     <y>510</y> 
    7272     <width>51</width> 
    7373     <height>21</height> 
Note: See TracChangeset for help on using the changeset viewer.