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 QLabel* aXMajLbl = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpX);
125 myXGridSpin = new QSpinBox( 1, 100, 1, aGridGrpX );
126 myXGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
127 myXGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
128 myXMinGridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_HOR_MINOR" ), aGridGrpX );
129 QLabel* aXMinLbl = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpX);
130 myXMinGridSpin = new QSpinBox( 1, 100, 1, aGridGrpX );
131 myXMinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
132 myXMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
134 aGridLayoutX->addWidget( myXGridCheck, 0, 0 );
135 aGridLayoutX->addWidget( aXMajLbl, 0, 1 );
136 aGridLayoutX->addWidget( myXGridSpin, 0, 2 );
137 aGridLayoutX->addWidget( myXMinGridCheck, 1, 0 );
138 aGridLayoutX->addWidget( aXMinLbl, 1, 1 );
139 aGridLayoutX->addWidget( myXMinGridSpin, 1, 2 );
140 aXLayout->addMultiCellWidget( aGridGrpX, 3, 3, 0, 3 );
142 aTabWidget->addTab( aXWidget, tr( "INF_AXES_X" ) );
144 // widget for parameters on Oy
145 QWidget* aYWidget = new QWidget(aTabWidget);
146 QGridLayout* aYLayout = new QGridLayout( aYWidget );
147 aYLayout->setSpacing( SPACING_SIZE );
148 aYLayout->setMargin( MARGIN_SIZE );
150 myTitleYCheck = new QCheckBox( tr( "PLOT2D_ENABLE_VER_TITLE" ), aYWidget );
151 myTitleYEdit = new QLineEdit( aYWidget );
152 myTitleYEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
153 myTitleYEdit->setMinimumWidth( MIN_EDIT_WIDTH );
154 aYLayout->addWidget( myTitleYCheck, 1, 0 );
155 aYLayout->addMultiCellWidget( myTitleYEdit, 1, 1, 1, 3 );
157 QGroupBox* aGridGrpY = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aYWidget );
158 aGridGrpY->setColumnLayout(0, Qt::Vertical );
159 aGridGrpY->layout()->setSpacing( 0 ); aGridGrpY->layout()->setMargin( 0 );
160 QGridLayout* aGridLayoutY = new QGridLayout( aGridGrpY->layout() );
161 aGridLayoutY->setMargin( MARGIN_SIZE ); aGridLayoutY->setSpacing( SPACING_SIZE );
162 myYGridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MAJOR" ), aGridGrpY );
163 QLabel* aYMajLbl = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY);
164 myYGridSpin = new QSpinBox( 1, 100, 1, aGridGrpY );
165 myYGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
166 myYGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
167 myYMinGridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MINOR" ), aGridGrpY );
168 QLabel* aYMinLbl = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY);
169 myYMinGridSpin = new QSpinBox( 1, 100, 1, aGridGrpY );
170 myYMinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
171 myYMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
173 aGridLayoutY->addWidget( myYGridCheck, 0, 0 );
174 aGridLayoutY->addWidget( aYMajLbl, 0, 1 );
175 aGridLayoutY->addWidget( myYGridSpin, 0, 2 );
176 aGridLayoutY->addWidget( myYMinGridCheck, 1, 0 );
177 aGridLayoutY->addWidget( aYMinLbl, 1, 1 );
178 aGridLayoutY->addWidget( myYMinGridSpin, 1, 2 );
179 aYLayout->addMultiCellWidget( aGridGrpY, 3, 3, 0, 3 );
181 aTabWidget->addTab( aYWidget, tr( "INF_AXES_Y_LEFT" ) );
183 // if exist second axis Oy, addition new tab widget for right axis
185 // widget for parameters on Oy
186 QWidget* aYWidget2 = new QWidget(aTabWidget);
187 QGridLayout* aYLayout2 = new QGridLayout( aYWidget2 );
188 aYLayout2->setSpacing( SPACING_SIZE );
189 aYLayout2->setMargin( MARGIN_SIZE );
191 myTitleY2Check = new QCheckBox( tr( "PLOT2D_ENABLE_VER_TITLE" ), aYWidget2 );
192 myTitleY2Edit = new QLineEdit( aYWidget2 );
193 myTitleY2Edit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
194 myTitleY2Edit->setMinimumWidth( MIN_EDIT_WIDTH );
195 aYLayout2->addWidget( myTitleY2Check, 1, 0 );
196 aYLayout2->addMultiCellWidget( myTitleY2Edit, 1, 1, 1, 3 );
198 QGroupBox* aGridGrpY2 = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aYWidget2 );
199 aGridGrpY2->setColumnLayout(0, Qt::Vertical );
200 aGridGrpY2->layout()->setSpacing( 0 ); aGridGrpY2->layout()->setMargin( 0 );
201 QGridLayout* aGridLayoutY2 = new QGridLayout( aGridGrpY2->layout() );
202 aGridLayoutY2->setMargin( MARGIN_SIZE ); aGridLayoutY2->setSpacing( SPACING_SIZE );
203 myY2GridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MAJOR" ), aGridGrpY2 );
204 QLabel* aY2MajLbl = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY2);
205 myY2GridSpin = new QSpinBox( 1, 100, 1, aGridGrpY2 );
206 myY2GridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
207 myY2GridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
208 myY2MinGridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MINOR" ), aGridGrpY2 );
209 QLabel* aY2MinLbl = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY2);
210 myY2MinGridSpin = new QSpinBox( 1, 100, 1, aGridGrpY2 );
211 myY2MinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
212 myY2MinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
214 aGridLayoutY2->addWidget( myY2GridCheck, 0, 0 );
215 aGridLayoutY2->addWidget( aY2MajLbl, 0, 1 );
216 aGridLayoutY2->addWidget( myY2GridSpin, 0, 2 );
217 aGridLayoutY2->addWidget( myY2MinGridCheck, 1, 0 );
218 aGridLayoutY2->addWidget( aY2MinLbl, 1, 1 );
219 aGridLayoutY2->addWidget( myY2MinGridSpin, 1, 2 );
220 aYLayout2->addMultiCellWidget( aGridGrpY2, 3, 3, 0, 3 );
222 aTabWidget->addTab( aYWidget2, tr( "INF_AXES_Y_RIGHT" ) );
229 myY2MinGridCheck = 0;
233 aTabWidget->setCurrentPage( 0 );
234 /* "Set as default" check box */
235 myDefCheck = new QCheckBox( tr( "PLOT2D_SET_AS_DEFAULT_CHECK" ), this );
236 /* OK/Cancel buttons */
237 myOkBtn = new QPushButton( tr( "BUT_OK" ), this );
238 myOkBtn->setAutoDefault( TRUE );
239 myOkBtn->setDefault( TRUE );
240 myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this );
241 myCancelBtn->setAutoDefault( TRUE );
242 QHBoxLayout* btnLayout = new QHBoxLayout;
243 btnLayout->addWidget( myOkBtn );
244 btnLayout->addStretch();
245 btnLayout->addWidget( myCancelBtn );
248 topLayout->addWidget( myTitleCheck, 0, 0 );
249 topLayout->addMultiCellWidget( myTitleEdit, 0, 0, 1, 3 );
250 topLayout->addWidget( aCurveLab, 1, 0 );
251 topLayout->addWidget( myCurveCombo, 1, 1 );
252 topLayout->addWidget( myLegendCheck, 1, 2 );
253 topLayout->addWidget( myLegendCombo, 1, 3 );
254 topLayout->addWidget( aMarkerLab, 2, 0 );
255 topLayout->addWidget( myMarkerSpin, 2, 1 );
256 QHBoxLayout* bgLayout = new QHBoxLayout;
257 bgLayout->addWidget( myBackgroundBtn ); bgLayout->addStretch();
258 topLayout->addWidget( aBGLab, 2, 2 );
259 topLayout->addLayout( bgLayout, 2, 3 );
260 topLayout->addMultiCellWidget( aScaleGrp, 3, 3, 0, 3 );
261 topLayout->addMultiCellWidget( aTabWidget, 4, 4, 0, 3 );
262 topLayout->addMultiCellWidget( myDefCheck, 5, 5, 0, 3 );
263 topLayout->setRowStretch( 5, 5 );
265 topLayout->addMultiCellLayout( btnLayout, 6, 6, 0, 3 );
270 connect( myTitleCheck, SIGNAL( clicked() ), this, SLOT( onMainTitleChecked() ) );
271 connect( myTitleXCheck, SIGNAL( clicked() ), this, SLOT( onXTitleChecked() ) );
272 connect( myTitleYCheck, SIGNAL( clicked() ), this, SLOT( onYTitleChecked() ) );
273 connect( myBackgroundBtn, SIGNAL( clicked() ), this, SLOT( onBackgroundClicked() ) );
274 connect( myLegendCheck, SIGNAL( clicked() ), this, SLOT( onLegendChecked() ) );
275 connect( myXGridCheck, SIGNAL( clicked() ), this, SLOT( onXGridMajorChecked() ) );
276 connect( myYGridCheck, SIGNAL( clicked() ), this, SLOT( onYGridMajorChecked() ) );
277 connect( myXMinGridCheck, SIGNAL( clicked() ), this, SLOT( onXGridMinorChecked() ) );
278 connect( myYMinGridCheck, SIGNAL( clicked() ), this, SLOT( onYGridMinorChecked() ) );
280 connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
281 connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
284 connect( myTitleY2Check, SIGNAL( clicked() ), this, SLOT( onY2TitleChecked() ) );
285 connect( myY2GridCheck, SIGNAL( clicked() ), this, SLOT( onY2GridMajorChecked() ) );
286 connect( myY2MinGridCheck, SIGNAL( clicked() ), this, SLOT( onY2GridMinorChecked() ) );
290 setBackgroundColor( Qt::gray );
291 onMainTitleChecked();
295 onXGridMajorChecked();
296 onYGridMajorChecked();
297 onXGridMinorChecked();
300 onY2GridMajorChecked();
301 onY2GridMinorChecked();
308 Plot2d_SetupViewDlg::~Plot2d_SetupViewDlg()
312 Sets main title attributes
314 void Plot2d_SetupViewDlg::setMainTitle( bool enable, const QString& title )
316 myTitleCheck->setChecked( enable );
317 if ( !title.isNull() )
318 myTitleEdit->setText( title );
319 onMainTitleChecked();
322 Returns TRUE if main title is enabled
324 bool Plot2d_SetupViewDlg::isMainTitleEnabled()
326 return myTitleCheck->isChecked();
331 QString Plot2d_SetupViewDlg::getMainTitle()
333 return myTitleEdit->text();
336 Sets horizontal axis title attributes
338 void Plot2d_SetupViewDlg::setXTitle( bool enable, const QString& title )
340 myTitleXCheck->setChecked( enable );
341 if ( !title.isNull() )
342 myTitleXEdit->setText( title );
346 Returns TRUE if horizontal axis title is enabled
348 bool Plot2d_SetupViewDlg::isXTitleEnabled()
350 return myTitleXCheck->isChecked();
353 Gets horizontal axis title
355 QString Plot2d_SetupViewDlg::getXTitle()
357 return myTitleXEdit->text();
360 Sets vertical left axis title attributes
362 void Plot2d_SetupViewDlg::setYTitle( bool enable, const QString& title )
364 myTitleYCheck->setChecked( enable );
365 if ( !title.isNull() )
366 myTitleYEdit->setText( title );
370 Sets vertical right axis title attributes
372 void Plot2d_SetupViewDlg::setY2Title( bool enable, const QString& title )
374 myTitleY2Check->setChecked( enable );
375 if ( !title.isNull() )
376 myTitleY2Edit->setText( title );
380 Returns TRUE if vertical left axis title is enabled
382 bool Plot2d_SetupViewDlg::isYTitleEnabled()
384 return myTitleYCheck->isChecked();
387 Returns TRUE if vertical right axis title is enabled
389 bool Plot2d_SetupViewDlg::isY2TitleEnabled()
391 return myTitleY2Check->isChecked();
394 Gets vertical left axis title
396 QString Plot2d_SetupViewDlg::getYTitle()
398 return myTitleYEdit->text();
401 Gets vertical right axis title
403 QString Plot2d_SetupViewDlg::getY2Title()
405 return myTitleY2Edit->text();
408 Sets curve type : 0 - points, 1 - lines, 2 - splines
410 void Plot2d_SetupViewDlg::setCurveType( const int type )
412 myCurveCombo->setCurrentItem( type );
415 Gets curve type : 0 - points, 1 - lines, 2 - splines
417 int Plot2d_SetupViewDlg::getCurveType()
419 return myCurveCombo->currentItem();
422 Sets legend attributes : pos = 0 - left, 1 - right, 2 - top, 3 - bottom
424 void Plot2d_SetupViewDlg::setLegend( bool enable, int pos )
426 myLegendCheck->setChecked( enable );
427 myLegendCombo->setCurrentItem( pos );
431 Returns TRUE if legend is enabled
433 bool Plot2d_SetupViewDlg::isLegendEnabled()
435 return myLegendCheck->isChecked();
438 Returns legend position
440 int Plot2d_SetupViewDlg::getLegendPos()
442 return myLegendCombo->currentItem();
447 void Plot2d_SetupViewDlg::setMarkerSize( const int size )
449 myMarkerSpin->setValue( size );
454 int Plot2d_SetupViewDlg::getMarkerSize()
456 return myMarkerSpin->value();
459 Sets background color
461 void Plot2d_SetupViewDlg::setBackgroundColor( const QColor& color )
463 QPalette pal = myBackgroundBtn->palette();
464 QColorGroup ca = pal.active();
465 ca.setColor( QColorGroup::Button, color );
466 QColorGroup ci = pal.inactive();
467 ci.setColor( QColorGroup::Button, color );
469 pal.setInactive( ci );
470 myBackgroundBtn->setPalette( pal );
473 Gets background color
475 QColor Plot2d_SetupViewDlg::getBackgroundColor()
477 return myBackgroundBtn->palette().active().button();
480 Sets major grid parameters
482 void Plot2d_SetupViewDlg::setMajorGrid( bool enableX, const int divX,
483 bool enableY, const int divY,
484 bool enableY2, const int divY2 )
486 myXGridCheck->setChecked( enableX );
487 myXGridSpin->setValue( divX );
488 myYGridCheck->setChecked( enableY );
489 myYGridSpin->setValue( divY );
490 onXGridMajorChecked();
491 onYGridMajorChecked();
493 myY2GridCheck->setChecked( enableY2 );
494 myY2GridSpin->setValue( divY2 );
495 onY2GridMajorChecked();
499 Gets major grid parameters
501 void Plot2d_SetupViewDlg::getMajorGrid( bool& enableX, int& divX,
502 bool& enableY, int& divY,
503 bool& enableY2, int& divY2)
505 enableX = myXGridCheck->isChecked();
506 divX = myXGridSpin->value();
507 enableY = myYGridCheck->isChecked();
508 divY = myYGridSpin->value();
510 enableY2 = myY2GridCheck->isChecked();
511 divY2 = myY2GridSpin->value();
519 Sets minor grid parameters
521 void Plot2d_SetupViewDlg::setMinorGrid( bool enableX, const int divX,
522 bool enableY, const int divY,
523 bool enableY2, const int divY2)
525 myXMinGridCheck->setChecked( enableX );
526 myXMinGridSpin->setValue( divX );
527 myYMinGridCheck->setChecked( enableY );
528 myYMinGridSpin->setValue( divY );
529 onXGridMinorChecked();
530 onYGridMinorChecked();
532 myY2MinGridCheck->setChecked( enableY2 );
533 myY2MinGridSpin->setValue( divY2 );
534 onY2GridMinorChecked();
538 Gets minor grid parameters
540 void Plot2d_SetupViewDlg::getMinorGrid( bool& enableX, int& divX,
541 bool& enableY, int& divY,
542 bool& enableY2, int& divY2)
544 enableX = myXMinGridCheck->isChecked();
545 divX = myXMinGridSpin->value();
546 enableY = myYMinGridCheck->isChecked();
547 divY = myYMinGridSpin->value();
549 enableY2 = myY2MinGridCheck->isChecked();
550 divY2 = myY2MinGridSpin->value();
558 Sets scale mode for hor. and ver. axes : 0 - linear, 1 - logarithmic
560 void Plot2d_SetupViewDlg::setScaleMode( const int xMode, const int yMode )
562 myXModeCombo->setCurrentItem( xMode );
563 myYModeCombo->setCurrentItem( yMode );
566 Gets scale mode for hor. axis : 0 - linear, 1 - logarithmic
568 int Plot2d_SetupViewDlg::getXScaleMode()
570 return myXModeCombo->currentItem();
573 Gets scale mode for hor. axis : 0 - linear, 1 - logarithmic
575 int Plot2d_SetupViewDlg::getYScaleMode()
577 return myYModeCombo->currentItem();
580 Slot, called when user clicks "Show main title" check box
582 void Plot2d_SetupViewDlg::onMainTitleChecked()
584 myTitleEdit->setEnabled( myTitleCheck->isChecked() );
587 Slot, called when user clicks "Show horizontal axis title" check box
589 void Plot2d_SetupViewDlg::onXTitleChecked()
591 myTitleXEdit->setEnabled( myTitleXCheck->isChecked() );
594 Slot, called when user clicks "Show vertical left axis title" check box
596 void Plot2d_SetupViewDlg::onYTitleChecked()
598 myTitleYEdit->setEnabled( myTitleYCheck->isChecked() );
601 Slot, called when user clicks "Show vertical right axis title" check box
603 void Plot2d_SetupViewDlg::onY2TitleChecked()
605 myTitleY2Edit->setEnabled( myTitleY2Check->isChecked() );
608 Slot, called when user clicks "Change bacground color" button
610 void Plot2d_SetupViewDlg::onBackgroundClicked()
612 QColor color = QColorDialog::getColor( getBackgroundColor() );
613 if ( color.isValid() ) {
614 setBackgroundColor( color );
618 Slot, called when user clicks "Show Legend" check box
620 void Plot2d_SetupViewDlg::onLegendChecked()
622 myLegendCombo->setEnabled( myLegendCheck->isChecked() );
625 Slot, called when user clicks "Enable hor. major grid" check box
627 void Plot2d_SetupViewDlg::onXGridMajorChecked()
629 myXMinGridCheck->setEnabled( myXGridCheck->isChecked() );
632 Slot, called when user clicks "Enable ver. major grid" check box
634 void Plot2d_SetupViewDlg::onYGridMajorChecked()
636 myYMinGridCheck->setEnabled( myYGridCheck->isChecked() );
639 Slot, called when user clicks "Enable ver. major grid" check box
641 void Plot2d_SetupViewDlg::onY2GridMajorChecked()
643 myY2MinGridCheck->setEnabled( myY2GridCheck->isChecked() );
646 Slot, called when user clicks "Enable hor. minor grid" check box
648 void Plot2d_SetupViewDlg::onXGridMinorChecked()
652 Slot, called when user clicks "Enable ver. minor grid" check box
654 void Plot2d_SetupViewDlg::onYGridMinorChecked()
658 Slot, called when user clicks "Enable ver. minor grid" check box
660 void Plot2d_SetupViewDlg::onY2GridMinorChecked()
664 Retursns true if "Set as default" check box is on
666 bool Plot2d_SetupViewDlg::isSetAsDefault()
668 return myDefCheck->isChecked();