Back to index

salome-gui  6.5.0
Plot2d_SetupViewDlg.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 // File   : Plot2d_SetupViewDlg.cxx
00024 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
00025 //
00026 #include "Plot2d_SetupViewDlg.h"
00027 
00028 #include <SUIT_Session.h>
00029 #include <SUIT_Application.h>
00030 #include <QtxColorButton.h>
00031 #include <QtxFontEdit.h>
00032 
00033 #include <QCheckBox>
00034 #include <QLineEdit>
00035 #include <QComboBox>
00036 #include <QSpinBox>
00037 #include <QGridLayout>
00038 #include <QHBoxLayout>
00039 #include <QGroupBox>
00040 #include <QLabel>
00041 #include <QPushButton>
00042 #include <QTabWidget>
00043 
00044 const int MARGIN_SIZE     = 11;
00045 const int SPACING_SIZE    = 6;
00046 const int MIN_EDIT_WIDTH  = 200;
00047 const int MIN_COMBO_WIDTH = 100;
00048 const int MIN_SPIN_WIDTH  = 70;
00049 
00061 Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, 
00062                                           bool showDefCheck, 
00063                                           bool secondAxisY )
00064 : QDialog( parent ), 
00065   mySecondAxisY( secondAxisY )
00066 {
00067   setModal( true );
00068   setWindowTitle( tr("TLT_SETUP_PLOT2D_VIEW") );
00069   setSizeGripEnabled( TRUE );
00070 
00071   QGridLayout* topLayout = new QGridLayout( this ); 
00072   topLayout->setSpacing( SPACING_SIZE );
00073   topLayout->setMargin( MARGIN_SIZE );
00074   
00075   // main title
00076   myTitleCheck = new QCheckBox( tr( "PLOT2D_ENABLE_MAIN_TITLE" ), this );
00077   myTitleEdit  = new QLineEdit( this );
00078   myTitleEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00079   myTitleEdit->setMinimumWidth( MIN_EDIT_WIDTH );
00080 
00081   // curve type : points, lines, spline
00082   QLabel* aCurveLab = new QLabel( tr( "PLOT2D_CURVE_TYPE_LBL" ), this );
00083   myCurveCombo      = new QComboBox( this );
00084   myCurveCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00085   myCurveCombo->setMinimumWidth( MIN_COMBO_WIDTH );
00086   myCurveCombo->addItem( tr( "PLOT2D_CURVE_TYPE_POINTS" ) );
00087   myCurveCombo->addItem( tr( "PLOT2D_CURVE_TYPE_LINES" ) );
00088   myCurveCombo->addItem( tr( "PLOT2D_CURVE_TYPE_SPLINE" ) );
00089 
00090   // legend
00091   myLegendCheck = new QCheckBox( tr( "PLOT2D_ENABLE_LEGEND" ), this );
00092   myLegendCombo = new QComboBox( this );
00093   myLegendFont = new QtxFontEdit( this );
00094   myLegendColor = new QtxColorButton( this );
00095   QLabel* aLegendFontLab = new QLabel( tr( "PLOT2D_LEGEND_FONT" ), this );
00096   myLegendCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00097   myLegendCombo->setMinimumWidth( MIN_COMBO_WIDTH );
00098   myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_LEFT" ) );
00099   myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_RIGHT" ) );
00100   myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_TOP" ) );
00101   myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_BOTTOM" ) );
00102 
00103   // marker size
00104   QLabel* aMarkerLab  = new QLabel( tr( "PLOT2D_MARKER_SIZE_LBL" ), this );
00105   myMarkerSpin = new QSpinBox( this );
00106   myMarkerSpin->setMinimum( 0 );
00107   myMarkerSpin->setMaximum( 100 );
00108   myMarkerSpin->setSingleStep( 1 );
00109   myMarkerSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00110   myMarkerSpin->setMinimumWidth( MIN_SPIN_WIDTH );
00111 
00112   // background color
00113   QLabel* aBGLab  = new QLabel( tr( "PLOT2D_BACKGROUND_COLOR_LBL" ), this );
00114   myBackgroundBtn = new QtxColorButton( this );
00115 
00116   //Deviation marker parameters
00117   QGroupBox* aDeviationGrp = new QGroupBox( tr( "PLOT2D_DEVIATION_MARKER_TLT" ), this );
00118   QHBoxLayout* aDeviationLayout = new QHBoxLayout(aDeviationGrp);
00119 
00120   //Deviation marker parameters : Line width
00121   QLabel* aDeviationLwLbl  = new QLabel( tr( "PLOT2D_DEVIATION_LW_LBL" ), aDeviationGrp );
00122   myDeviationLw  = new QSpinBox( aDeviationGrp );
00123   myDeviationLw->setMinimum( 1 );
00124   myDeviationLw->setMaximum( 5 );
00125   myDeviationLw->setSingleStep( 1 );
00126   myDeviationLw->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00127 
00128   //Deviation marker parameters : Line width
00129   QLabel* aDeviationTsLbl  = new QLabel( tr( "PLOT2D_DEVIATION_TS_LBL" ), aDeviationGrp );
00130   myDeviationTs  =  new QSpinBox( aDeviationGrp );
00131   myDeviationTs->setMinimum( 1 );
00132   myDeviationTs->setMaximum( 5 );
00133   myDeviationTs->setSingleStep( 1 );
00134   myDeviationTs->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00135 
00136   //Deviation marker parameters : Color
00137   QLabel* aDeviationClLbl  = new QLabel( tr( "PLOT2D_DEVIATION_CL_LBL" ), aDeviationGrp );
00138   myDeviationCl = new QtxColorButton( aDeviationGrp );
00139 
00140   aDeviationLayout->addWidget( aDeviationLwLbl );
00141   aDeviationLayout->addWidget( myDeviationLw );
00142   aDeviationLayout->addWidget( aDeviationTsLbl );
00143   aDeviationLayout->addWidget( myDeviationTs );
00144   aDeviationLayout->addWidget( aDeviationClLbl );
00145   aDeviationLayout->addWidget( myDeviationCl );
00146 
00147   // normalize mode
00148   QGroupBox* aNormalizeGrp = new QGroupBox( tr( "PLOT2D_NORMALIZE_TLT" ), this );
00149   QGridLayout* aNormalizeLayout = new QGridLayout( aNormalizeGrp );
00150   aNormalizeLayout->setMargin( MARGIN_SIZE ); aNormalizeLayout->setSpacing( SPACING_SIZE );
00151   aNormalizeGrp->setLayout( aNormalizeLayout );
00152   QLabel* aYLeftLab  = new QLabel( tr( "PLOT2D_NORMALIZE_LEFT_AXIS" ), aNormalizeGrp );
00153   myNormLMinCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MIN" ), aNormalizeGrp );
00154   myNormLMaxCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MAX" ), aNormalizeGrp );
00155   QLabel* aYRightLab  = new QLabel( tr( "PLOT2D_NORMALIZE_RIGHT_AXIS" ), aNormalizeGrp );
00156   myNormRMinCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MIN" ), aNormalizeGrp );
00157   myNormRMaxCheck = new QCheckBox( tr( "PLOT2D_NORMALIZE_MODE_MAX" ), aNormalizeGrp );
00158 
00159   aNormalizeLayout->addWidget( aYLeftLab,    0, 0 );
00160   aNormalizeLayout->addWidget( myNormLMaxCheck,    0, 1 );
00161   aNormalizeLayout->addWidget( myNormLMinCheck, 0, 2 );
00162   aNormalizeLayout->addWidget( aYRightLab,    1, 0 );
00163   aNormalizeLayout->addWidget( myNormRMaxCheck,    1, 1 );
00164   aNormalizeLayout->addWidget( myNormRMinCheck, 1, 2 );
00165 
00166   // scale mode
00167   QGroupBox* aScaleGrp = new QGroupBox( tr( "PLOT2D_SCALE_TLT" ), this );
00168   QGridLayout* aScaleLayout = new QGridLayout( aScaleGrp );
00169   aScaleLayout->setMargin( MARGIN_SIZE ); aScaleLayout->setSpacing( SPACING_SIZE );
00170   aScaleGrp->setLayout( aScaleLayout );
00171 
00172   QLabel* xScaleLab = new QLabel( tr( "PLOT2D_SCALE_MODE_HOR" ), aScaleGrp );
00173   myXModeCombo = new QComboBox( aScaleGrp );
00174   myXModeCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00175   myXModeCombo->setMinimumWidth( MIN_COMBO_WIDTH );
00176   myXModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LINEAR" ) );
00177   myXModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LOGARITHMIC" ) );
00178 
00179   QLabel* yScaleLab = new QLabel( tr( "PLOT2D_SCALE_MODE_VER" ), aScaleGrp );
00180   myYModeCombo = new QComboBox( aScaleGrp );
00181   myYModeCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00182   myYModeCombo->setMinimumWidth( MIN_COMBO_WIDTH );
00183   myYModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LINEAR" ) );
00184   myYModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LOGARITHMIC" ) );
00185 
00186   aScaleLayout->addWidget( xScaleLab,    0, 0 );
00187   aScaleLayout->addWidget( myXModeCombo, 0, 1 );
00188   aScaleLayout->addWidget( yScaleLab,    0, 2 );
00189   aScaleLayout->addWidget( myYModeCombo, 0, 3 );
00190 
00191   // tab widget for choose properties of axis 
00192   QTabWidget* aTabWidget = new QTabWidget( this );
00193 
00194   // widget for parameters on Ox
00195   QWidget* aXWidget = new QWidget(aTabWidget);
00196   QGridLayout* aXLayout = new QGridLayout( aXWidget ); 
00197   aXLayout->setSpacing( SPACING_SIZE );
00198   aXLayout->setMargin( MARGIN_SIZE );
00199 
00200   // axis title
00201   myTitleXCheck = new QCheckBox( tr( "PLOT2D_ENABLE_HOR_TITLE" ), aXWidget );
00202   myTitleXEdit  = new QLineEdit( aXWidget );
00203   myTitleXEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00204   myTitleXEdit->setMinimumWidth( MIN_EDIT_WIDTH );
00205   aXLayout->addWidget( myTitleXCheck,1,    0    );
00206   aXLayout->addWidget( myTitleXEdit, 1, 1, 1, 3 );
00207 
00208   // grid
00209   QGroupBox* aGridGrpX = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aXWidget );
00210   QGridLayout* aGridLayoutX = new QGridLayout( aGridGrpX );
00211   aGridLayoutX->setMargin( MARGIN_SIZE ); 
00212   aGridLayoutX->setSpacing( SPACING_SIZE );
00213 
00214   myXGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_HOR_MAJOR" ), aGridGrpX );
00215 
00216   QLabel* aXMajLbl  = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpX);
00217   myXGridSpin       = new QSpinBox( aGridGrpX );
00218   myXGridSpin->setMinimum( 1 );
00219   myXGridSpin->setMaximum( 100 );
00220   myXGridSpin->setSingleStep( 1 );
00221   myXGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00222   myXGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
00223   
00224   myXMinGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_HOR_MINOR" ), aGridGrpX );
00225   
00226   QLabel* aXMinLbl     = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpX);
00227   myXMinGridSpin       = new QSpinBox( aGridGrpX );
00228   myXMinGridSpin->setMinimum( 1 );
00229   myXMinGridSpin->setMaximum( 100 );
00230   myXMinGridSpin->setSingleStep( 1 );
00231   myXMinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00232   myXMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
00233 
00234   aGridLayoutX->addWidget( myXGridCheck,    0, 0 );
00235   aGridLayoutX->addWidget( aXMajLbl,        0, 1 );
00236   aGridLayoutX->addWidget( myXGridSpin,     0, 2 );
00237   aGridLayoutX->addWidget( myXMinGridCheck, 1, 0 );
00238   aGridLayoutX->addWidget( aXMinLbl,        1, 1 );
00239   aGridLayoutX->addWidget( myXMinGridSpin,  1, 2 );
00240   aXLayout->addWidget( aGridGrpX, 3, 0, 1, 4 );
00241 
00242   aTabWidget->addTab( aXWidget, tr( "INF_AXES_X" ) );
00243 
00244   // widget for parameters on Oy
00245   QWidget* aYWidget = new QWidget(aTabWidget);
00246   QGridLayout* aYLayout = new QGridLayout( aYWidget ); 
00247   aYLayout->setSpacing( SPACING_SIZE );
00248   aYLayout->setMargin( MARGIN_SIZE );
00249 
00250   // axis title
00251   myTitleYCheck = new QCheckBox( tr( "PLOT2D_ENABLE_VER_TITLE" ), aYWidget );
00252   myTitleYEdit  = new QLineEdit( aYWidget );
00253   myTitleYEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00254   myTitleYEdit->setMinimumWidth( MIN_EDIT_WIDTH );
00255   aYLayout->addWidget( myTitleYCheck,1,    0    );
00256   aYLayout->addWidget( myTitleYEdit, 1, 1, 1, 3 );
00257 
00258   // grid
00259   QGroupBox* aGridGrpY = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aYWidget );
00260   QGridLayout* aGridLayoutY = new QGridLayout( aGridGrpY );
00261   aGridGrpY->setLayout( aGridLayoutY );
00262   aGridLayoutY->setMargin( MARGIN_SIZE ); aGridLayoutY->setSpacing( SPACING_SIZE );
00263 
00264   myYGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MAJOR" ), aGridGrpY );
00265 
00266   QLabel* aYMajLbl  = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY);
00267   myYGridSpin       = new QSpinBox( aGridGrpY );
00268   myYGridSpin->setMinimum( 1 );
00269   myYGridSpin->setMaximum( 100 );
00270   myYGridSpin->setSingleStep( 1 );
00271   myYGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00272   myYGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
00273 
00274   myYMinGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MINOR" ), aGridGrpY );
00275 
00276   QLabel* aYMinLbl     = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY);
00277   myYMinGridSpin       = new QSpinBox( aGridGrpY );
00278   myYMinGridSpin->setMinimum( 1 );
00279   myYMinGridSpin->setMaximum( 100 );
00280   myYMinGridSpin->setSingleStep( 1 );
00281   myYMinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00282   myYMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
00283 
00284   aGridLayoutY->addWidget( myYGridCheck,    0, 0 );
00285   aGridLayoutY->addWidget( aYMajLbl,       0, 1 );
00286   aGridLayoutY->addWidget( myYGridSpin,     0, 2 );
00287   aGridLayoutY->addWidget( myYMinGridCheck, 1, 0 );
00288   aGridLayoutY->addWidget( aYMinLbl,        1, 1 );
00289   aGridLayoutY->addWidget( myYMinGridSpin,  1, 2 );
00290   aYLayout->addWidget( aGridGrpY, 3, 0, 1, 4 );
00291 
00292   aTabWidget->addTab( aYWidget, tr( "INF_AXES_Y_LEFT" ) );
00293 
00294   // if exist second axis Oy, addition new tab widget for right axis
00295   if ( mySecondAxisY ) {
00296     // widget for parameters on Oy
00297     QWidget* aYWidget2 = new QWidget( aTabWidget );
00298     QGridLayout* aYLayout2 = new QGridLayout( aYWidget2 );
00299     aYLayout2->setSpacing( SPACING_SIZE );
00300     aYLayout2->setMargin( MARGIN_SIZE );
00301 
00302     // axis title
00303     myTitleY2Check = new QCheckBox( tr( "PLOT2D_ENABLE_VER_TITLE" ), aYWidget2 );
00304     myTitleY2Edit  = new QLineEdit( aYWidget2 );
00305     myTitleY2Edit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00306     myTitleY2Edit->setMinimumWidth( MIN_EDIT_WIDTH );
00307     aYLayout2->addWidget( myTitleY2Check,1,    0    );
00308     aYLayout2->addWidget( myTitleY2Edit, 1, 1, 1, 3 );
00309 
00310     // grid
00311     QGroupBox* aGridGrpY2 = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aYWidget2 );
00312     QGridLayout* aGridLayoutY2 = new QGridLayout( aGridGrpY2 );
00313     aGridGrpY2->setLayout( aGridLayoutY2 );
00314     aGridLayoutY2->setMargin( MARGIN_SIZE ); aGridLayoutY2->setSpacing( SPACING_SIZE );
00315 
00316     myY2GridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MAJOR" ), aGridGrpY2 );
00317 
00318     QLabel* aY2MajLbl  = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY2);
00319     myY2GridSpin       = new QSpinBox( aGridGrpY2 );
00320     myY2GridSpin->setMinimum( 1 );
00321     myY2GridSpin->setMaximum( 100 );
00322     myY2GridSpin->setSingleStep( 1 );
00323     myY2GridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00324     myY2GridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
00325 
00326     myY2MinGridCheck      = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MINOR" ), aGridGrpY2 );
00327 
00328     QLabel* aY2MinLbl     = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY2);
00329     myY2MinGridSpin       = new QSpinBox( aGridGrpY2 );
00330     myY2MinGridSpin->setMinimum( 1 );
00331     myY2MinGridSpin->setMaximum( 100 );
00332     myY2MinGridSpin->setSingleStep( 1 );
00333     myY2MinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
00334     myY2MinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
00335 
00336     aGridLayoutY2->addWidget( myY2GridCheck,    0, 0 );
00337     aGridLayoutY2->addWidget( aY2MajLbl,        0, 1 );
00338     aGridLayoutY2->addWidget( myY2GridSpin,     0, 2 );
00339     aGridLayoutY2->addWidget( myY2MinGridCheck, 1, 0 );
00340     aGridLayoutY2->addWidget( aY2MinLbl,        1, 1 );
00341     aGridLayoutY2->addWidget( myY2MinGridSpin,  1, 2 );
00342     aYLayout2->addWidget( aGridGrpY2, 3, 0, 1, 4 );
00343 
00344     aTabWidget->addTab( aYWidget2, tr( "INF_AXES_Y_RIGHT" ) );
00345   }
00346   else {
00347     myTitleY2Check   = 0;
00348     myTitleY2Edit    = 0;
00349     myY2GridCheck    = 0;
00350     myY2GridSpin     = 0;
00351     myY2MinGridCheck = 0;
00352     myY2MinGridSpin  = 0;
00353     myY2ModeCombo    = 0;
00354   }
00355 
00356   aTabWidget->setCurrentIndex( 0 );
00357   /* "Set as default" check box */
00358 
00359   myDefCheck = new QCheckBox( tr( "PLOT2D_SET_AS_DEFAULT_CHECK" ), this );
00360 
00361   /* OK/Cancel buttons */
00362   myOkBtn = new QPushButton( tr( "BUT_OK" ), this );
00363   myOkBtn->setAutoDefault( TRUE );
00364   myOkBtn->setDefault( TRUE );
00365   myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this );
00366   myCancelBtn->setAutoDefault( TRUE );
00367   myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this );
00368   myHelpBtn->setAutoDefault( TRUE );
00369   QHBoxLayout* btnLayout = new QHBoxLayout;
00370   btnLayout->addWidget( myOkBtn );
00371   btnLayout->addStretch();
00372   btnLayout->addWidget( myCancelBtn );
00373   btnLayout->addWidget( myHelpBtn );
00374   
00375   // layout widgets
00376   topLayout->addWidget( myTitleCheck,  0,    0    );
00377   topLayout->addWidget( myTitleEdit,   0, 1, 1, 3 );
00378   topLayout->addWidget( myLegendCheck, 1,    0    );
00379   topLayout->addWidget( myLegendCombo, 1,    1    );
00380   topLayout->addWidget( aCurveLab,  1,    2    );
00381   topLayout->addWidget( myCurveCombo,  1,     3    );
00382   topLayout->addWidget( aLegendFontLab,2,    0    );
00383   topLayout->addWidget( myLegendFont,     2,    1    );
00384   topLayout->addWidget( myLegendColor,  2,    2    );
00385 
00386   topLayout->addWidget( aMarkerLab,    3,    0    );
00387   topLayout->addWidget( myMarkerSpin,  3,    1    );
00388   QHBoxLayout* bgLayout = new QHBoxLayout;
00389   bgLayout->addWidget( myBackgroundBtn ); bgLayout->addStretch();
00390   topLayout->addWidget( aBGLab,        3,    2    );
00391   topLayout->addLayout( bgLayout,      3,    3    );
00392   topLayout->addWidget( aDeviationGrp,   4, 0, 1, 4 );
00393   topLayout->addWidget( aNormalizeGrp,      5, 0, 1, 4 );
00394   topLayout->addWidget( aScaleGrp,     6, 0, 1, 4 );
00395   topLayout->addWidget( aTabWidget,    7, 0, 1, 4 );
00396   topLayout->addWidget( myDefCheck,    8, 0, 1, 4 );
00397   topLayout->setRowStretch( 9, 5 );
00398 
00399   topLayout->addLayout( btnLayout,     10, 0, 1, 4 );
00400   
00401   if ( !showDefCheck )
00402     myDefCheck->hide();
00403 
00404   connect( myTitleCheck,    SIGNAL( clicked() ), this, SLOT( onMainTitleChecked() ) );
00405   connect( myTitleXCheck,   SIGNAL( clicked() ), this, SLOT( onXTitleChecked() ) );
00406   connect( myTitleYCheck,   SIGNAL( clicked() ), this, SLOT( onYTitleChecked() ) );
00407   connect( myLegendCheck,   SIGNAL( clicked() ), this, SLOT( onLegendChecked() ) );
00408   connect( myXGridCheck,    SIGNAL( clicked() ), this, SLOT( onXGridMajorChecked() ) );
00409   connect( myYGridCheck,    SIGNAL( clicked() ), this, SLOT( onYGridMajorChecked() ) );
00410   connect( myXMinGridCheck, SIGNAL( clicked() ), this, SLOT( onXGridMinorChecked() ) );
00411   connect( myYMinGridCheck, SIGNAL( clicked() ), this, SLOT( onYGridMinorChecked() ) );
00412   connect( myNormLMaxCheck, SIGNAL( clicked() ), this, SLOT( onNormLMaxChecked() ) );
00413   connect( myNormLMinCheck, SIGNAL( clicked() ), this, SLOT( onNormLMinChecked() ) );
00414   connect( myNormRMaxCheck, SIGNAL( clicked() ), this, SLOT( onNormRMaxChecked() ) );
00415   connect( myNormRMinCheck, SIGNAL( clicked() ), this, SLOT( onNormRMinChecked() ) );
00416 
00417 
00418   connect( myOkBtn,         SIGNAL( clicked() ), this, SLOT( accept() ) );
00419   connect( myCancelBtn,     SIGNAL( clicked() ), this, SLOT( reject() ) );
00420   connect( myHelpBtn,       SIGNAL( clicked() ), this, SLOT( onHelp() ) );
00421   
00422   if ( mySecondAxisY ) {
00423     connect( myTitleY2Check,   SIGNAL( clicked() ), this, SLOT( onY2TitleChecked() ) );
00424     connect( myY2GridCheck,    SIGNAL( clicked() ), this, SLOT( onY2GridMajorChecked() ) );
00425     connect( myY2MinGridCheck, SIGNAL( clicked() ), this, SLOT( onY2GridMinorChecked() ) );
00426   }
00427 
00428   // init fields
00429   setBackgroundColor( Qt::gray );
00430   onMainTitleChecked();
00431   onXTitleChecked();
00432   onYTitleChecked();
00433   onLegendChecked();
00434   onXGridMajorChecked();
00435   onYGridMajorChecked();
00436   onXGridMinorChecked();
00437   onNormLMaxChecked();
00438   onNormLMinChecked();
00439   onNormRMaxChecked();
00440   onNormRMinChecked();
00441   if ( mySecondAxisY ) {
00442     onY2TitleChecked();
00443     onY2GridMajorChecked();
00444     onY2GridMinorChecked();
00445   }
00446 }
00447 
00451 Plot2d_SetupViewDlg::~Plot2d_SetupViewDlg()
00452 {
00453 }
00454 
00461 void Plot2d_SetupViewDlg::setMainTitle( bool enable, const QString& title )
00462 {
00463   myTitleCheck->setChecked( enable );
00464   if ( !title.isNull() )
00465     myTitleEdit->setText( title );
00466   onMainTitleChecked();
00467 }
00468 
00474 bool Plot2d_SetupViewDlg::isMainTitleEnabled()
00475 {
00476   return myTitleCheck->isChecked();
00477 }
00478 
00484 QString Plot2d_SetupViewDlg::getMainTitle()
00485 {
00486   return myTitleEdit->text();
00487 }
00488 
00495 void Plot2d_SetupViewDlg::setXTitle( bool enable, const QString& title )
00496 {
00497   myTitleXCheck->setChecked( enable );
00498   if ( !title.isNull() )
00499     myTitleXEdit->setText( title );
00500   onXTitleChecked();
00501 }
00502 
00508 bool Plot2d_SetupViewDlg::isXTitleEnabled()
00509 {
00510   return myTitleXCheck->isChecked();
00511 }
00512 
00518 QString Plot2d_SetupViewDlg::getXTitle()
00519 {
00520   return myTitleXEdit->text();
00521 }
00522 
00529 void Plot2d_SetupViewDlg::setYTitle( bool enable, const QString& title )
00530 {
00531   myTitleYCheck->setChecked( enable );
00532   if ( !title.isNull() )
00533     myTitleYEdit->setText( title );
00534   onYTitleChecked();
00535 }
00536 
00543 void Plot2d_SetupViewDlg::setY2Title( bool enable, const QString& title )
00544 {
00545   myTitleY2Check->setChecked( enable );
00546   if ( !title.isNull() )
00547     myTitleY2Edit->setText( title );
00548   onY2TitleChecked();
00549 }
00550 
00556 bool Plot2d_SetupViewDlg::isYTitleEnabled()
00557 {
00558   return myTitleYCheck->isChecked();
00559 }
00560 
00566 bool Plot2d_SetupViewDlg::isY2TitleEnabled()
00567 {
00568   return myTitleY2Check->isChecked();
00569 }
00570 
00576 QString Plot2d_SetupViewDlg::getYTitle()
00577 {
00578   return myTitleYEdit->text();
00579 }
00580 
00586 QString Plot2d_SetupViewDlg::getY2Title()
00587 {
00588   return myTitleY2Edit->text();
00589 }
00590 
00596 void Plot2d_SetupViewDlg::setCurveType( const int type )
00597 {
00598   myCurveCombo->setCurrentIndex( type );
00599 }
00600 
00606 int Plot2d_SetupViewDlg::getCurveType()
00607 {
00608   return myCurveCombo->currentIndex();
00609 }
00610 
00616 void Plot2d_SetupViewDlg::setLMaxNormMode( const bool type )
00617 {
00618   myNormLMaxCheck->setChecked( type );
00619 }
00620 
00626 bool Plot2d_SetupViewDlg::getLMaxNormMode()
00627 {
00628   return myNormLMaxCheck->isChecked();
00629 }
00630 
00636 void Plot2d_SetupViewDlg::setLMinNormMode( const bool type )
00637 {
00638   myNormLMinCheck->setChecked( type );
00639 }
00640 
00646 bool Plot2d_SetupViewDlg::getLMinNormMode()
00647 {
00648   return myNormLMinCheck->isChecked();
00649 }
00650 
00656 void Plot2d_SetupViewDlg::setRMaxNormMode( const bool type )
00657 {
00658   myNormRMaxCheck->setChecked( type );
00659 }
00660 
00666 bool Plot2d_SetupViewDlg::getRMaxNormMode()
00667 {
00668   return myNormRMaxCheck->isChecked();
00669 }
00670 
00676 void Plot2d_SetupViewDlg::setRMinNormMode( const bool type )
00677 {
00678   myNormRMinCheck->setChecked( type );
00679 }
00680 
00686 bool Plot2d_SetupViewDlg::getRMinNormMode()
00687 {
00688   return myNormRMinCheck->isChecked();
00689 }
00690 
00699 void Plot2d_SetupViewDlg::setLegend( bool enable, int pos, const QFont& fnt, const QColor& col )
00700 {
00701   myLegendCheck->setChecked( enable );
00702   myLegendCombo->setCurrentIndex( pos );
00703   myLegendFont->setCurrentFont( fnt );
00704   myLegendColor->setColor( col );
00705   onLegendChecked();
00706 }
00707 
00713 bool Plot2d_SetupViewDlg::isLegendEnabled()
00714 {
00715   return myLegendCheck->isChecked();
00716 }
00717 
00723 int Plot2d_SetupViewDlg::getLegendPos()
00724 {
00725   return myLegendCombo->currentIndex();
00726 }
00727 
00733 QFont Plot2d_SetupViewDlg::getLegendFont()
00734 {
00735   return myLegendFont->currentFont();
00736 }
00737 
00743 QColor Plot2d_SetupViewDlg::getLegendColor()
00744 {
00745   return myLegendColor->color();
00746 }
00747 
00753 void Plot2d_SetupViewDlg::setMarkerSize( const int size )
00754 {
00755   myMarkerSpin->setValue( size );
00756 }
00757 
00763 int Plot2d_SetupViewDlg::getMarkerSize()
00764 {
00765   return myMarkerSpin->value();
00766 }
00772 void Plot2d_SetupViewDlg::setDeviationMarkerLw( const int width ){
00773   myDeviationLw->setValue(width);
00774 }
00775 
00781 int Plot2d_SetupViewDlg::getDeviationMarkerLw() const {
00782   return myDeviationLw->value();
00783 }
00784 
00790 void Plot2d_SetupViewDlg::setDeviationMarkerTs( const int size) {
00791   myDeviationTs->setValue(size);
00792 }
00793 
00799 int Plot2d_SetupViewDlg::getDeviationMarkerTs() const {
00800   return myDeviationTs->value();
00801 }
00802 
00808 void Plot2d_SetupViewDlg::setDeviationMarkerCl( const QColor& col) {
00809   myDeviationCl->setColor( col );
00810 }
00811 
00817 QColor Plot2d_SetupViewDlg::getDeviationMarkerCl() const {
00818  return myDeviationCl->color();
00819 }
00820 
00826 void Plot2d_SetupViewDlg::setBackgroundColor( const QColor& color )
00827 {
00828   myBackgroundBtn->setColor( color );
00829 }
00830 
00836 QColor Plot2d_SetupViewDlg::getBackgroundColor()
00837 {
00838   return myBackgroundBtn->color();
00839 }
00840 
00851 void Plot2d_SetupViewDlg::setMajorGrid( bool enableX, const int divX,
00852                                         bool enableY, const int divY,
00853                                         bool enableY2, const int divY2 )
00854 {
00855   myXGridCheck->setChecked( enableX );
00856   myXGridSpin->setValue( divX );
00857   myYGridCheck->setChecked( enableY );
00858   myYGridSpin->setValue( divY );
00859   onXGridMajorChecked();
00860   onYGridMajorChecked();
00861   if (mySecondAxisY) {
00862     myY2GridCheck->setChecked( enableY2 );
00863     myY2GridSpin->setValue( divY2 );
00864     onY2GridMajorChecked();
00865   }
00866 }
00867 
00878 void Plot2d_SetupViewDlg::getMajorGrid( bool& enableX, int& divX,
00879                                         bool& enableY, int& divY,
00880                                         bool& enableY2, int& divY2 )
00881 {
00882   enableX  = myXGridCheck->isChecked();
00883   divX     = myXGridSpin->value();
00884   enableY  = myYGridCheck->isChecked();
00885   divY     = myYGridSpin->value();
00886   if (mySecondAxisY) {
00887     enableY2 = myY2GridCheck->isChecked();
00888     divY2    = myY2GridSpin->value();
00889   }
00890   else {
00891     enableY2 = false;
00892     divY2    = 1;
00893   }
00894 }
00895 
00906 void Plot2d_SetupViewDlg::setMinorGrid( bool enableX, const int divX,
00907                                         bool enableY, const int divY,
00908                                         bool enableY2, const int divY2 )
00909 {
00910   myXMinGridCheck->setChecked( enableX );
00911   myXMinGridSpin->setValue( divX );
00912   myYMinGridCheck->setChecked( enableY );
00913   myYMinGridSpin->setValue( divY );
00914   onXGridMinorChecked();
00915   onYGridMinorChecked();
00916   if (mySecondAxisY) {
00917     myY2MinGridCheck->setChecked( enableY2 );
00918     myY2MinGridSpin->setValue( divY2 );
00919     onY2GridMinorChecked();
00920   }
00921 }
00922 
00933 void Plot2d_SetupViewDlg::getMinorGrid( bool& enableX, int& divX,
00934                                         bool& enableY, int& divY,
00935                                         bool& enableY2, int& divY2 )
00936 {
00937   enableX  = myXMinGridCheck->isChecked();
00938   divX     = myXMinGridSpin->value();
00939   enableY  = myYMinGridCheck->isChecked();
00940   divY     = myYMinGridSpin->value();
00941   if ( mySecondAxisY ) {
00942     enableY2 = myY2MinGridCheck->isChecked();
00943     divY2    = myY2MinGridSpin->value();
00944   }
00945   else {
00946     enableY2 = false;
00947     divY2    = 1;
00948   }
00949 }
00950 
00957 void Plot2d_SetupViewDlg::setScaleMode( const int xMode, const int yMode )
00958 {
00959   myXModeCombo->setCurrentIndex( xMode );
00960   myYModeCombo->setCurrentIndex( yMode );
00961 }
00962 
00968 int Plot2d_SetupViewDlg::getXScaleMode()
00969 {
00970   return myXModeCombo->currentIndex();
00971 }
00972 
00978 int  Plot2d_SetupViewDlg::getYScaleMode()
00979 {
00980   return myYModeCombo->currentIndex();
00981 }
00982 
00986 void Plot2d_SetupViewDlg::onMainTitleChecked()
00987 {
00988   myTitleEdit->setEnabled( myTitleCheck->isChecked() );
00989 }
00990 
00994 void Plot2d_SetupViewDlg::onXTitleChecked()
00995 {
00996   myTitleXEdit->setEnabled( myTitleXCheck->isChecked() );
00997 }
00998 
01002 void Plot2d_SetupViewDlg::onYTitleChecked()
01003 {
01004   myTitleYEdit->setEnabled( myTitleYCheck->isChecked() );
01005 }
01006 
01010 void Plot2d_SetupViewDlg::onY2TitleChecked()
01011 {
01012   myTitleY2Edit->setEnabled( myTitleY2Check->isChecked() );
01013 }
01014 
01018 void Plot2d_SetupViewDlg::onLegendChecked()
01019 {
01020   myLegendCombo->setEnabled( myLegendCheck->isChecked() );
01021 }
01022 
01026 void Plot2d_SetupViewDlg::onXGridMajorChecked()
01027 {
01028   myXMinGridCheck->setEnabled( myXGridCheck->isChecked() );
01029 }
01030 
01034 void Plot2d_SetupViewDlg::onYGridMajorChecked()
01035 {
01036   myYMinGridCheck->setEnabled( myYGridCheck->isChecked() );
01037 }
01038 
01042 void Plot2d_SetupViewDlg::onY2GridMajorChecked()
01043 {
01044   myY2MinGridCheck->setEnabled( myY2GridCheck->isChecked() );
01045 }
01046 
01050 void Plot2d_SetupViewDlg::onXGridMinorChecked()
01051 {
01052 }
01053 
01057 void Plot2d_SetupViewDlg::onYGridMinorChecked()
01058 {
01059 }
01060 
01064 void Plot2d_SetupViewDlg::onY2GridMinorChecked()
01065 {
01066 }
01067 
01071 void Plot2d_SetupViewDlg::onNormLMaxChecked()
01072 {
01073 }
01074 
01078 void Plot2d_SetupViewDlg::onNormLMinChecked()
01079 {
01080 }
01081 
01085 void Plot2d_SetupViewDlg::onNormRMaxChecked()
01086 {
01087 }
01088 
01092 void Plot2d_SetupViewDlg::onNormRMinChecked()
01093 {
01094 }
01095 
01100 bool Plot2d_SetupViewDlg::isSetAsDefault()
01101 {
01102   return myDefCheck->isChecked();
01103 }
01104 
01108 void Plot2d_SetupViewDlg::onHelp()
01109 {
01110   SUIT_Application* app = SUIT_Session::session()->activeApplication();
01111   if ( app )
01112     app->onHelpContextModule( "GUI", "plot2d_viewer_page.html", "settings" );
01113 }