1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : Plot2d_SetupViewDlg.cxx
6 // Author : Vadim SANDLER
10 #include "Plot2d_SetupViewDlg.h"
12 #include <qcheckbox.h>
13 #include <qlineedit.h>
14 #include <qcombobox.h>
16 #include <qtoolbutton.h>
18 #include <qgroupbox.h>
20 #include <qpushbutton.h>
21 #include <qcolordialog.h>
22 #include <qtabwidget.h>
24 #define MARGIN_SIZE 11
25 #define SPACING_SIZE 6
26 #define MIN_EDIT_WIDTH 200
27 #define MIN_COMBO_WIDTH 100
28 #define MIN_SPIN_WIDTH 70
33 Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent, bool showDefCheck, bool secondAxisY )
34 : QDialog( parent, "Plot2d_SetupViewDlg", true,
35 WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
37 mySecondAxisY = secondAxisY;
38 setCaption( tr("TLT_SETUP_PLOT2D_VIEW") );
39 setSizeGripEnabled( TRUE );
40 QGridLayout* topLayout = new QGridLayout( this );
41 topLayout->setSpacing( SPACING_SIZE );
42 topLayout->setMargin( MARGIN_SIZE );
45 myTitleCheck = new QCheckBox( tr( "PLOT2D_ENABLE_MAIN_TITLE" ), this );
46 myTitleEdit = new QLineEdit( this );
47 myTitleEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
48 myTitleEdit->setMinimumWidth( MIN_EDIT_WIDTH );
49 // curve type : points, lines, spline
50 QLabel* aCurveLab = new QLabel( tr( "PLOT2D_CURVE_TYPE_LBL" ), this );
51 myCurveCombo = new QComboBox( false, this );
52 myCurveCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
53 myCurveCombo->setMinimumWidth( MIN_COMBO_WIDTH );
54 myCurveCombo->insertItem( tr( "PLOT2D_CURVE_TYPE_POINTS" ) );
55 myCurveCombo->insertItem( tr( "PLOT2D_CURVE_TYPE_LINES" ) );
56 myCurveCombo->insertItem( tr( "PLOT2D_CURVE_TYPE_SPLINE" ) );
58 myLegendCheck = new QCheckBox( tr( "PLOT2D_ENABLE_LEGEND" ), this );
59 myLegendCombo = new QComboBox( false, this );
60 myLegendCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
61 myLegendCombo->setMinimumWidth( MIN_COMBO_WIDTH );
62 myLegendCombo->insertItem( tr( "PLOT2D_LEGEND_POSITION_LEFT" ) );
63 myLegendCombo->insertItem( tr( "PLOT2D_LEGEND_POSITION_RIGHT" ) );
64 myLegendCombo->insertItem( tr( "PLOT2D_LEGEND_POSITION_TOP" ) );
65 myLegendCombo->insertItem( tr( "PLOT2D_LEGEND_POSITION_BOTTOM" ) );
67 QLabel* aMarkerLab = new QLabel( tr( "PLOT2D_MARKER_SIZE_LBL" ), this );
68 myMarkerSpin = new QSpinBox( 0, 100, 1, this );
69 myMarkerSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
70 myMarkerSpin->setMinimumWidth( MIN_SPIN_WIDTH );
73 QLabel* aBGLab = new QLabel( tr( "PLOT2D_BACKGROUND_COLOR_LBL" ), this );
74 myBackgroundBtn = new QToolButton( this );
75 myBackgroundBtn->setMinimumWidth(20);
78 QGroupBox* aScaleGrp = new QGroupBox( tr( "PLOT2D_SCALE_TLT" ), this );
79 aScaleGrp->setColumnLayout(0, Qt::Vertical );
80 aScaleGrp->layout()->setSpacing( 0 ); aScaleGrp->layout()->setMargin( 0 );
81 QGridLayout* aScaleLayout = new QGridLayout( aScaleGrp->layout() );
82 aScaleLayout->setMargin( MARGIN_SIZE ); aScaleLayout->setSpacing( SPACING_SIZE );
84 QLabel* xScaleLab = new QLabel( tr( "PLOT2D_SCALE_MODE_HOR" ), aScaleGrp );
85 myXModeCombo = new QComboBox( false, aScaleGrp );
86 myXModeCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
87 myXModeCombo->setMinimumWidth( MIN_COMBO_WIDTH );
88 myXModeCombo->insertItem( tr( "PLOT2D_SCALE_MODE_LINEAR" ) );
89 myXModeCombo->insertItem( tr( "PLOT2D_SCALE_MODE_LOGARITHMIC" ) );
90 QLabel* yScaleLab = new QLabel( tr( "PLOT2D_SCALE_MODE_VER" ), aScaleGrp );
91 myYModeCombo = new QComboBox( false, aScaleGrp );
92 myYModeCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
93 myYModeCombo->setMinimumWidth( MIN_COMBO_WIDTH );
94 myYModeCombo->insertItem( tr( "PLOT2D_SCALE_MODE_LINEAR" ) );
95 myYModeCombo->insertItem( tr( "PLOT2D_SCALE_MODE_LOGARITHMIC" ) );
97 aScaleLayout->addWidget( xScaleLab, 0, 0 );
98 aScaleLayout->addWidget( myXModeCombo, 0, 1 );
99 aScaleLayout->addWidget( yScaleLab, 0, 2 );
100 aScaleLayout->addWidget( myYModeCombo, 0, 3 );
102 // tab widget for choose properties of axis
103 QTabWidget* aTabWidget = new QTabWidget( this, "tabWidget" );
105 // widget for parameters on Ox
106 QWidget* aXWidget = new QWidget(aTabWidget);
107 QGridLayout* aXLayout = new QGridLayout( aXWidget );
108 aXLayout->setSpacing( SPACING_SIZE );
109 aXLayout->setMargin( MARGIN_SIZE );
111 myTitleXCheck = new QCheckBox( tr( "PLOT2D_ENABLE_HOR_TITLE" ), aXWidget );
112 myTitleXEdit = new QLineEdit( aXWidget );
113 myTitleXEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
114 myTitleXEdit->setMinimumWidth( MIN_EDIT_WIDTH );
115 aXLayout->addWidget( myTitleXCheck, 1, 0 );
116 aXLayout->addMultiCellWidget( myTitleXEdit, 1, 1, 1, 3 );
118 QGroupBox* aGridGrpX = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aXWidget );
119 aGridGrpX->setColumnLayout(0, Qt::Vertical );
120 aGridGrpX->layout()->setSpacing( 0 ); aGridGrpX->layout()->setMargin( 0 );
121 QGridLayout* aGridLayoutX = new QGridLayout( aGridGrpX->layout() );
122 aGridLayoutX->setMargin( MARGIN_SIZE ); aGridLayoutX->setSpacing( SPACING_SIZE );
123 myXGridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_HOR_MAJOR" ), aGridGrpX );
124 myXGridSpin = new QSpinBox( 1, 100, 1, aGridGrpX );
125 myXGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
126 myXGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
127 myXMinGridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_HOR_MINOR" ), aGridGrpX );
128 myXMinGridSpin = new QSpinBox( 1, 100, 1, aGridGrpX );
129 myXMinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
130 myXMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
132 aGridLayoutX->addWidget( myXGridCheck, 0, 0 );
133 aGridLayoutX->addWidget( myXGridSpin, 0, 1 );
134 aGridLayoutX->addWidget( myXMinGridCheck, 1, 0 );
135 aGridLayoutX->addWidget( myXMinGridSpin, 1, 1 );
136 aXLayout->addMultiCellWidget( aGridGrpX, 3, 3, 0, 3 );
138 aTabWidget->addTab( aXWidget, tr( "INF_AXES_X" ) );
140 // widget for parameters on Oy
141 QWidget* aYWidget = new QWidget(aTabWidget);
142 QGridLayout* aYLayout = new QGridLayout( aYWidget );
143 aYLayout->setSpacing( SPACING_SIZE );
144 aYLayout->setMargin( MARGIN_SIZE );
146 myTitleYCheck = new QCheckBox( tr( "PLOT2D_ENABLE_VER_TITLE" ), aYWidget );
147 myTitleYEdit = new QLineEdit( aYWidget );
148 myTitleYEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
149 myTitleYEdit->setMinimumWidth( MIN_EDIT_WIDTH );
150 aYLayout->addWidget( myTitleYCheck, 1, 0 );
151 aYLayout->addMultiCellWidget( myTitleYEdit, 1, 1, 1, 3 );
153 QGroupBox* aGridGrpY = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aYWidget );
154 aGridGrpY->setColumnLayout(0, Qt::Vertical );
155 aGridGrpY->layout()->setSpacing( 0 ); aGridGrpY->layout()->setMargin( 0 );
156 QGridLayout* aGridLayoutY = new QGridLayout( aGridGrpY->layout() );
157 aGridLayoutY->setMargin( MARGIN_SIZE ); aGridLayoutY->setSpacing( SPACING_SIZE );
158 myYGridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MAJOR" ), aGridGrpY );
159 myYGridSpin = new QSpinBox( 1, 100, 1, aGridGrpY );
160 myYGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
161 myYGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
162 myYMinGridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MINOR" ), aGridGrpY );
163 myYMinGridSpin = new QSpinBox( 1, 100, 1, aGridGrpY );
164 myYMinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
165 myYMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
167 aGridLayoutY->addWidget( myYGridCheck, 0, 0 );
168 aGridLayoutY->addWidget( myYGridSpin, 0, 1 );
169 aGridLayoutY->addWidget( myYMinGridCheck, 1, 0 );
170 aGridLayoutY->addWidget( myYMinGridSpin, 1, 1 );
171 aYLayout->addMultiCellWidget( aGridGrpY, 3, 3, 0, 3 );
173 aTabWidget->addTab( aYWidget, tr( "INF_AXES_Y_LEFT" ) );
175 // if exist second axis Oy, addition new tab widget for right axis
177 // widget for parameters on Oy
178 QWidget* aYWidget2 = new QWidget(aTabWidget);
179 QGridLayout* aYLayout2 = new QGridLayout( aYWidget2 );
180 aYLayout2->setSpacing( SPACING_SIZE );
181 aYLayout2->setMargin( MARGIN_SIZE );
183 myTitleY2Check = new QCheckBox( tr( "PLOT2D_ENABLE_VER_TITLE" ), aYWidget2 );
184 myTitleY2Edit = new QLineEdit( aYWidget2 );
185 myTitleY2Edit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
186 myTitleY2Edit->setMinimumWidth( MIN_EDIT_WIDTH );
187 aYLayout2->addWidget( myTitleY2Check, 1, 0 );
188 aYLayout2->addMultiCellWidget( myTitleY2Edit, 1, 1, 1, 3 );
190 QGroupBox* aGridGrpY2 = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aYWidget2 );
191 aGridGrpY2->setColumnLayout(0, Qt::Vertical );
192 aGridGrpY2->layout()->setSpacing( 0 ); aGridGrpY2->layout()->setMargin( 0 );
193 QGridLayout* aGridLayoutY2 = new QGridLayout( aGridGrpY2->layout() );
194 aGridLayoutY2->setMargin( MARGIN_SIZE ); aGridLayoutY2->setSpacing( SPACING_SIZE );
195 myY2GridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MAJOR" ), aGridGrpY2 );
196 myY2GridSpin = new QSpinBox( 1, 100, 1, aGridGrpY2 );
197 myY2GridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
198 myY2GridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
199 myY2MinGridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MINOR" ), aGridGrpY2 );
200 myY2MinGridSpin = new QSpinBox( 1, 100, 1, aGridGrpY2 );
201 myY2MinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
202 myY2MinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
204 aGridLayoutY2->addWidget( myY2GridCheck, 0, 0 );
205 aGridLayoutY2->addWidget( myY2GridSpin, 0, 1 );
206 aGridLayoutY2->addWidget( myY2MinGridCheck, 1, 0 );
207 aGridLayoutY2->addWidget( myY2MinGridSpin, 1, 1 );
208 aYLayout2->addMultiCellWidget( aGridGrpY2, 3, 3, 0, 3 );
210 aTabWidget->addTab( aYWidget2, tr( "INF_AXES_Y_RIGHT" ) );
217 myY2MinGridCheck = 0;
221 aTabWidget->setCurrentPage( 0 );
222 /* "Set as default" check box */
223 myDefCheck = new QCheckBox( tr( "PLOT2D_SET_AS_DEFAULT_CHECK" ), this );
224 /* OK/Cancel buttons */
225 myOkBtn = new QPushButton( tr( "BUT_OK" ), this );
226 myOkBtn->setAutoDefault( TRUE );
227 myOkBtn->setDefault( TRUE );
228 myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this );
229 myCancelBtn->setAutoDefault( TRUE );
230 QHBoxLayout* btnLayout = new QHBoxLayout;
231 btnLayout->addWidget( myOkBtn );
232 btnLayout->addStretch();
233 btnLayout->addWidget( myCancelBtn );
236 topLayout->addWidget( myTitleCheck, 0, 0 );
237 topLayout->addMultiCellWidget( myTitleEdit, 0, 0, 1, 3 );
238 topLayout->addWidget( aCurveLab, 1, 0 );
239 topLayout->addWidget( myCurveCombo, 1, 1 );
240 topLayout->addWidget( myLegendCheck, 1, 2 );
241 topLayout->addWidget( myLegendCombo, 1, 3 );
242 topLayout->addWidget( aMarkerLab, 2, 0 );
243 topLayout->addWidget( myMarkerSpin, 2, 1 );
244 QHBoxLayout* bgLayout = new QHBoxLayout;
245 bgLayout->addWidget( myBackgroundBtn ); bgLayout->addStretch();
246 topLayout->addWidget( aBGLab, 2, 2 );
247 topLayout->addLayout( bgLayout, 2, 3 );
248 topLayout->addMultiCellWidget( aScaleGrp, 3, 3, 0, 3 );
249 topLayout->addMultiCellWidget( aTabWidget, 4, 4, 0, 3 );
250 topLayout->addMultiCellWidget( myDefCheck, 5, 5, 0, 3 );
251 topLayout->setRowStretch( 5, 5 );
253 topLayout->addMultiCellLayout( btnLayout, 6, 6, 0, 3 );
258 connect( myTitleCheck, SIGNAL( clicked() ), this, SLOT( onMainTitleChecked() ) );
259 connect( myTitleXCheck, SIGNAL( clicked() ), this, SLOT( onXTitleChecked() ) );
260 connect( myTitleYCheck, SIGNAL( clicked() ), this, SLOT( onYTitleChecked() ) );
261 connect( myBackgroundBtn, SIGNAL( clicked() ), this, SLOT( onBackgroundClicked() ) );
262 connect( myLegendCheck, SIGNAL( clicked() ), this, SLOT( onLegendChecked() ) );
263 connect( myXGridCheck, SIGNAL( clicked() ), this, SLOT( onXGridMajorChecked() ) );
264 connect( myYGridCheck, SIGNAL( clicked() ), this, SLOT( onYGridMajorChecked() ) );
265 connect( myXMinGridCheck, SIGNAL( clicked() ), this, SLOT( onXGridMinorChecked() ) );
266 connect( myYMinGridCheck, SIGNAL( clicked() ), this, SLOT( onYGridMinorChecked() ) );
268 connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
269 connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
272 connect( myTitleY2Check, SIGNAL( clicked() ), this, SLOT( onY2TitleChecked() ) );
273 connect( myY2GridCheck, SIGNAL( clicked() ), this, SLOT( onY2GridMajorChecked() ) );
274 connect( myY2MinGridCheck, SIGNAL( clicked() ), this, SLOT( onY2GridMinorChecked() ) );
278 setBackgroundColor( Qt::gray );
279 onMainTitleChecked();
283 onXGridMajorChecked();
284 onYGridMajorChecked();
285 onXGridMinorChecked();
288 onY2GridMajorChecked();
289 onY2GridMinorChecked();
296 Plot2d_SetupViewDlg::~Plot2d_SetupViewDlg()
300 Sets main title attributes
302 void Plot2d_SetupViewDlg::setMainTitle( bool enable, const QString& title )
304 myTitleCheck->setChecked( enable );
305 if ( !title.isNull() )
306 myTitleEdit->setText( title );
307 onMainTitleChecked();
310 Returns TRUE if main title is enabled
312 bool Plot2d_SetupViewDlg::isMainTitleEnabled()
314 return myTitleCheck->isChecked();
319 QString Plot2d_SetupViewDlg::getMainTitle()
321 return myTitleEdit->text();
324 Sets horizontal axis title attributes
326 void Plot2d_SetupViewDlg::setXTitle( bool enable, const QString& title )
328 myTitleXCheck->setChecked( enable );
329 if ( !title.isNull() )
330 myTitleXEdit->setText( title );
334 Returns TRUE if horizontal axis title is enabled
336 bool Plot2d_SetupViewDlg::isXTitleEnabled()
338 return myTitleXCheck->isChecked();
341 Gets horizontal axis title
343 QString Plot2d_SetupViewDlg::getXTitle()
345 return myTitleXEdit->text();
348 Sets vertical left axis title attributes
350 void Plot2d_SetupViewDlg::setYTitle( bool enable, const QString& title )
352 myTitleYCheck->setChecked( enable );
353 if ( !title.isNull() )
354 myTitleYEdit->setText( title );
358 Sets vertical right axis title attributes
360 void Plot2d_SetupViewDlg::setY2Title( bool enable, const QString& title )
362 myTitleY2Check->setChecked( enable );
363 if ( !title.isNull() )
364 myTitleY2Edit->setText( title );
368 Returns TRUE if vertical left axis title is enabled
370 bool Plot2d_SetupViewDlg::isYTitleEnabled()
372 return myTitleYCheck->isChecked();
375 Returns TRUE if vertical right axis title is enabled
377 bool Plot2d_SetupViewDlg::isY2TitleEnabled()
379 return myTitleY2Check->isChecked();
382 Gets vertical left axis title
384 QString Plot2d_SetupViewDlg::getYTitle()
386 return myTitleYEdit->text();
389 Gets vertical right axis title
391 QString Plot2d_SetupViewDlg::getY2Title()
393 return myTitleY2Edit->text();
396 Sets curve type : 0 - points, 1 - lines, 2 - splines
398 void Plot2d_SetupViewDlg::setCurveType( const int type )
400 myCurveCombo->setCurrentItem( type );
403 Gets curve type : 0 - points, 1 - lines, 2 - splines
405 int Plot2d_SetupViewDlg::getCurveType()
407 return myCurveCombo->currentItem();
410 Sets legend attributes : pos = 0 - left, 1 - right, 2 - top, 3 - bottom
412 void Plot2d_SetupViewDlg::setLegend( bool enable, int pos )
414 myLegendCheck->setChecked( enable );
415 myLegendCombo->setCurrentItem( pos );
419 Returns TRUE if legend is enabled
421 bool Plot2d_SetupViewDlg::isLegendEnabled()
423 return myLegendCheck->isChecked();
426 Returns legend position
428 int Plot2d_SetupViewDlg::getLegendPos()
430 return myLegendCombo->currentItem();
435 void Plot2d_SetupViewDlg::setMarkerSize( const int size )
437 myMarkerSpin->setValue( size );
442 int Plot2d_SetupViewDlg::getMarkerSize()
444 return myMarkerSpin->value();
447 Sets background color
449 void Plot2d_SetupViewDlg::setBackgroundColor( const QColor& color )
451 QPalette pal = myBackgroundBtn->palette();
452 QColorGroup ca = pal.active();
453 ca.setColor( QColorGroup::Button, color );
454 QColorGroup ci = pal.inactive();
455 ci.setColor( QColorGroup::Button, color );
457 pal.setInactive( ci );
458 myBackgroundBtn->setPalette( pal );
461 Gets background color
463 QColor Plot2d_SetupViewDlg::getBackgroundColor()
465 return myBackgroundBtn->palette().active().button();
468 Sets major grid parameters
470 void Plot2d_SetupViewDlg::setMajorGrid( bool enableX, const int divX,
471 bool enableY, const int divY,
472 bool enableY2, const int divY2 )
474 myXGridCheck->setChecked( enableX );
475 myXGridSpin->setValue( divX );
476 myYGridCheck->setChecked( enableY );
477 myYGridSpin->setValue( divY );
478 onXGridMajorChecked();
479 onYGridMajorChecked();
481 myY2GridCheck->setChecked( enableY2 );
482 myY2GridSpin->setValue( divY2 );
483 onY2GridMajorChecked();
487 Gets major grid parameters
489 void Plot2d_SetupViewDlg::getMajorGrid( bool& enableX, int& divX,
490 bool& enableY, int& divY,
491 bool& enableY2, int& divY2)
493 enableX = myXGridCheck->isChecked();
494 divX = myXGridSpin->value();
495 enableY = myYGridCheck->isChecked();
496 divY = myYGridSpin->value();
498 enableY2 = myY2GridCheck->isChecked();
499 divY2 = myY2GridSpin->value();
507 Sets minor grid parameters
509 void Plot2d_SetupViewDlg::setMinorGrid( bool enableX, const int divX,
510 bool enableY, const int divY,
511 bool enableY2, const int divY2)
513 myXMinGridCheck->setChecked( enableX );
514 myXMinGridSpin->setValue( divX );
515 myYMinGridCheck->setChecked( enableY );
516 myYMinGridSpin->setValue( divY );
517 onXGridMinorChecked();
518 onYGridMinorChecked();
520 myY2MinGridCheck->setChecked( enableY2 );
521 myY2MinGridSpin->setValue( divY2 );
522 onY2GridMinorChecked();
526 Gets minor grid parameters
528 void Plot2d_SetupViewDlg::getMinorGrid( bool& enableX, int& divX,
529 bool& enableY, int& divY,
530 bool& enableY2, int& divY2)
532 enableX = myXMinGridCheck->isChecked();
533 divX = myXMinGridSpin->value();
534 enableY = myYMinGridCheck->isChecked();
535 divY = myYMinGridSpin->value();
537 enableY2 = myY2MinGridCheck->isChecked();
538 divY2 = myY2MinGridSpin->value();
546 Sets scale mode for hor. and ver. axes : 0 - linear, 1 - logarithmic
548 void Plot2d_SetupViewDlg::setScaleMode( const int xMode, const int yMode )
550 myXModeCombo->setCurrentItem( xMode );
551 myYModeCombo->setCurrentItem( yMode );
554 Gets scale mode for hor. axis : 0 - linear, 1 - logarithmic
556 int Plot2d_SetupViewDlg::getXScaleMode()
558 return myXModeCombo->currentItem();
561 Gets scale mode for hor. axis : 0 - linear, 1 - logarithmic
563 int Plot2d_SetupViewDlg::getYScaleMode()
565 return myYModeCombo->currentItem();
568 Slot, called when user clicks "Show main title" check box
570 void Plot2d_SetupViewDlg::onMainTitleChecked()
572 myTitleEdit->setEnabled( myTitleCheck->isChecked() );
575 Slot, called when user clicks "Show horizontal axis title" check box
577 void Plot2d_SetupViewDlg::onXTitleChecked()
579 myTitleXEdit->setEnabled( myTitleXCheck->isChecked() );
582 Slot, called when user clicks "Show vertical left axis title" check box
584 void Plot2d_SetupViewDlg::onYTitleChecked()
586 myTitleYEdit->setEnabled( myTitleYCheck->isChecked() );
589 Slot, called when user clicks "Show vertical right axis title" check box
591 void Plot2d_SetupViewDlg::onY2TitleChecked()
593 myTitleY2Edit->setEnabled( myTitleY2Check->isChecked() );
596 Slot, called when user clicks "Change bacground color" button
598 void Plot2d_SetupViewDlg::onBackgroundClicked()
600 QColor color = QColorDialog::getColor( getBackgroundColor() );
601 if ( color.isValid() ) {
602 setBackgroundColor( color );
606 Slot, called when user clicks "Show Legend" check box
608 void Plot2d_SetupViewDlg::onLegendChecked()
610 myLegendCombo->setEnabled( myLegendCheck->isChecked() );
613 Slot, called when user clicks "Enable hor. major grid" check box
615 void Plot2d_SetupViewDlg::onXGridMajorChecked()
617 myXMinGridCheck->setEnabled( myXGridCheck->isChecked() );
620 Slot, called when user clicks "Enable ver. major grid" check box
622 void Plot2d_SetupViewDlg::onYGridMajorChecked()
624 myYMinGridCheck->setEnabled( myYGridCheck->isChecked() );
627 Slot, called when user clicks "Enable ver. major grid" check box
629 void Plot2d_SetupViewDlg::onY2GridMajorChecked()
631 myY2MinGridCheck->setEnabled( myY2GridCheck->isChecked() );
634 Slot, called when user clicks "Enable hor. minor grid" check box
636 void Plot2d_SetupViewDlg::onXGridMinorChecked()
640 Slot, called when user clicks "Enable ver. minor grid" check box
642 void Plot2d_SetupViewDlg::onYGridMinorChecked()
646 Slot, called when user clicks "Enable ver. minor grid" check box
648 void Plot2d_SetupViewDlg::onY2GridMinorChecked()
652 Retursns true if "Set as default" check box is on
654 bool Plot2d_SetupViewDlg::isSetAsDefault()
656 return myDefCheck->isChecked();