Salome HOME
Update from BR_V5_DEV 13Feb2009
[modules/gui.git] / src / Plot2d / Plot2d_SetupViewDlg.cxx
index e8c8b54c10ce16f92d9d9c705a88cb2382d9d542..211a2faea272afd4631045b7d45a4182a57a7f82 100755 (executable)
@@ -1,59 +1,71 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File   : Plot2d_SetupViewDlg.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
 //
-//  File   : Plot2d_SetupViewDlg.cxx
-//  Author : Vadim SANDLER
-//  Module : SALOME
-//  $Header$
-
 #include "Plot2d_SetupViewDlg.h"
 
-#include "SUIT_Session.h"
-#include "SUIT_Application.h"
+#include <SUIT_Session.h>
+#include <SUIT_Application.h>
+#include <QtxColorButton.h>
 
-#include <qcheckbox.h>
-#include <qlineedit.h>
-#include <qcombobox.h>
-#include <qspinbox.h>
-#include <qtoolbutton.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qcolordialog.h>
-#include <qtabwidget.h>
+#include <QCheckBox>
+#include <QLineEdit>
+#include <QComboBox>
+#include <QSpinBox>
+#include <QGridLayout>
+#include <QHBoxLayout>
+#include <QGroupBox>
+#include <QLabel>
+#include <QPushButton>
+#include <QTabWidget>
 
-#define MARGIN_SIZE          11
-#define SPACING_SIZE         6
-#define MIN_EDIT_WIDTH       200
-#define MIN_COMBO_WIDTH      100
-#define MIN_SPIN_WIDTH       70
+const int MARGIN_SIZE     = 11;
+const int SPACING_SIZE    = 6;
+const int MIN_EDIT_WIDTH  = 200;
+const int MIN_COMBO_WIDTH = 100;
+const int MIN_SPIN_WIDTH  = 70;
 
 /*!
-  Constructor
+  \class Plot2d_SetupViewDlg
+  \brief Dialog box to setup Plot2d view window.
 */
-Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bool secondAxisY )
-    : QDialog( parent, "Plot2d_SetupViewDlg", true, 
-         WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+
+/*!
+  \brief Constructor.
+  \param parent parent widget
+  \param showDefCheck if \c true, show "Set settings as default" check box
+  \param secondAxisY if \c true, show widgets for the second (right) vertical axis
+*/
+Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, 
+                                         bool showDefCheck, 
+                                         bool secondAxisY )
+: QDialog( parent ), 
+  mySecondAxisY( secondAxisY )
 {
-  mySecondAxisY = secondAxisY;
-  setCaption( tr("TLT_SETUP_PLOT2D_VIEW") );
+  setModal( true );
+  setWindowTitle( tr("TLT_SETUP_PLOT2D_VIEW") );
   setSizeGripEnabled( TRUE );
+
   QGridLayout* topLayout = new QGridLayout( this ); 
   topLayout->setSpacing( SPACING_SIZE );
   topLayout->setMargin( MARGIN_SIZE );
@@ -63,53 +75,58 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   myTitleEdit  = new QLineEdit( this );
   myTitleEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myTitleEdit->setMinimumWidth( MIN_EDIT_WIDTH );
+
   // curve type : points, lines, spline
   QLabel* aCurveLab = new QLabel( tr( "PLOT2D_CURVE_TYPE_LBL" ), this );
-  myCurveCombo      = new QComboBox( false, this );
+  myCurveCombo      = new QComboBox( this );
   myCurveCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myCurveCombo->setMinimumWidth( MIN_COMBO_WIDTH );
-  myCurveCombo->insertItem( tr( "PLOT2D_CURVE_TYPE_POINTS" ) );
-  myCurveCombo->insertItem( tr( "PLOT2D_CURVE_TYPE_LINES" ) );
-  myCurveCombo->insertItem( tr( "PLOT2D_CURVE_TYPE_SPLINE" ) );
+  myCurveCombo->addItem( tr( "PLOT2D_CURVE_TYPE_POINTS" ) );
+  myCurveCombo->addItem( tr( "PLOT2D_CURVE_TYPE_LINES" ) );
+  myCurveCombo->addItem( tr( "PLOT2D_CURVE_TYPE_SPLINE" ) );
+
   // legend
   myLegendCheck = new QCheckBox( tr( "PLOT2D_ENABLE_LEGEND" ), this );
-  myLegendCombo = new QComboBox( false, this );
+  myLegendCombo = new QComboBox( this );
   myLegendCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myLegendCombo->setMinimumWidth( MIN_COMBO_WIDTH );
-  myLegendCombo->insertItem( tr( "PLOT2D_LEGEND_POSITION_LEFT" ) );
-  myLegendCombo->insertItem( tr( "PLOT2D_LEGEND_POSITION_RIGHT" ) );
-  myLegendCombo->insertItem( tr( "PLOT2D_LEGEND_POSITION_TOP" ) );
-  myLegendCombo->insertItem( tr( "PLOT2D_LEGEND_POSITION_BOTTOM" ) );
+  myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_LEFT" ) );
+  myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_RIGHT" ) );
+  myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_TOP" ) );
+  myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_BOTTOM" ) );
+
   // marker size
   QLabel* aMarkerLab  = new QLabel( tr( "PLOT2D_MARKER_SIZE_LBL" ), this );
-  myMarkerSpin = new QSpinBox( 0, 100, 1, this );
+  myMarkerSpin = new QSpinBox( this );
+  myMarkerSpin->setMinimum( 0 );
+  myMarkerSpin->setMaximum( 100 );
+  myMarkerSpin->setSingleStep( 1 );
   myMarkerSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myMarkerSpin->setMinimumWidth( MIN_SPIN_WIDTH );
 
   // background color
   QLabel* aBGLab  = new QLabel( tr( "PLOT2D_BACKGROUND_COLOR_LBL" ), this );
-  myBackgroundBtn = new QToolButton( this );
-  myBackgroundBtn->setMinimumWidth(20);
+  myBackgroundBtn = new QtxColorButton( this );
 
   // scale mode
   QGroupBox* aScaleGrp = new QGroupBox( tr( "PLOT2D_SCALE_TLT" ), this );
-  aScaleGrp->setColumnLayout(0, Qt::Vertical );
-  aScaleGrp->layout()->setSpacing( 0 );  aScaleGrp->layout()->setMargin( 0 );
-  QGridLayout* aScaleLayout = new QGridLayout( aScaleGrp->layout() );
+  QGridLayout* aScaleLayout = new QGridLayout( aScaleGrp );
   aScaleLayout->setMargin( MARGIN_SIZE ); aScaleLayout->setSpacing( SPACING_SIZE );
+  aScaleGrp->setLayout( aScaleLayout );
 
   QLabel* xScaleLab = new QLabel( tr( "PLOT2D_SCALE_MODE_HOR" ), aScaleGrp );
-  myXModeCombo = new QComboBox( false, aScaleGrp );
+  myXModeCombo = new QComboBox( aScaleGrp );
   myXModeCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myXModeCombo->setMinimumWidth( MIN_COMBO_WIDTH );
-  myXModeCombo->insertItem( tr( "PLOT2D_SCALE_MODE_LINEAR" ) );
-  myXModeCombo->insertItem( tr( "PLOT2D_SCALE_MODE_LOGARITHMIC" ) );
+  myXModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LINEAR" ) );
+  myXModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LOGARITHMIC" ) );
+
   QLabel* yScaleLab = new QLabel( tr( "PLOT2D_SCALE_MODE_VER" ), aScaleGrp );
-  myYModeCombo = new QComboBox( false, aScaleGrp );
+  myYModeCombo = new QComboBox( aScaleGrp );
   myYModeCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myYModeCombo->setMinimumWidth( MIN_COMBO_WIDTH );
-  myYModeCombo->insertItem( tr( "PLOT2D_SCALE_MODE_LINEAR" ) );
-  myYModeCombo->insertItem( tr( "PLOT2D_SCALE_MODE_LOGARITHMIC" ) );
+  myYModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LINEAR" ) );
+  myYModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LOGARITHMIC" ) );
 
   aScaleLayout->addWidget( xScaleLab,    0, 0 );
   aScaleLayout->addWidget( myXModeCombo, 0, 1 );
@@ -117,34 +134,45 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   aScaleLayout->addWidget( myYModeCombo, 0, 3 );
 
   // tab widget for choose properties of axis 
-  QTabWidget* aTabWidget = new QTabWidget( this, "tabWidget" );
+  QTabWidget* aTabWidget = new QTabWidget( this );
 
   // widget for parameters on Ox
   QWidget* aXWidget = new QWidget(aTabWidget);
   QGridLayout* aXLayout = new QGridLayout( aXWidget ); 
   aXLayout->setSpacing( SPACING_SIZE );
   aXLayout->setMargin( MARGIN_SIZE );
+
   // axis title
   myTitleXCheck = new QCheckBox( tr( "PLOT2D_ENABLE_HOR_TITLE" ), aXWidget );
   myTitleXEdit  = new QLineEdit( aXWidget );
   myTitleXEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myTitleXEdit->setMinimumWidth( MIN_EDIT_WIDTH );
-  aXLayout->addWidget( myTitleXCheck,         1,    0    );
-  aXLayout->addMultiCellWidget( myTitleXEdit, 1, 1, 1, 3 );
+  aXLayout->addWidget( myTitleXCheck,1,    0    );
+  aXLayout->addWidget( myTitleXEdit, 1, 1, 1, 3 );
+
   // grid
   QGroupBox* aGridGrpX = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aXWidget );
-  aGridGrpX->setColumnLayout(0, Qt::Vertical );
-  aGridGrpX->layout()->setSpacing( 0 );  aGridGrpX->layout()->setMargin( 0 );
-  QGridLayout* aGridLayoutX = new QGridLayout( aGridGrpX->layout() );
-  aGridLayoutX->setMargin( MARGIN_SIZE ); aGridLayoutX->setSpacing( SPACING_SIZE );
+  QGridLayout* aGridLayoutX = new QGridLayout( aGridGrpX );
+  aGridLayoutX->setMargin( MARGIN_SIZE ); 
+  aGridLayoutX->setSpacing( SPACING_SIZE );
+
   myXGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_HOR_MAJOR" ), aGridGrpX );
+
   QLabel* aXMajLbl  = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpX);
-  myXGridSpin       = new QSpinBox( 1, 100, 1, aGridGrpX );
+  myXGridSpin       = new QSpinBox( aGridGrpX );
+  myXGridSpin->setMinimum( 1 );
+  myXGridSpin->setMaximum( 100 );
+  myXGridSpin->setSingleStep( 1 );
   myXGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myXGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
+  
   myXMinGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_HOR_MINOR" ), aGridGrpX );
+  
   QLabel* aXMinLbl     = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpX);
-  myXMinGridSpin       = new QSpinBox( 1, 100, 1, aGridGrpX );
+  myXMinGridSpin       = new QSpinBox( aGridGrpX );
+  myXMinGridSpin->setMinimum( 1 );
+  myXMinGridSpin->setMaximum( 100 );
+  myXMinGridSpin->setSingleStep( 1 );
   myXMinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myXMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
 
@@ -154,7 +182,7 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   aGridLayoutX->addWidget( myXMinGridCheck, 1, 0 );
   aGridLayoutX->addWidget( aXMinLbl,        1, 1 );
   aGridLayoutX->addWidget( myXMinGridSpin,  1, 2 );
-  aXLayout->addMultiCellWidget( aGridGrpX, 3, 3, 0, 3 );
+  aXLayout->addWidget( aGridGrpX, 3, 0, 1, 4 );
 
   aTabWidget->addTab( aXWidget, tr( "INF_AXES_X" ) );
 
@@ -163,27 +191,38 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   QGridLayout* aYLayout = new QGridLayout( aYWidget ); 
   aYLayout->setSpacing( SPACING_SIZE );
   aYLayout->setMargin( MARGIN_SIZE );
+
   // axis title
   myTitleYCheck = new QCheckBox( tr( "PLOT2D_ENABLE_VER_TITLE" ), aYWidget );
   myTitleYEdit  = new QLineEdit( aYWidget );
   myTitleYEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myTitleYEdit->setMinimumWidth( MIN_EDIT_WIDTH );
-  aYLayout->addWidget( myTitleYCheck,         1,    0    );
-  aYLayout->addMultiCellWidget( myTitleYEdit, 1, 1, 1, 3 );
+  aYLayout->addWidget( myTitleYCheck,1,    0    );
+  aYLayout->addWidget( myTitleYEdit, 1, 1, 1, 3 );
+
   // grid
   QGroupBox* aGridGrpY = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aYWidget );
-  aGridGrpY->setColumnLayout(0, Qt::Vertical );
-  aGridGrpY->layout()->setSpacing( 0 );  aGridGrpY->layout()->setMargin( 0 );
-  QGridLayout* aGridLayoutY = new QGridLayout( aGridGrpY->layout() );
+  QGridLayout* aGridLayoutY = new QGridLayout( aGridGrpY );
+  aGridGrpY->setLayout( aGridLayoutY );
   aGridLayoutY->setMargin( MARGIN_SIZE ); aGridLayoutY->setSpacing( SPACING_SIZE );
+
   myYGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MAJOR" ), aGridGrpY );
+
   QLabel* aYMajLbl  = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY);
-  myYGridSpin       = new QSpinBox( 1, 100, 1, aGridGrpY );
+  myYGridSpin       = new QSpinBox( aGridGrpY );
+  myYGridSpin->setMinimum( 1 );
+  myYGridSpin->setMaximum( 100 );
+  myYGridSpin->setSingleStep( 1 );
   myYGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myYGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
+
   myYMinGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MINOR" ), aGridGrpY );
+
   QLabel* aYMinLbl     = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY);
-  myYMinGridSpin       = new QSpinBox( 1, 100, 1, aGridGrpY );
+  myYMinGridSpin       = new QSpinBox( aGridGrpY );
+  myYMinGridSpin->setMinimum( 1 );
+  myYMinGridSpin->setMaximum( 100 );
+  myYMinGridSpin->setSingleStep( 1 );
   myYMinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
   myYMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
 
@@ -193,38 +232,49 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   aGridLayoutY->addWidget( myYMinGridCheck, 1, 0 );
   aGridLayoutY->addWidget( aYMinLbl,        1, 1 );
   aGridLayoutY->addWidget( myYMinGridSpin,  1, 2 );
-  aYLayout->addMultiCellWidget( aGridGrpY, 3, 3, 0, 3 );
+  aYLayout->addWidget( aGridGrpY, 3, 0, 1, 4 );
 
   aTabWidget->addTab( aYWidget, tr( "INF_AXES_Y_LEFT" ) );
 
   // if exist second axis Oy, addition new tab widget for right axis
-  if (mySecondAxisY) {
+  if ( mySecondAxisY ) {
     // widget for parameters on Oy
-    QWidget* aYWidget2 = new QWidget(aTabWidget);
+    QWidget* aYWidget2 = new QWidget( aTabWidget );
     QGridLayout* aYLayout2 = new QGridLayout( aYWidget2 );
     aYLayout2->setSpacing( SPACING_SIZE );
     aYLayout2->setMargin( MARGIN_SIZE );
+
     // axis title
     myTitleY2Check = new QCheckBox( tr( "PLOT2D_ENABLE_VER_TITLE" ), aYWidget2 );
     myTitleY2Edit  = new QLineEdit( aYWidget2 );
     myTitleY2Edit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
     myTitleY2Edit->setMinimumWidth( MIN_EDIT_WIDTH );
-    aYLayout2->addWidget( myTitleY2Check,         1,    0    );
-    aYLayout2->addMultiCellWidget( myTitleY2Edit, 1, 1, 1, 3 );
+    aYLayout2->addWidget( myTitleY2Check,1,    0    );
+    aYLayout2->addWidget( myTitleY2Edit, 1, 1, 1, 3 );
+
     // grid
     QGroupBox* aGridGrpY2 = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aYWidget2 );
-    aGridGrpY2->setColumnLayout(0, Qt::Vertical );
-    aGridGrpY2->layout()->setSpacing( 0 );  aGridGrpY2->layout()->setMargin( 0 );
-    QGridLayout* aGridLayoutY2 = new QGridLayout( aGridGrpY2->layout() );
+    QGridLayout* aGridLayoutY2 = new QGridLayout( aGridGrpY2 );
+    aGridGrpY2->setLayout( aGridLayoutY2 );
     aGridLayoutY2->setMargin( MARGIN_SIZE ); aGridLayoutY2->setSpacing( SPACING_SIZE );
+
     myY2GridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MAJOR" ), aGridGrpY2 );
+
     QLabel* aY2MajLbl  = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY2);
-    myY2GridSpin       = new QSpinBox( 1, 100, 1, aGridGrpY2 );
+    myY2GridSpin       = new QSpinBox( aGridGrpY2 );
+    myY2GridSpin->setMinimum( 1 );
+    myY2GridSpin->setMaximum( 100 );
+    myY2GridSpin->setSingleStep( 1 );
     myY2GridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
     myY2GridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
+
     myY2MinGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MINOR" ), aGridGrpY2 );
+
     QLabel* aY2MinLbl     = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY2);
-    myY2MinGridSpin       = new QSpinBox( 1, 100, 1, aGridGrpY2 );
+    myY2MinGridSpin       = new QSpinBox( aGridGrpY2 );
+    myY2MinGridSpin->setMinimum( 1 );
+    myY2MinGridSpin->setMaximum( 100 );
+    myY2MinGridSpin->setSingleStep( 1 );
     myY2MinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
     myY2MinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
 
@@ -234,7 +284,7 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
     aGridLayoutY2->addWidget( myY2MinGridCheck, 1, 0 );
     aGridLayoutY2->addWidget( aY2MinLbl,        1, 1 );
     aGridLayoutY2->addWidget( myY2MinGridSpin,  1, 2 );
-    aYLayout2->addMultiCellWidget( aGridGrpY2, 3, 3, 0, 3 );
+    aYLayout2->addWidget( aGridGrpY2, 3, 0, 1, 4 );
 
     aTabWidget->addTab( aYWidget2, tr( "INF_AXES_Y_RIGHT" ) );
   }
@@ -247,11 +297,13 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
     myY2MinGridSpin  = 0;
     myY2ModeCombo    = 0;
   }
-  aTabWidget->setCurrentPage( 0 );
+
+  aTabWidget->setCurrentIndex( 0 );
   /* "Set as default" check box */
+
   myDefCheck = new QCheckBox( tr( "PLOT2D_SET_AS_DEFAULT_CHECK" ), this );
 
-  /* OK/Cancel/Help buttons */
+  /* OK/Cancel buttons */
   myOkBtn = new QPushButton( tr( "BUT_OK" ), this );
   myOkBtn->setAutoDefault( TRUE );
   myOkBtn->setDefault( TRUE );
@@ -266,24 +318,24 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   btnLayout->addWidget( myHelpBtn );
   
   // layout widgets
-  topLayout->addWidget( myTitleCheck,          0,    0    );
-  topLayout->addMultiCellWidget( myTitleEdit,  0, 0, 1, 3 );
-  topLayout->addWidget( aCurveLab,             1,    0    );
-  topLayout->addWidget( myCurveCombo,          1,    1    );
-  topLayout->addWidget( myLegendCheck,         1,    2    );
-  topLayout->addWidget( myLegendCombo,         1,    3    );
-  topLayout->addWidget( aMarkerLab,            2,    0    );
-  topLayout->addWidget( myMarkerSpin,          2,    1    );
+  topLayout->addWidget( myTitleCheck,  0,    0    );
+  topLayout->addWidget( myTitleEdit,   0, 1, 1, 3 );
+  topLayout->addWidget( aCurveLab,     1,    0    );
+  topLayout->addWidget( myCurveCombo,  1,    1    );
+  topLayout->addWidget( myLegendCheck, 1,    2    );
+  topLayout->addWidget( myLegendCombo, 1,    3    );
+  topLayout->addWidget( aMarkerLab,    2,    0    );
+  topLayout->addWidget( myMarkerSpin,  2,    1    );
   QHBoxLayout* bgLayout = new QHBoxLayout;
   bgLayout->addWidget( myBackgroundBtn ); bgLayout->addStretch();
-  topLayout->addWidget( aBGLab,                2,    2    );
-  topLayout->addLayout( bgLayout,              2,    3    );
-  topLayout->addMultiCellWidget( aScaleGrp,    3, 3, 0, 3 );
-  topLayout->addMultiCellWidget( aTabWidget,   4, 4, 0, 3 );
-  topLayout->addMultiCellWidget( myDefCheck,   5, 5, 0, 3 );
+  topLayout->addWidget( aBGLab,        2,    2    );
+  topLayout->addLayout( bgLayout,      2,    3    );
+  topLayout->addWidget( aScaleGrp,     3, 0, 1, 4 );
+  topLayout->addWidget( aTabWidget,    4, 0, 1, 4 );
+  topLayout->addWidget( myDefCheck,    5, 0, 1, 4 );
   topLayout->setRowStretch( 5, 5 );
 
-  topLayout->addMultiCellLayout( btnLayout,    6, 6, 0, 3 );
+  topLayout->addLayout( btnLayout,     6, 0, 1, 4 );
   
   if ( !showDefCheck )
     myDefCheck->hide();
@@ -291,7 +343,6 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   connect( myTitleCheck,    SIGNAL( clicked() ), this, SLOT( onMainTitleChecked() ) );
   connect( myTitleXCheck,   SIGNAL( clicked() ), this, SLOT( onXTitleChecked() ) );
   connect( myTitleYCheck,   SIGNAL( clicked() ), this, SLOT( onYTitleChecked() ) );
-  connect( myBackgroundBtn, SIGNAL( clicked() ), this, SLOT( onBackgroundClicked() ) );
   connect( myLegendCheck,   SIGNAL( clicked() ), this, SLOT( onLegendChecked() ) );
   connect( myXGridCheck,    SIGNAL( clicked() ), this, SLOT( onXGridMajorChecked() ) );
   connect( myYGridCheck,    SIGNAL( clicked() ), this, SLOT( onYGridMajorChecked() ) );
@@ -302,7 +353,7 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   connect( myCancelBtn,     SIGNAL( clicked() ), this, SLOT( reject() ) );
   connect( myHelpBtn,       SIGNAL( clicked() ), this, SLOT( onHelp() ) );
   
-  if (mySecondAxisY) {
+  if ( mySecondAxisY ) {
     connect( myTitleY2Check,   SIGNAL( clicked() ), this, SLOT( onY2TitleChecked() ) );
     connect( myY2GridCheck,    SIGNAL( clicked() ), this, SLOT( onY2GridMajorChecked() ) );
     connect( myY2MinGridCheck, SIGNAL( clicked() ), this, SLOT( onY2GridMinorChecked() ) );
@@ -317,7 +368,7 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
   onXGridMajorChecked();
   onYGridMajorChecked();
   onXGridMinorChecked();
-  if (mySecondAxisY) {
+  if ( mySecondAxisY ) {
     onY2TitleChecked();
     onY2GridMajorChecked();
     onY2GridMinorChecked();
@@ -325,13 +376,17 @@ Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bo
 }
 
 /*!
-  Destructor
+  \brief Destructor.
 */
 Plot2d_SetupViewDlg::~Plot2d_SetupViewDlg()
 {
 }
+
 /*!
-  Sets main title attributes
+  \brief Set main title attributes.
+  \param enable if \c true main title is enabled
+  \param title main title
+  \sa isMainTitleEnabled(), getMainTitle()
 */
 void Plot2d_SetupViewDlg::setMainTitle( bool enable, const QString& title )
 {
@@ -340,22 +395,32 @@ void Plot2d_SetupViewDlg::setMainTitle( bool enable, const QString& title )
     myTitleEdit->setText( title );
   onMainTitleChecked();
 }
+
 /*!
-  Returns TRUE if main title is enabled
+  \brief Check if main title is enabled.
+  \return \c true if main title is enabled
+  \sa setMainTitle()
 */
 bool Plot2d_SetupViewDlg::isMainTitleEnabled()
 {
   return myTitleCheck->isChecked();
 }
+
 /*!
-  Gets main title
+  \brief Get main title.
+  \return main title
+  \sa setMainTitle()
 */
 QString Plot2d_SetupViewDlg::getMainTitle()
 {
   return myTitleEdit->text();
 }
+
 /*!
-  Sets horizontal axis title attributes
+  \brief Set horizontal axis title attributes.
+  \param enable if \c true horizontal axis title is enabled
+  \param title horizontal axis title
+  \sa isXTitleEnabled(), getXTitle()
 */
 void Plot2d_SetupViewDlg::setXTitle( bool enable, const QString& title )
 {
@@ -364,22 +429,32 @@ void Plot2d_SetupViewDlg::setXTitle( bool enable, const QString& title )
     myTitleXEdit->setText( title );
   onXTitleChecked();
 }
+
 /*!
-  Returns TRUE if horizontal axis title is enabled
+  \brief Check if main title is enabled.
+  \return \c true if horizontal axis title is enabled
+  \sa setXTitle()
 */
 bool Plot2d_SetupViewDlg::isXTitleEnabled()
 {
   return myTitleXCheck->isChecked();
 }
+
 /*!
-  Gets horizontal axis title
+  \brief Get horizontal axis title.
+  \return horizontal axis title
+  \sa setXTitle()
 */
 QString Plot2d_SetupViewDlg::getXTitle()
 {
   return myTitleXEdit->text();
 }
+
 /*!
-  Sets vertical left axis title attributes
+  \brief Set left vertical axis title attributes.
+  \param enable if \c true left vertical axis title is enabled
+  \param title left vertical axis title
+  \sa setY2Title(), isYTitleEnabled(), getYTitle()
 */
 void Plot2d_SetupViewDlg::setYTitle( bool enable, const QString& title )
 {
@@ -388,8 +463,12 @@ void Plot2d_SetupViewDlg::setYTitle( bool enable, const QString& title )
     myTitleYEdit->setText( title );
   onYTitleChecked();
 }
+
 /*!
-  Sets vertical right axis title attributes
+  \brief Set right vertical axis title attributes.
+  \param enable if \c true right vertical axis title is enabled
+  \param title right vertical axis title
+  \sa setYTitle(), isY2TitleEnabled(), getY2Title()
 */
 void Plot2d_SetupViewDlg::setY2Title( bool enable, const QString& title )
 {
@@ -398,112 +477,153 @@ void Plot2d_SetupViewDlg::setY2Title( bool enable, const QString& title )
     myTitleY2Edit->setText( title );
   onY2TitleChecked();
 }
+
 /*!
-  Returns TRUE if vertical left axis title is enabled
+  \brief Check if left vertical axis title is enabled.
+  \return \c true if right vertical axis title is enabled
+  \sa setYTitle()
 */
 bool Plot2d_SetupViewDlg::isYTitleEnabled()
 {
   return myTitleYCheck->isChecked();
 }
+
 /*!
-  Returns TRUE if vertical right axis title is enabled
+  \brief Check if right vertical axis title is enabled.
+  \return \c true if right vertical axis title is enabled
+  \sa setY2Title()
 */
 bool Plot2d_SetupViewDlg::isY2TitleEnabled()
 {
   return myTitleY2Check->isChecked();
 }
+
 /*!
-  Gets vertical left axis title
+  \brief Get left vertical axis title.
+  \return left vertical axis title
+  \sa setYTitle()
 */
 QString Plot2d_SetupViewDlg::getYTitle()
 {
   return myTitleYEdit->text();
 }
+
 /*!
-  Gets vertical right axis title
+  \brief Get right vertical axis title.
+  \return right vertical axis title
+  \sa setY2Title()
 */
 QString Plot2d_SetupViewDlg::getY2Title()
 {
   return myTitleY2Edit->text();
 }
+
 /*!
-  Sets curve type : 0 - points, 1 - lines, 2 - splines
+  \brief Set curve type.
+  \param type curve type: 0 (points), 1 (lines) or 2 (splines)
+  \sa getCurveType()
 */
 void Plot2d_SetupViewDlg::setCurveType( const int type )
 {
-  myCurveCombo->setCurrentItem( type );
+  myCurveCombo->setCurrentIndex( type );
 }
+
 /*!
-  Gets curve type : 0 - points, 1 - lines, 2 - splines
+  \brief Get curve type.
+  \return curve type: 0 (points), 1 (lines) or 2 (splines)
+  \sa setCurveType()
 */
 int Plot2d_SetupViewDlg::getCurveType()
 {
-  return myCurveCombo->currentItem();
+  return myCurveCombo->currentIndex();
 }
+
 /*!
-  Sets legend attributes : pos = 0 - left, 1 - right, 2 - top, 3 - bottom
+  \brief Set legend attribute.
+  \param if \c true legend is shown
+  \param pos legend position: 0 (left), 1 (right), 2 (top), 3 (bottom)
+  \sa isLegendEnabled(), getLegendPos()
 */
 void Plot2d_SetupViewDlg::setLegend( bool enable, int pos )
 {
   myLegendCheck->setChecked( enable );
-  myLegendCombo->setCurrentItem( pos );
+  myLegendCombo->setCurrentIndex( pos );
   onLegendChecked();
 }
+
 /*!
-  Returns TRUE if legend is enabled
+  \brief Check if legend is enabled.
+  \return \c true if legend is enabled
+  \sa setLegend()
 */
 bool Plot2d_SetupViewDlg::isLegendEnabled()
 {
   return myLegendCheck->isChecked();
 }
+
 /*!
-  Returns legend position
+  \brief Get legend position.
+  \return legend position: 0 (left), 1 (right), 2 (top), 3 (bottom)
+  \sa setLegend()
 */
 int Plot2d_SetupViewDlg::getLegendPos()
 {
-  return myLegendCombo->currentItem();
+  return myLegendCombo->currentIndex();
 }
+
 /*!
-  Sets marker size
+  \brief Set marker size.
+  \param size marker size
+  \sa getMarkerSize()
 */
 void Plot2d_SetupViewDlg::setMarkerSize( const int size )
 {
   myMarkerSpin->setValue( size );
 }
+
 /*!
-  Gets marker size
+  \brief Get marker size.
+  \return marker size
+  \sa setMarkerSize()
 */
 int Plot2d_SetupViewDlg::getMarkerSize()
 {
   return myMarkerSpin->value();
 }
+
 /*!
-  Sets background color
+  \brief Set background color.
+  \param color background color
+  \sa getBackgroundColor()
 */
 void Plot2d_SetupViewDlg::setBackgroundColor( const QColor& color )
 {
-  QPalette pal = myBackgroundBtn->palette();
-  QColorGroup ca = pal.active();
-  ca.setColor( QColorGroup::Button, color );
-  QColorGroup ci = pal.inactive();
-  ci.setColor( QColorGroup::Button, color );
-  pal.setActive( ca );
-  pal.setInactive( ci );
-  myBackgroundBtn->setPalette( pal );
+  myBackgroundBtn->setColor( color );
 }
+
 /*!
-  Gets background color
+  \brief Get background color.
+  \return background color
+  \sa setBackgroundColor()
 */
 QColor Plot2d_SetupViewDlg::getBackgroundColor()
 {
-  return myBackgroundBtn->palette().active().button();
+  return myBackgroundBtn->color();
 }
+
 /*!
-  Sets major grid parameters
+  \brief Set major grid parameters.
+  \param enableX if \c true, horizontal major grid is enabled
+  \param divX maximum number of ticks for horizontal major grid
+  \param enableY if \c true, left vertical major grid is enabled
+  \param divY maximum number of ticks for left vertical major grid
+  \param enableY2 if \c true, right vertical major grid is enabled
+  \param divY2 maximum number of ticks for right vertical major grid
+  \sa getMajorGrid()
 */
 void Plot2d_SetupViewDlg::setMajorGrid( bool enableX, const int divX,
                                         bool enableY, const int divY,
-                                        bool enableY2, const int divY2  )
+                                        bool enableY2, const int divY2 )
 {
   myXGridCheck->setChecked( enableX );
   myXGridSpin->setValue( divX );
@@ -517,12 +637,20 @@ void Plot2d_SetupViewDlg::setMajorGrid( bool enableX, const int divX,
     onY2GridMajorChecked();
   }
 }
+
 /*!
-  Gets major grid parameters
+  \brief Get major grid parameters.
+  \param enableX \c true if horizontal major grid is enabled
+  \param divX maximum number of ticks for horizontal major grid
+  \param enableY \c true if left vertical major grid is enabled
+  \param divY maximum number of ticks for left vertical major grid
+  \param enableY2 \c true if right vertical major grid is enabled
+  \param divY2 maximum number of ticks for right vertical major grid
+  \sa setMajorGrid()
 */
 void Plot2d_SetupViewDlg::getMajorGrid( bool& enableX, int& divX,
                                         bool& enableY, int& divY,
-                                        bool& enableY2, int& divY2)
+                                        bool& enableY2, int& divY2 )
 {
   enableX  = myXGridCheck->isChecked();
   divX     = myXGridSpin->value();
@@ -537,12 +665,20 @@ void Plot2d_SetupViewDlg::getMajorGrid( bool& enableX, int& divX,
     divY2    = 1;
   }
 }
+
 /*!
-  Sets minor grid parameters
+  \brief Set minor grid parameters.
+  \param enableX if \c true, horizontal minor grid is enabled
+  \param divX maximum number of ticks for horizontal minor grid
+  \param enableY if \c true, left vertical minor grid is enabled
+  \param divY maximum number of ticks for left vertical minor grid
+  \param enableY2 if \c true, right vertical minor grid is enabled
+  \param divY2 maximum number of ticks for right vertical minor grid
+  \sa getMinorGrid()
 */
 void Plot2d_SetupViewDlg::setMinorGrid( bool enableX, const int divX,
                                         bool enableY, const int divY,
-                                        bool enableY2, const int divY2)
+                                        bool enableY2, const int divY2 )
 {
   myXMinGridCheck->setChecked( enableX );
   myXMinGridSpin->setValue( divX );
@@ -556,18 +692,26 @@ void Plot2d_SetupViewDlg::setMinorGrid( bool enableX, const int divX,
     onY2GridMinorChecked();
   }
 }
+
 /*!
-  Gets minor grid parameters
+  \brief Get minor grid parameters.
+  \param enableX \c true if horizontal minor grid is enabled
+  \param divX maximum number of ticks for horizontal minor grid
+  \param enableY \c true if left vertical minor grid is enabled
+  \param divY maximum number of ticks for left vertical minor grid
+  \param enableY2 \c true if right vertical minor grid is enabled
+  \param divY2 maximum number of ticks for right vertical minor grid
+  \sa setMinorGrid()
 */
 void Plot2d_SetupViewDlg::getMinorGrid( bool& enableX, int& divX,
                                         bool& enableY, int& divY,
-                                        bool& enableY2, int& divY2)
+                                        bool& enableY2, int& divY2 )
 {
   enableX  = myXMinGridCheck->isChecked();
   divX     = myXMinGridSpin->value();
   enableY  = myYMinGridCheck->isChecked();
   divY     = myYMinGridSpin->value();
-  if (mySecondAxisY) {
+  if ( mySecondAxisY ) {
     enableY2 = myY2MinGridCheck->isChecked();
     divY2    = myY2MinGridSpin->value();
   }
@@ -576,114 +720,127 @@ void Plot2d_SetupViewDlg::getMinorGrid( bool& enableX, int& divX,
     divY2    = 1;
   }
 }
+
 /*!
-  Sets scale mode for hor. and ver. axes : 0 - linear, 1 - logarithmic
+  \brief Set scale mode for horizontal and vertical axes.
+  \param xMode horizontal axis scale mode: 0 (linear), 1 (logarithmic)
+  \param yMode vertical axis scale mode: 0 (linear), 1 (logarithmic)
+  \sa getXScaleMode(), getYScaleMode()
 */
 void Plot2d_SetupViewDlg::setScaleMode( const int xMode, const int yMode )
 {
-  myXModeCombo->setCurrentItem( xMode );
-  myYModeCombo->setCurrentItem( yMode );
+  myXModeCombo->setCurrentIndex( xMode );
+  myYModeCombo->setCurrentIndex( yMode );
 }
+
 /*!
-  Gets scale mode for hor. axis : 0 - linear, 1 - logarithmic
+  \brief Get scale mode for horizontal axis.
+  \return horizontal axis scale mode: 0 (linear), 1 (logarithmic)
+  \sa setScaleMode()
 */
-int  Plot2d_SetupViewDlg::getXScaleMode()
+int Plot2d_SetupViewDlg::getXScaleMode()
 {
-  return myXModeCombo->currentItem();
+  return myXModeCombo->currentIndex();
 }
+
 /*!
-  Gets scale mode for hor. axis : 0 - linear, 1 - logarithmic
+  \brief Get scale mode for vertical axis.
+  \return vertical axis scale mode: 0 (linear), 1 (logarithmic)
+  \sa setScaleMode()
 */
 int  Plot2d_SetupViewDlg::getYScaleMode()
 {
-  return myYModeCombo->currentItem();
+  return myYModeCombo->currentIndex();
 }
+
 /*!
-  Slot, called when user clicks "Show main title" check box
+  \brief Called when user clicks "Show main title" check box.
 */
 void Plot2d_SetupViewDlg::onMainTitleChecked()
 {
   myTitleEdit->setEnabled( myTitleCheck->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks "Show horizontal axis title" check box
+  \brief Called when user clicks "Show horizontal axis title" check box.
 */
 void Plot2d_SetupViewDlg::onXTitleChecked()
 {
   myTitleXEdit->setEnabled( myTitleXCheck->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks "Show vertical left axis title" check box
+  \brief Called when user clicks "Show vertical left axis title" check box.
 */
 void Plot2d_SetupViewDlg::onYTitleChecked()
 {
   myTitleYEdit->setEnabled( myTitleYCheck->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks "Show vertical right axis title" check box
+  \brief Called when user clicks "Show vertical right axis title" check box.
 */
 void Plot2d_SetupViewDlg::onY2TitleChecked()
 {
   myTitleY2Edit->setEnabled( myTitleY2Check->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks "Change bacground color" button
-*/
-void Plot2d_SetupViewDlg::onBackgroundClicked()
-{
-  QColor color = QColorDialog::getColor( getBackgroundColor() );
-  if ( color.isValid() ) {
-    setBackgroundColor( color );
-  }
-}
-/*!
-  Slot, called when user clicks "Show Legend" check box
+  \brief Called when user clicks "Show Legend" check box.
 */
 void Plot2d_SetupViewDlg::onLegendChecked()
 {
   myLegendCombo->setEnabled( myLegendCheck->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks "Enable hor. major grid" check box
+  \brief Called when user clicks "Enable horizontal major grid" check box.
 */
 void Plot2d_SetupViewDlg::onXGridMajorChecked()
 {
   myXMinGridCheck->setEnabled( myXGridCheck->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks  "Enable ver. major grid" check box
+  \brief Called when user clicks "Enable left vertical major grid" check box.
 */
 void Plot2d_SetupViewDlg::onYGridMajorChecked()
 {
   myYMinGridCheck->setEnabled( myYGridCheck->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks  "Enable ver. major grid" check box
+  \brief Called when user clicks "Enable right vertical major grid" check box.
 */
 void Plot2d_SetupViewDlg::onY2GridMajorChecked()
 {
   myY2MinGridCheck->setEnabled( myY2GridCheck->isChecked() );
 }
+
 /*!
-  Slot, called when user clicks  "Enable hor. minor grid" check box
+  \brief Called when user clicks "Enable horizontal minor grid" check box.
 */
 void Plot2d_SetupViewDlg::onXGridMinorChecked()
 {
 }
+
 /*!
-  Slot, called when user clicks  "Enable ver. minor grid" check box
+  \brief Called when user clicks "Enable left vertical minor grid" check box.
 */
 void Plot2d_SetupViewDlg::onYGridMinorChecked()
 {
 }
+
 /*!
-  Slot, called when user clicks  "Enable ver. minor grid" check box
+  \brief Called when user clicks "Enable right vertical minor grid" check box.
 */
 void Plot2d_SetupViewDlg::onY2GridMinorChecked()
 {
 }
+
 /*!
-  Retursns true if "Set as default" check box is on
+  \brief Get "Set settings as default" check box value.
+  \return \c true if "Set settings as default" check box is on
 */
 bool Plot2d_SetupViewDlg::isSetAsDefault()
 {
@@ -696,6 +853,6 @@ bool Plot2d_SetupViewDlg::isSetAsDefault()
 void Plot2d_SetupViewDlg::onHelp()
 {
   SUIT_Application* app = SUIT_Session::session()->activeApplication();
-  if (app)
-    app->onHelpContextModule("GUI", "plot2d_viewer_page.html#settings");
+  if ( app )
+    app->onHelpContextModule( "GUI", "plot2d_viewer_page.html", "settings" );
 }