Changeset 358 for trunk/yao


Ignore:
Timestamp:
06/23/10 13:24:03 (14 years ago)
Author:
yerima
Message:

Control on Space and Opera Window in the tool bar are ok. It's also ok in the trajwindow with the m_trajDelButton. Visusal Yao.

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

Legend:

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

    r356 r358  
    99        setupUi(this); 
    1010 
    11         QStringList horizontalHeaders; 
    12                 horizontalHeaders  << "Nom " << "Argument"; /*!< displays Nom Fonction and Argument in the QTableWidget */ 
    13          
    14 //              tableWidgetfct->setEditTriggers(QAbstractItemView::NoEditTriggers); 
    15 //              tableWidgetfct->setShowGrid(false); 
    16 //              tableWidgetfct->setSelectionBehavior(QAbstractItemView::SelectRows); 
    17 //                      tableWidgetfct->setHorizontalHeaderLabels(horizontalHeaders); /*!< displays tableWidgetfct */ 
     11        m_insertFCTModel        = new QStandardItemModel(0, 2);  
    1812 
     13        m_insertFCTModel->setHorizontalHeaderLabels(QStringList() << "Nom Fonction" << "Argument"); /*!< displays tableWidgetfct */ 
     14 
     15        m_insertFCTTableView->setModel(m_insertFCTModel); 
     16 
     17        m_insertFCTTableView->setEditTriggers(QAbstractItemView::NoEditTriggers); 
     18        m_insertFCTTableView->setShowGrid(false); 
     19        m_insertFCTTableView->setSelectionBehavior(QAbstractItemView::SelectRows); 
     20        m_insertFCTTableView->resizeColumnsToContents(); 
    1921                         
    2022       
  • trunk/yao/src/interface/src/MainWindow.cpp

    r357 r358  
    337337 
    338338        connect(m_trajectoryWindow, SIGNAL(trajectoryWindowIsClosed(int)), this, SLOT(initializeWindow(int))); 
     339        connect(m_trajectoryWindow, SIGNAL(trajRowIsAdded(bool)), m_spaceButton, SLOT(setEnabled(bool))); 
     340        connect(m_trajectoryWindow, SIGNAL(trajRowIsAdded(bool)), m_operaButton, SLOT(setEnabled(bool))); 
    339341} 
    340342/********************************************* Implementation of the method createSpaceWindow() ************************************************/ 
  • trunk/yao/src/interface/src/TrajectoryWindow.cpp

    r357 r358  
    1919        localTrajectoryTable            = aTrajectoryTable; 
    2020        localConstantTable              = aConstantTable; 
     21 
     22        if(isTrajectoryTableEmpty()) m_trajDelButton->setDisabled(true); 
    2123 
    2224        m_comboNbuptimeTraj->setEditable(true); 
     
    7274                 vueTraj->resizeColumnsToContents(); /*!< To adjust the Horizontal Header Labels to appear correctly in a QTableView.*/  
    7375 
    74         connect(m_quitTraj, SIGNAL(clicked()), this, SLOT(close()));   /*!< slot for the close this windows*/ 
    75         connect(m_delButton, SIGNAL(clicked()), this, SLOT(deleteTrajRow()));   /*!< slot  for the delete the object selected in the view*/ 
    76         connect(m_addButton, SIGNAL(clicked()), this, SLOT(addTrajRow()));  /*!< This slot add the object in the view */  
     76        connect(m_trajQuitButton, SIGNAL(clicked()), this, SLOT(close()));   /*!< slot for the close this windows*/ 
     77        connect(m_trajDelButton, SIGNAL(clicked()), this, SLOT(deleteTrajRow()));   /*!< slot  for the delete the object selected in the view*/ 
     78        connect(m_trajAddButton, SIGNAL(clicked()), this, SLOT(addTrajRow()));  /*!< This slot add the object in the view */  
    7779        connect(m_helpButton, SIGNAL(clicked()), this, SLOT(callTrajHelp()));   /*!< This slot opens */  
    7880                 
     
    8486 
    8587        //The following attributs are string. 
    86         QString trajName = m_lignetrajName->text(); 
     88        QString trajName = m_trajNameLine->text(); 
    8789        QString upTime = m_comboNbuptimeTraj->currentText(); // A convertir en entier avant l'insertion. 
    8890                //upTime = QString(localConstantTable->find(upTime.toStdString())->getText().c_str()); 
     
    268270         
    269271        for(int i = 0; i<trajName.size(); i++) 
    270         //if (m_lignetrajNameTraj->text().isEmpty()) 
     272        //if (m_trajNameLineTraj->text().isEmpty()) 
    271273        if(!((trajName.at(i) >= QChar('a')&& trajName.at(i) <= QChar('z')) || (trajName.at(i) >= QChar('A')&& trajName.at(i) <= QChar('Z'))  
    272274                        || (trajName.at(i) >= QChar('0')&& trajName.at(i) <= QChar('9')) || (trajName.at(i) == QChar('_')))) { 
     
    329331        }*/ 
    330332 
    331            if (m_lignetrajName->text().isEmpty()) { 
     333           if (m_trajNameLine->text().isEmpty()) { 
    332334 
    333335                QMessageBox::critical(this, "Erreur", "La syntaxe du nom de la Trajectoire n'est pas correcte! Le champ ne doit pas être vide."); 
     
    358360                                m_trajModel->setItem(row, 5, new QStandardItem(stepTime));  
    359361 
    360         emit trajRowIsAdded(); 
     362        if(!isTrajectoryTableEmpty()) emit trajRowIsAdded(true); 
    361363                        } 
    362364 
     365        if(!isTrajectoryTableEmpty()) m_trajDelButton->setEnabled(true); 
    363366        initialiserChamps(); 
    364367 
     
    386389  
    387390                 //emit rowIsDeleted(element.toString()); // signal emis lorsqu'une ligne retirée du tableau.  
     391         
     392        if(isTrajectoryTableEmpty()) emit trajRowIsAdded(false); 
     393        if(isTrajectoryTableEmpty()) m_trajDelButton->setEnabled(false); 
    388394         } 
    389395 
     
    394400void TrajectoryWindow::initialiserChamps() { 
    395401                  
    396         m_lignetrajName->setText(""); 
     402        m_trajNameLine->setText(""); 
    397403        m_comboNbuptimeTraj->setCurrentIndex(0); 
    398404        m_comboOfftimeTraj->setEditText("0"); 
     
    400406 
    401407} 
    402  
     408/***********************************************************************/ 
     409bool TrajectoryWindow::isTrajectoryTableEmpty() { 
     410         
     411        if (localTrajectoryTable->empty())  
     412                return true;  
     413        else 
     414                 return false;               
     415 
     416} 
    403417/************************************* Implementation of the method toInt(const string& s) *****************************************************/ 
    404418const int  TrajectoryWindow::toInt(const string& s) { 
  • trunk/yao/src/interface/src/include/TrajectoryWindow.hpp

    r357 r358  
    4444                const int toInt(const std::string& s); 
    4545                const double toDouble(const std::string& s); 
     46                bool isTrajectoryTableEmpty(); 
    4647 
    4748        private slots:    /*!< Functions called after a click. */ 
     
    5051                void deleteTrajRow();   /*!< This function is called to delete row from the Yao model. */ 
    5152                void callTrajHelp();  /*!< This function is called to an help window. */ 
    52          
     53 
    5354        signals: 
    54                 void trajRowIsAdded(); 
     55                void trajectoryWindowIsClosed(int anInt); 
     56                void trajRowIsAdded(bool aBool); 
     57   
     58 
    5559        private : 
    5660                 
     
    6771                void closeEvent(QCloseEvent *event);  
    6872        
    69         signals: 
    70                 void trajectoryWindowIsClosed(int anInt); 
    71    
    72 }; 
     73        }; 
    7374 
    7475#endif // TRAJWINDOW_HPP 
  • trunk/yao/src/interface/src/ui_/insertfctwindow.ui

    r342 r358  
    77    <x>0</x> 
    88    <y>0</y> 
    9     <width>342</width> 
    10     <height>281</height> 
     9    <width>341</width> 
     10    <height>285</height> 
    1111   </rect> 
    1212  </property> 
     
    1414   <string>Directive InsertFct.</string> 
    1515  </property> 
    16   <widget class="QTableView" name="tableView"> 
    17    <property name="geometry"> 
    18     <rect> 
    19      <x>15</x> 
    20      <y>90</y> 
    21      <width>231</width> 
    22      <height>181</height> 
    23     </rect> 
    24    </property> 
    25   </widget> 
    26   <widget class="QPushButton" name="pushButton_4"> 
    27    <property name="geometry"> 
    28     <rect> 
    29      <x>250</x> 
    30      <y>240</y> 
    31      <width>41</width> 
    32      <height>27</height> 
    33     </rect> 
    34    </property> 
    35    <property name="text"> 
    36     <string>Aide</string> 
    37    </property> 
    38   </widget> 
    39   <widget class="QWidget" name=""> 
     16  <widget class="QFrame" name="frame"> 
    4017   <property name="geometry"> 
    4118    <rect> 
    4219     <x>10</x> 
    4320     <y>10</y> 
    44      <width>241</width> 
    45      <height>71</height> 
     21     <width>321</width> 
     22     <height>91</height> 
    4623    </rect> 
    4724   </property> 
    48    <layout class="QVBoxLayout" name="verticalLayout"> 
    49     <item> 
    50      <layout class="QHBoxLayout" name="horizontalLayout_2"> 
    51       <item> 
    52        <widget class="QLabel" name="label"> 
    53         <property name="text"> 
    54          <string>Nom fonction</string> 
    55         </property> 
    56        </widget> 
    57       </item> 
    58       <item> 
    59        <widget class="QLineEdit" name="lineEdit"/> 
    60       </item> 
    61       <item> 
    62        <spacer name="horizontalSpacer_2"> 
    63         <property name="orientation"> 
    64          <enum>Qt::Horizontal</enum> 
    65         </property> 
    66         <property name="sizeHint" stdset="0"> 
    67          <size> 
    68           <width>40</width> 
    69           <height>20</height> 
    70          </size> 
    71         </property> 
    72        </spacer> 
    73       </item> 
    74      </layout> 
    75     </item> 
    76     <item> 
    77      <layout class="QHBoxLayout" name="horizontalLayout"> 
    78       <item> 
    79        <widget class="QCheckBox" name="checkBox"> 
    80         <property name="layoutDirection"> 
    81          <enum>Qt::RightToLeft</enum> 
    82         </property> 
    83         <property name="text"> 
    84          <string>?Avec argument</string> 
    85         </property> 
    86        </widget> 
    87       </item> 
    88       <item> 
    89        <spacer name="horizontalSpacer"> 
    90         <property name="orientation"> 
    91          <enum>Qt::Horizontal</enum> 
    92         </property> 
    93         <property name="sizeHint" stdset="0"> 
    94          <size> 
    95           <width>88</width> 
    96           <height>20</height> 
    97          </size> 
    98         </property> 
    99        </spacer> 
    100       </item> 
    101      </layout> 
    102     </item> 
    103    </layout> 
     25   <property name="frameShape"> 
     26    <enum>QFrame::StyledPanel</enum> 
     27   </property> 
     28   <property name="frameShadow"> 
     29    <enum>QFrame::Raised</enum> 
     30   </property> 
     31   <widget class="QWidget" name="layoutWidget"> 
     32    <property name="geometry"> 
     33     <rect> 
     34      <x>40</x> 
     35      <y>10</y> 
     36      <width>241</width> 
     37      <height>71</height> 
     38     </rect> 
     39    </property> 
     40    <layout class="QVBoxLayout" name="verticalLayout"> 
     41     <item> 
     42      <layout class="QHBoxLayout" name="horizontalLayout_2"> 
     43       <item> 
     44        <widget class="QLabel" name="label"> 
     45         <property name="text"> 
     46          <string>Nom fonction</string> 
     47         </property> 
     48        </widget> 
     49       </item> 
     50       <item> 
     51        <widget class="QLineEdit" name="m_insertFCTNameLine"/> 
     52       </item> 
     53       <item> 
     54        <spacer name="horizontalSpacer_2"> 
     55         <property name="orientation"> 
     56          <enum>Qt::Horizontal</enum> 
     57         </property> 
     58         <property name="sizeHint" stdset="0"> 
     59          <size> 
     60           <width>40</width> 
     61           <height>20</height> 
     62          </size> 
     63         </property> 
     64        </spacer> 
     65       </item> 
     66      </layout> 
     67     </item> 
     68     <item> 
     69      <layout class="QHBoxLayout" name="horizontalLayout"> 
     70       <item> 
     71        <widget class="QCheckBox" name="m_insertFCTAgumentCheckBox"> 
     72         <property name="layoutDirection"> 
     73          <enum>Qt::RightToLeft</enum> 
     74         </property> 
     75         <property name="text"> 
     76          <string>?Avec argument</string> 
     77         </property> 
     78        </widget> 
     79       </item> 
     80       <item> 
     81        <spacer name="horizontalSpacer"> 
     82         <property name="orientation"> 
     83          <enum>Qt::Horizontal</enum> 
     84         </property> 
     85         <property name="sizeHint" stdset="0"> 
     86          <size> 
     87           <width>88</width> 
     88           <height>20</height> 
     89          </size> 
     90         </property> 
     91        </spacer> 
     92       </item> 
     93      </layout> 
     94     </item> 
     95    </layout> 
     96   </widget> 
    10497  </widget> 
    105   <widget class="QWidget" name=""> 
     98  <widget class="QFrame" name="frame_2"> 
    10699   <property name="geometry"> 
    107100    <rect> 
    108      <x>250</x> 
    109      <y>120</y> 
    110      <width>81</width> 
    111      <height>95</height> 
     101     <x>10</x> 
     102     <y>110</y> 
     103     <width>321</width> 
     104     <height>171</height> 
    112105    </rect> 
    113106   </property> 
    114    <layout class="QVBoxLayout" name="verticalLayout_2"> 
    115     <item> 
    116      <widget class="QPushButton" name="pushButton"> 
    117       <property name="text"> 
    118        <string>Ajouter</string> 
    119       </property> 
    120      </widget> 
    121     </item> 
    122     <item> 
    123      <widget class="QPushButton" name="pushButton_2"> 
    124       <property name="text"> 
    125        <string>Supprimer</string> 
    126       </property> 
    127      </widget> 
    128     </item> 
    129     <item> 
    130      <widget class="QPushButton" name="pushButton_3"> 
    131       <property name="text"> 
    132        <string>Quitter</string> 
    133       </property> 
    134      </widget> 
    135     </item> 
    136    </layout> 
     107   <property name="frameShape"> 
     108    <enum>QFrame::StyledPanel</enum> 
     109   </property> 
     110   <property name="frameShadow"> 
     111    <enum>QFrame::Raised</enum> 
     112   </property> 
     113   <widget class="QTableView" name="m_insertFCTTableView"> 
     114    <property name="geometry"> 
     115     <rect> 
     116      <x>10</x> 
     117      <y>10</y> 
     118      <width>211</width> 
     119      <height>151</height> 
     120     </rect> 
     121    </property> 
     122   </widget> 
     123   <widget class="QWidget" name="layoutWidget"> 
     124    <property name="geometry"> 
     125     <rect> 
     126      <x>230</x> 
     127      <y>20</y> 
     128      <width>81</width> 
     129      <height>95</height> 
     130     </rect> 
     131    </property> 
     132    <layout class="QVBoxLayout" name="verticalLayout_2"> 
     133     <item> 
     134      <widget class="QPushButton" name="m_insertFCTAddButton"> 
     135       <property name="text"> 
     136        <string>Ajouter</string> 
     137       </property> 
     138      </widget> 
     139     </item> 
     140     <item> 
     141      <widget class="QPushButton" name="m_insertFCTDelButton"> 
     142       <property name="text"> 
     143        <string>Supprimer</string> 
     144       </property> 
     145      </widget> 
     146     </item> 
     147     <item> 
     148      <widget class="QPushButton" name="m_insertFCTQuitButton"> 
     149       <property name="text"> 
     150        <string>Quitter</string> 
     151       </property> 
     152      </widget> 
     153     </item> 
     154    </layout> 
     155   </widget> 
     156   <widget class="QPushButton" name="m_insertFCTHelpButton"> 
     157    <property name="geometry"> 
     158     <rect> 
     159      <x>230</x> 
     160      <y>130</y> 
     161      <width>41</width> 
     162      <height>27</height> 
     163     </rect> 
     164    </property> 
     165    <property name="text"> 
     166     <string>Aide</string> 
     167    </property> 
     168   </widget> 
    137169  </widget> 
    138170 </widget> 
  • trunk/yao/src/interface/src/ui_/trajectorywindow.ui

    r347 r358  
    8888      <layout class="QVBoxLayout" name="verticalLayout_2"> 
    8989       <item> 
    90         <widget class="QLineEdit" name="m_lignetrajName"/> 
     90        <widget class="QLineEdit" name="m_trajNameLine"/> 
    9191       </item> 
    9292       <item> 
     
    174174      <x>410</x> 
    175175      <y>40</y> 
    176       <width>81</width> 
     176      <width>87</width> 
    177177      <height>95</height> 
    178178     </rect> 
     
    180180    <layout class="QVBoxLayout" name="verticalLayout"> 
    181181     <item> 
    182       <widget class="QPushButton" name="m_addButton"> 
     182      <widget class="QPushButton" name="m_trajAddButton"> 
    183183       <property name="text"> 
    184184        <string>Ajouter</string> 
     
    187187     </item> 
    188188     <item> 
    189       <widget class="QPushButton" name="m_delButton"> 
     189      <widget class="QPushButton" name="m_trajDelButton"> 
    190190       <property name="text"> 
    191191        <string>Supprimer</string> 
     
    194194     </item> 
    195195     <item> 
    196       <widget class="QPushButton" name="m_quitTraj"> 
     196      <widget class="QPushButton" name="m_trajQuitButton"> 
    197197       <property name="text"> 
    198198        <string>Quitter</string> 
     
    205205 </widget> 
    206206 <tabstops> 
    207   <tabstop>m_lignetrajName</tabstop> 
     207  <tabstop>m_trajNameLine</tabstop> 
    208208  <tabstop>m_ligneTypeTraj</tabstop> 
    209209  <tabstop>m_comboNbuptimeTraj</tabstop> 
     
    211211  <tabstop>m_comboDtimeTraj</tabstop> 
    212212  <tabstop>m_comboSteptimeTraj</tabstop> 
    213   <tabstop>m_addButton</tabstop> 
    214   <tabstop>m_delButton</tabstop> 
    215   <tabstop>m_quitTraj</tabstop> 
     213  <tabstop>m_trajAddButton</tabstop> 
     214  <tabstop>m_trajDelButton</tabstop> 
     215  <tabstop>m_trajQuitButton</tabstop> 
    216216  <tabstop>vueTraj</tabstop> 
    217217  <tabstop>m_helpButton</tabstop> 
Note: See TracChangeset for help on using the changeset viewer.