Salome HOME
refs #682, #684 - #686: create icons for land cover map operations.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ExportLandCoverMapDlg.cxx
index 9da8db3674602c94459d2b946aef82c704690fec..4c18253687d04cfb38a47a6de23f3e996c94887c 100644 (file)
 #include <QCheckBox>
 #include <QVBoxLayout>
 #include <QComboBox>
+#include <QLabel>
+#include <QDoubleSpinBox>
 
-HYDROGUI_ExportLandCoverMapDlg::HYDROGUI_ExportLandCoverMapDlg( QWidget* theParent, const QStringList& theAttrItems )
+HYDROGUI_ExportLandCoverMapDlg::HYDROGUI_ExportLandCoverMapDlg( QWidget* theParent, bool IsLinear, const QStringList& theAttrItems )
   : QtxDialog( theParent, false, true, QtxDialog::OKCancel )
 {
   setWindowTitle( tr( "EXPORT_LANDCOVERMAP" ) );
@@ -43,6 +45,25 @@ HYDROGUI_ExportLandCoverMapDlg::HYDROGUI_ExportLandCoverMapDlg( QWidget* thePare
   aLayout->addWidget( myAttrCheckBox, 0, 0 );
   aLayout->addWidget( myAvFields, 1, 0, 1, 2 );
 
+  if(!IsLinear)
+  {
+    myDiscrLabel = new QLabel( tr( "LCM_DISCR_LABEL" ), mainFrame() );
+    myDeflSpinBox = new QDoubleSpinBox( mainFrame() );
+    myDeflSpinBox->setRange(0.001, 2); 
+    myDeflSpinBox->setDecimals(3);
+    myDeflSpinBox->setSingleStep(0.001);
+    myDeflLabel = new QLabel ( tr( "LCM_DEFL_LABEL" ), mainFrame() );
+    aLayout->addWidget( myDiscrLabel, 2, 0 );
+    aLayout->addWidget( myDeflLabel, 3, 0, 1, 1 );
+    aLayout->addWidget( myDeflSpinBox, 3, 1, 2, 2 );
+  }
+  else
+  {
+    myDeflSpinBox = NULL;
+    myDeflLabel = NULL;
+    myDiscrLabel = NULL;
+  }
+
   setMinimumSize( 300, 100 );
 
   connect( myAttrCheckBox, SIGNAL(clicked(bool)), this, SLOT(onAttrCBChecked(bool)));
@@ -70,3 +91,11 @@ bool HYDROGUI_ExportLandCoverMapDlg::getAttrCheckBoxState()
 {
   return myAttrCheckBox->isChecked();
 }
+
+double HYDROGUI_ExportLandCoverMapDlg::getDeflValue() const
+{
+  if (myDeflSpinBox)
+    return myDeflSpinBox->value();
+  else 
+    return -1; //value is not needed
+}