Changeset 185


Ignore:
Timestamp:
02/01/10 00:38:56 (14 years ago)
Author:
yerima
Message:

Deleting and saving buttons are ready in option window. Visual yao.

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

Legend:

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

    r179 r185  
    4646                QStringList horizontalHeaders; 
    4747                        horizontalHeaders << "Constante(s)"  << "Valeur(s)" << " ";  /*!< added Nom Netward Entrees and sorties in table */ 
    48         vueDefval                                       = new QTableWidget(0, 2);  /*!< QTableWidget's in whitch the objects are listed for thue view. */ 
    49                 vueDefval->setEditTriggers(QAbstractItemView::NoEditTriggers); /*!< this ligne give no edit mode*/ 
    50                 vueDefval->setShowGrid(false);  /*!< this ligne cover the grille in table */ 
    51                 vueDefval->setSelectionBehavior(QAbstractItemView::SelectRows);  /*!< this ligne give a section of the ligne */ 
    52                 vueDefval->setHorizontalHeaderLabels(horizontalHeaders); /*!< displays the QTableWidget */ 
     48                vueDefval                                       = new QTableWidget(0, 2);  /*!< QTableWidget's in whitch the objects are listed for thue view. */ 
     49                        vueDefval->setEditTriggers(QAbstractItemView::NoEditTriggers); /*!< this ligne give no edit mode*/ 
     50                        vueDefval->setShowGrid(false);  /*!< this ligne cover the grille in table */ 
     51                        vueDefval->setSelectionBehavior(QAbstractItemView::SelectRows);  /*!< this ligne give a section of the ligne */ 
     52                        vueDefval->setHorizontalHeaderLabels(horizontalHeaders); /*!< displays the QTableWidget */ 
    5353        //--------- Les gestionnaires de positionnement. 
    54         m_layoutH1Defval                = new QHBoxLayout; 
    55                 m_layoutH1Defval->addWidget(m_saveDefvalButton); 
    56                 m_layoutH1Defval->addWidget(m_quitDefval);//m_ajoutDefval); 
    57         m_layoutGDefval                         = new QGridLayout;  /*!< set QGridLayout m-layoutGDefval */ 
     54                m_layoutH1Defval                = new QHBoxLayout; 
     55                        m_layoutH1Defval->addWidget(m_saveDefvalButton); 
     56                        m_layoutH1Defval->addWidget(m_quitDefval);//m_ajoutDefval); 
     57                m_layoutGDefval                         = new QGridLayout;  /*!< set QGridLayout m-layoutGDefval */ 
    5858                m_layoutGDefval->addWidget(m_labelNomDefval, 0, 2); 
    5959                m_layoutGDefval->addWidget(m_ligneNomDefval, 0, 3, 1, 2); 
  • trunk/yao/src/interface/src/Include/OptionWindow.hpp

    r184 r185  
    3939                                void addOptionRow(); 
    4040                                void deleteOptionRow(); 
    41                 int compteur; 
    42  
     41                 
    4342    private : 
    4443                                QLabel *m_labelName;             
  • trunk/yao/src/interface/src/OptionWindow.cpp

    r178 r185  
    2121   this->setWindowTitle("Directive Option."); 
    2222 
     23                compteur                                = 0; 
     24 
    2325        m_optionLayout          = new QFormLayout; 
    2426        m_optionLayoutH1        = new QHBoxLayout; 
    25         m_optionLayoutH2        = new QHBoxLayout; 
    26         m_optionLayoutV1        = new QVBoxLayout; 
    27         m_layoutGOption         = new QGridLayout;       
    28          
    29         m_labelName             = new QLabel("Nom de l'option: "); 
    30         m_comboNomOption        = new QComboBox; 
    31  
    32  
    33         m_optionAddButton       = new QPushButton("Ajouter", this); 
    34         m_optionDeleteButton    = new QPushButton("Supprimer", this); 
     27                m_optionLayoutH2        = new QHBoxLayout; 
     28        m_optionLayoutV1                = new QVBoxLayout; 
     29                m_layoutGOption                 = new QGridLayout;       
     30         
     31                m_labelName                             = new QLabel("Nom de l'option: "); 
     32                m_comboNomOption        = new QComboBox; 
     33 
     34 
     35                m_optionAddButton               = new QPushButton("Ajouter", this); 
     36                m_optionDeleteButton    = new QPushButton("Supprimer", this); 
    3537                m_optionDeleteButton->setDisabled(true); 
    36         m_enregOption           = new QPushButton("Enregistrer" , this); 
     38                m_enregOption           = new QPushButton("Enregistrer" , this); 
    3739                m_enregOption->setDisabled(true); 
    38         m_optionHelpButton      = new QPushButton("De l'aide ?" , this); 
     40                m_optionHelpButton              = new QPushButton("De l'aide ?" , this); 
    3941        m_quitOption            = new QPushButton("Quitter", this); 
    4042 
     
    113115void OptionWindow::addOptionRow() { 
    114116 
     117        compteur ++; 
     118 
    115119        filesList.append(m_comboNomOption->currentText()); 
    116120        filesListModele->setStringList(filesList); 
     121        testContenu(compteur); 
    117122         
    118123} 
     
    128133        filesListModele->setStringList(filesList); //On indique au modÚle la liste des éléments à afficher. 
    129134 
     135        compteur --; 
     136        testContenu(compteur); 
     137         
    130138         
    131139} 
     
    178186        return filesList; 
    179187} 
     188 
     189/****************************************************************************************************************************/ 
     190 
     191bool OptionWindow::testContenu(int anInt) { 
     192 
     193        if (anInt != 0) { 
     194                m_optionDeleteButton->setEnabled(true); 
     195                m_enregOption->setEnabled(true); 
     196        } 
     197        else 
     198        { 
     199                m_optionDeleteButton->setDisabled(true); 
     200                m_enregOption->setDisabled(true); 
     201        } 
     202} 
Note: See TracChangeset for help on using the changeset viewer.