1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include "HYDROGUI_BasicZoneDlg.h"
27 HYDROGUI_BasicZoneDlg::HYDROGUI_BasicZoneDlg( HYDROGUI_Module* theModule, const QString& theTitle,
28 const QString& theLabel1, const QString& theLabel2,
29 const QString& theLabel3, const QString& theLabel4 )
30 : HYDROGUI_InputPanel( theModule, theTitle )
33 myObjectNameGroup = new QGroupBox( theLabel1, mainFrame() );
35 myObjectName = new QLineEdit( myObjectNameGroup );
37 QBoxLayout* aNameLayout = new QHBoxLayout( myObjectNameGroup );
38 aNameLayout->setMargin( 5 );
39 aNameLayout->setSpacing( 5 );
40 aNameLayout->addWidget( new QLabel( theLabel2, myObjectNameGroup ) );
41 aNameLayout->addWidget( myObjectName );
43 // Main parameters: group-box and frame
44 myParamGroup = new QGroupBox( theLabel3, mainFrame() );
46 myPolylineFrame = new QFrame( myParamGroup );
48 // Additional parameter defined with help of combo-box control
49 myAdditionalParamsGroup = new QGroupBox( theLabel4, mainFrame() );
51 myAdditionalParams = new QComboBox( myPolylineFrame );
52 myAdditionalParams->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
54 QBoxLayout* aBathLayout = new QHBoxLayout( myAdditionalParamsGroup );
55 aBathLayout->setMargin( 5 );
56 aBathLayout->setSpacing( 5 );
57 aBathLayout->addWidget( myAdditionalParams );
60 addWidget( myObjectNameGroup );
61 addWidget( myParamGroup );
62 addWidget( myAdditionalParamsGroup );
67 HYDROGUI_BasicZoneDlg::~HYDROGUI_BasicZoneDlg()
71 void HYDROGUI_BasicZoneDlg::reset()
73 myObjectName->clear();
74 myAdditionalParams->clear();
77 void HYDROGUI_BasicZoneDlg::setObjectName( const QString& theName )
79 myObjectName->setText( theName );
82 QString HYDROGUI_BasicZoneDlg::getObjectName() const
84 return myObjectName->text();
87 void HYDROGUI_BasicZoneDlg::setAdditionalParams( const QStringList& thePrams )
89 bool isBlocked = blockSignals( true );
91 myAdditionalParams->clear();
92 myAdditionalParams->addItems( thePrams );
94 blockSignals( isBlocked );
97 void HYDROGUI_BasicZoneDlg::setSelectedAdditionalParamName( const QString& theParam )
99 int aNewIdx = myAdditionalParams->findText( theParam );
100 myAdditionalParams->setCurrentIndex( aNewIdx );
103 QString HYDROGUI_BasicZoneDlg::getSelectedAdditionalParamName() const
105 return myAdditionalParams->currentText();