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_ExportLandCoverMapDlg.h"
21 #include <SUIT_MessageBox.h>
24 #include <QVBoxLayout>
27 #include <QDoubleSpinBox>
29 HYDROGUI_ExportLandCoverMapDlg::HYDROGUI_ExportLandCoverMapDlg( QWidget* theParent, bool IsLinear, const QStringList& theAttrItems )
30 : QtxDialog( theParent, false, true, QtxDialog::OKCancel )
32 setWindowTitle( tr( "EXPORT_LANDCOVERMAP" ) );
33 setButtonPosition( Left, OK );
34 setButtonPosition( Right, Cancel );
36 myAttrCheckBox = new QCheckBox( tr( "WRITE_ST_AS_ATTRS_TO_DBF" ), mainFrame() );
37 myAttrCheckBox->setChecked(false);
38 myAvFields = new QComboBox( mainFrame() );
39 myAvFields->setEnabled(false);
40 myAvFields->addItems( theAttrItems );
42 QGridLayout* aLayout = new QGridLayout( mainFrame() );
43 aLayout->setMargin( 5 );
44 aLayout->setSpacing( 5 );
45 aLayout->addWidget( myAttrCheckBox, 0, 0 );
46 aLayout->addWidget( myAvFields, 1, 0, 1, 2 );
50 myDiscrLabel = new QLabel( tr( "LCM_DISCR_LABEL" ), mainFrame() );
51 myDeflSpinBox = new QDoubleSpinBox( mainFrame() );
52 myDeflSpinBox->setRange(0.001, 2);
53 myDeflSpinBox->setDecimals(3);
54 myDeflSpinBox->setSingleStep(0.001);
55 myDeflLabel = new QLabel ( tr( "LCM_DEFL_LABEL" ), mainFrame() );
56 aLayout->addWidget( myDiscrLabel, 2, 0 );
57 aLayout->addWidget( myDeflLabel, 3, 0, 1, 1 );
58 aLayout->addWidget( myDeflSpinBox, 3, 1, 2, 2 );
61 setMinimumSize( 300, 100 );
63 connect( myAttrCheckBox, SIGNAL(clicked(bool)), this, SLOT(onAttrCBChecked(bool)));
67 HYDROGUI_ExportLandCoverMapDlg::~HYDROGUI_ExportLandCoverMapDlg()
71 void HYDROGUI_ExportLandCoverMapDlg::onAttrCBChecked( bool theState )
74 myAvFields->setEnabled(true);
76 myAvFields->setEnabled(false);
79 QString HYDROGUI_ExportLandCoverMapDlg::getCurrentItem() const
81 return myAvFields->currentText();
84 bool HYDROGUI_ExportLandCoverMapDlg::getAttrCheckBoxState()
86 return myAttrCheckBox->isChecked();
89 double HYDROGUI_ExportLandCoverMapDlg::getDeflValue() const
91 return myDeflSpinBox->value();