1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : Plot2d_SetupViewDlg.cxx
23 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
25 #include "Plot2d_SetupViewDlg.h"
27 #include <SUIT_Session.h>
28 #include <SUIT_Application.h>
29 #include <QtxColorButton.h>
35 #include <QGridLayout>
36 #include <QHBoxLayout>
39 #include <QPushButton>
42 const int MARGIN_SIZE = 11;
43 const int SPACING_SIZE = 6;
44 const int MIN_EDIT_WIDTH = 200;
45 const int MIN_COMBO_WIDTH = 100;
46 const int MIN_SPIN_WIDTH = 70;
49 \class Plot2d_SetupViewDlg
50 \brief Dialog box to setup Plot2d view window.
55 \param parent parent widget
56 \param showDefCheck if \c true, show "Set settings as default" check box
57 \param secondAxisY if \c true, show widgets for the second (right) vertical axis
59 Plot2d_SetupViewDlg::Plot2d_SetupViewDlg( QWidget* parent,
63 mySecondAxisY( secondAxisY )
66 setWindowTitle( tr("TLT_SETUP_PLOT2D_VIEW") );
67 setSizeGripEnabled( TRUE );
69 QGridLayout* topLayout = new QGridLayout( this );
70 topLayout->setSpacing( SPACING_SIZE );
71 topLayout->setMargin( MARGIN_SIZE );
74 myTitleCheck = new QCheckBox( tr( "PLOT2D_ENABLE_MAIN_TITLE" ), this );
75 myTitleEdit = new QLineEdit( this );
76 myTitleEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
77 myTitleEdit->setMinimumWidth( MIN_EDIT_WIDTH );
79 // curve type : points, lines, spline
80 QLabel* aCurveLab = new QLabel( tr( "PLOT2D_CURVE_TYPE_LBL" ), this );
81 myCurveCombo = new QComboBox( this );
82 myCurveCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
83 myCurveCombo->setMinimumWidth( MIN_COMBO_WIDTH );
84 myCurveCombo->addItem( tr( "PLOT2D_CURVE_TYPE_POINTS" ) );
85 myCurveCombo->addItem( tr( "PLOT2D_CURVE_TYPE_LINES" ) );
86 myCurveCombo->addItem( tr( "PLOT2D_CURVE_TYPE_SPLINE" ) );
89 myLegendCheck = new QCheckBox( tr( "PLOT2D_ENABLE_LEGEND" ), this );
90 myLegendCombo = new QComboBox( this );
91 myLegendCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
92 myLegendCombo->setMinimumWidth( MIN_COMBO_WIDTH );
93 myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_LEFT" ) );
94 myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_RIGHT" ) );
95 myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_TOP" ) );
96 myLegendCombo->addItem( tr( "PLOT2D_LEGEND_POSITION_BOTTOM" ) );
99 QLabel* aMarkerLab = new QLabel( tr( "PLOT2D_MARKER_SIZE_LBL" ), this );
100 myMarkerSpin = new QSpinBox( this );
101 myMarkerSpin->setMinimum( 0 );
102 myMarkerSpin->setMaximum( 100 );
103 myMarkerSpin->setSingleStep( 1 );
104 myMarkerSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
105 myMarkerSpin->setMinimumWidth( MIN_SPIN_WIDTH );
108 QLabel* aBGLab = new QLabel( tr( "PLOT2D_BACKGROUND_COLOR_LBL" ), this );
109 myBackgroundBtn = new QtxColorButton( this );
112 QGroupBox* aScaleGrp = new QGroupBox( tr( "PLOT2D_SCALE_TLT" ), this );
113 QGridLayout* aScaleLayout = new QGridLayout( aScaleGrp );
114 aScaleLayout->setMargin( MARGIN_SIZE ); aScaleLayout->setSpacing( SPACING_SIZE );
115 aScaleGrp->setLayout( aScaleLayout );
117 QLabel* xScaleLab = new QLabel( tr( "PLOT2D_SCALE_MODE_HOR" ), aScaleGrp );
118 myXModeCombo = new QComboBox( aScaleGrp );
119 myXModeCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
120 myXModeCombo->setMinimumWidth( MIN_COMBO_WIDTH );
121 myXModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LINEAR" ) );
122 myXModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LOGARITHMIC" ) );
124 QLabel* yScaleLab = new QLabel( tr( "PLOT2D_SCALE_MODE_VER" ), aScaleGrp );
125 myYModeCombo = new QComboBox( aScaleGrp );
126 myYModeCombo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
127 myYModeCombo->setMinimumWidth( MIN_COMBO_WIDTH );
128 myYModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LINEAR" ) );
129 myYModeCombo->addItem( tr( "PLOT2D_SCALE_MODE_LOGARITHMIC" ) );
131 aScaleLayout->addWidget( xScaleLab, 0, 0 );
132 aScaleLayout->addWidget( myXModeCombo, 0, 1 );
133 aScaleLayout->addWidget( yScaleLab, 0, 2 );
134 aScaleLayout->addWidget( myYModeCombo, 0, 3 );
136 // tab widget for choose properties of axis
137 QTabWidget* aTabWidget = new QTabWidget( this );
139 // widget for parameters on Ox
140 QWidget* aXWidget = new QWidget(aTabWidget);
141 QGridLayout* aXLayout = new QGridLayout( aXWidget );
142 aXLayout->setSpacing( SPACING_SIZE );
143 aXLayout->setMargin( MARGIN_SIZE );
146 myTitleXCheck = new QCheckBox( tr( "PLOT2D_ENABLE_HOR_TITLE" ), aXWidget );
147 myTitleXEdit = new QLineEdit( aXWidget );
148 myTitleXEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
149 myTitleXEdit->setMinimumWidth( MIN_EDIT_WIDTH );
150 aXLayout->addWidget( myTitleXCheck,1, 0 );
151 aXLayout->addWidget( myTitleXEdit, 1, 1, 1, 3 );
154 QGroupBox* aGridGrpX = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aXWidget );
155 QGridLayout* aGridLayoutX = new QGridLayout( aGridGrpX );
156 aGridLayoutX->setMargin( MARGIN_SIZE );
157 aGridLayoutX->setSpacing( SPACING_SIZE );
159 myXGridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_HOR_MAJOR" ), aGridGrpX );
161 QLabel* aXMajLbl = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpX);
162 myXGridSpin = new QSpinBox( aGridGrpX );
163 myXGridSpin->setMinimum( 1 );
164 myXGridSpin->setMaximum( 100 );
165 myXGridSpin->setSingleStep( 1 );
166 myXGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
167 myXGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
169 myXMinGridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_HOR_MINOR" ), aGridGrpX );
171 QLabel* aXMinLbl = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpX);
172 myXMinGridSpin = new QSpinBox( aGridGrpX );
173 myXMinGridSpin->setMinimum( 1 );
174 myXMinGridSpin->setMaximum( 100 );
175 myXMinGridSpin->setSingleStep( 1 );
176 myXMinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
177 myXMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
179 aGridLayoutX->addWidget( myXGridCheck, 0, 0 );
180 aGridLayoutX->addWidget( aXMajLbl, 0, 1 );
181 aGridLayoutX->addWidget( myXGridSpin, 0, 2 );
182 aGridLayoutX->addWidget( myXMinGridCheck, 1, 0 );
183 aGridLayoutX->addWidget( aXMinLbl, 1, 1 );
184 aGridLayoutX->addWidget( myXMinGridSpin, 1, 2 );
185 aXLayout->addWidget( aGridGrpX, 3, 0, 1, 4 );
187 aTabWidget->addTab( aXWidget, tr( "INF_AXES_X" ) );
189 // widget for parameters on Oy
190 QWidget* aYWidget = new QWidget(aTabWidget);
191 QGridLayout* aYLayout = new QGridLayout( aYWidget );
192 aYLayout->setSpacing( SPACING_SIZE );
193 aYLayout->setMargin( MARGIN_SIZE );
196 myTitleYCheck = new QCheckBox( tr( "PLOT2D_ENABLE_VER_TITLE" ), aYWidget );
197 myTitleYEdit = new QLineEdit( aYWidget );
198 myTitleYEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
199 myTitleYEdit->setMinimumWidth( MIN_EDIT_WIDTH );
200 aYLayout->addWidget( myTitleYCheck,1, 0 );
201 aYLayout->addWidget( myTitleYEdit, 1, 1, 1, 3 );
204 QGroupBox* aGridGrpY = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aYWidget );
205 QGridLayout* aGridLayoutY = new QGridLayout( aGridGrpY );
206 aGridGrpY->setLayout( aGridLayoutY );
207 aGridLayoutY->setMargin( MARGIN_SIZE ); aGridLayoutY->setSpacing( SPACING_SIZE );
209 myYGridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MAJOR" ), aGridGrpY );
211 QLabel* aYMajLbl = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY);
212 myYGridSpin = new QSpinBox( aGridGrpY );
213 myYGridSpin->setMinimum( 1 );
214 myYGridSpin->setMaximum( 100 );
215 myYGridSpin->setSingleStep( 1 );
216 myYGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
217 myYGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
219 myYMinGridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MINOR" ), aGridGrpY );
221 QLabel* aYMinLbl = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY);
222 myYMinGridSpin = new QSpinBox( aGridGrpY );
223 myYMinGridSpin->setMinimum( 1 );
224 myYMinGridSpin->setMaximum( 100 );
225 myYMinGridSpin->setSingleStep( 1 );
226 myYMinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
227 myYMinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
229 aGridLayoutY->addWidget( myYGridCheck, 0, 0 );
230 aGridLayoutY->addWidget( aYMajLbl, 0, 1 );
231 aGridLayoutY->addWidget( myYGridSpin, 0, 2 );
232 aGridLayoutY->addWidget( myYMinGridCheck, 1, 0 );
233 aGridLayoutY->addWidget( aYMinLbl, 1, 1 );
234 aGridLayoutY->addWidget( myYMinGridSpin, 1, 2 );
235 aYLayout->addWidget( aGridGrpY, 3, 0, 1, 4 );
237 aTabWidget->addTab( aYWidget, tr( "INF_AXES_Y_LEFT" ) );
239 // if exist second axis Oy, addition new tab widget for right axis
240 if ( mySecondAxisY ) {
241 // widget for parameters on Oy
242 QWidget* aYWidget2 = new QWidget( aTabWidget );
243 QGridLayout* aYLayout2 = new QGridLayout( aYWidget2 );
244 aYLayout2->setSpacing( SPACING_SIZE );
245 aYLayout2->setMargin( MARGIN_SIZE );
248 myTitleY2Check = new QCheckBox( tr( "PLOT2D_ENABLE_VER_TITLE" ), aYWidget2 );
249 myTitleY2Edit = new QLineEdit( aYWidget2 );
250 myTitleY2Edit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
251 myTitleY2Edit->setMinimumWidth( MIN_EDIT_WIDTH );
252 aYLayout2->addWidget( myTitleY2Check,1, 0 );
253 aYLayout2->addWidget( myTitleY2Edit, 1, 1, 1, 3 );
256 QGroupBox* aGridGrpY2 = new QGroupBox( tr( "PLOT2D_GRID_TLT" ), aYWidget2 );
257 QGridLayout* aGridLayoutY2 = new QGridLayout( aGridGrpY2 );
258 aGridGrpY2->setLayout( aGridLayoutY2 );
259 aGridLayoutY2->setMargin( MARGIN_SIZE ); aGridLayoutY2->setSpacing( SPACING_SIZE );
261 myY2GridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MAJOR" ), aGridGrpY2 );
263 QLabel* aY2MajLbl = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY2);
264 myY2GridSpin = new QSpinBox( aGridGrpY2 );
265 myY2GridSpin->setMinimum( 1 );
266 myY2GridSpin->setMaximum( 100 );
267 myY2GridSpin->setSingleStep( 1 );
268 myY2GridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
269 myY2GridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
271 myY2MinGridCheck = new QCheckBox( tr( "PLOT2D_GRID_ENABLE_VER_MINOR" ), aGridGrpY2 );
273 QLabel* aY2MinLbl = new QLabel( tr( "PLOT2D_MAX_INTERVALS" ), aGridGrpY2);
274 myY2MinGridSpin = new QSpinBox( aGridGrpY2 );
275 myY2MinGridSpin->setMinimum( 1 );
276 myY2MinGridSpin->setMaximum( 100 );
277 myY2MinGridSpin->setSingleStep( 1 );
278 myY2MinGridSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
279 myY2MinGridSpin->setMinimumWidth( MIN_SPIN_WIDTH );
281 aGridLayoutY2->addWidget( myY2GridCheck, 0, 0 );
282 aGridLayoutY2->addWidget( aY2MajLbl, 0, 1 );
283 aGridLayoutY2->addWidget( myY2GridSpin, 0, 2 );
284 aGridLayoutY2->addWidget( myY2MinGridCheck, 1, 0 );
285 aGridLayoutY2->addWidget( aY2MinLbl, 1, 1 );
286 aGridLayoutY2->addWidget( myY2MinGridSpin, 1, 2 );
287 aYLayout2->addWidget( aGridGrpY2, 3, 0, 1, 4 );
289 aTabWidget->addTab( aYWidget2, tr( "INF_AXES_Y_RIGHT" ) );
296 myY2MinGridCheck = 0;
301 aTabWidget->setCurrentIndex( 0 );
302 /* "Set as default" check box */
304 myDefCheck = new QCheckBox( tr( "PLOT2D_SET_AS_DEFAULT_CHECK" ), this );
306 /* OK/Cancel buttons */
307 myOkBtn = new QPushButton( tr( "BUT_OK" ), this );
308 myOkBtn->setAutoDefault( TRUE );
309 myOkBtn->setDefault( TRUE );
310 myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this );
311 myCancelBtn->setAutoDefault( TRUE );
312 myHelpBtn = new QPushButton( tr( "BUT_HELP" ), this );
313 myHelpBtn->setAutoDefault( TRUE );
314 QHBoxLayout* btnLayout = new QHBoxLayout;
315 btnLayout->addWidget( myOkBtn );
316 btnLayout->addStretch();
317 btnLayout->addWidget( myCancelBtn );
318 btnLayout->addWidget( myHelpBtn );
321 topLayout->addWidget( myTitleCheck, 0, 0 );
322 topLayout->addWidget( myTitleEdit, 0, 1, 1, 3 );
323 topLayout->addWidget( aCurveLab, 1, 0 );
324 topLayout->addWidget( myCurveCombo, 1, 1 );
325 topLayout->addWidget( myLegendCheck, 1, 2 );
326 topLayout->addWidget( myLegendCombo, 1, 3 );
327 topLayout->addWidget( aMarkerLab, 2, 0 );
328 topLayout->addWidget( myMarkerSpin, 2, 1 );
329 QHBoxLayout* bgLayout = new QHBoxLayout;
330 bgLayout->addWidget( myBackgroundBtn ); bgLayout->addStretch();
331 topLayout->addWidget( aBGLab, 2, 2 );
332 topLayout->addLayout( bgLayout, 2, 3 );
333 topLayout->addWidget( aScaleGrp, 3, 0, 1, 4 );
334 topLayout->addWidget( aTabWidget, 4, 0, 1, 4 );
335 topLayout->addWidget( myDefCheck, 5, 0, 1, 4 );
336 topLayout->setRowStretch( 5, 5 );
338 topLayout->addLayout( btnLayout, 6, 0, 1, 4 );
343 connect( myTitleCheck, SIGNAL( clicked() ), this, SLOT( onMainTitleChecked() ) );
344 connect( myTitleXCheck, SIGNAL( clicked() ), this, SLOT( onXTitleChecked() ) );
345 connect( myTitleYCheck, SIGNAL( clicked() ), this, SLOT( onYTitleChecked() ) );
346 connect( myLegendCheck, SIGNAL( clicked() ), this, SLOT( onLegendChecked() ) );
347 connect( myXGridCheck, SIGNAL( clicked() ), this, SLOT( onXGridMajorChecked() ) );
348 connect( myYGridCheck, SIGNAL( clicked() ), this, SLOT( onYGridMajorChecked() ) );
349 connect( myXMinGridCheck, SIGNAL( clicked() ), this, SLOT( onXGridMinorChecked() ) );
350 connect( myYMinGridCheck, SIGNAL( clicked() ), this, SLOT( onYGridMinorChecked() ) );
352 connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
353 connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
354 connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
356 if ( mySecondAxisY ) {
357 connect( myTitleY2Check, SIGNAL( clicked() ), this, SLOT( onY2TitleChecked() ) );
358 connect( myY2GridCheck, SIGNAL( clicked() ), this, SLOT( onY2GridMajorChecked() ) );
359 connect( myY2MinGridCheck, SIGNAL( clicked() ), this, SLOT( onY2GridMinorChecked() ) );
363 setBackgroundColor( Qt::gray );
364 onMainTitleChecked();
368 onXGridMajorChecked();
369 onYGridMajorChecked();
370 onXGridMinorChecked();
371 if ( mySecondAxisY ) {
373 onY2GridMajorChecked();
374 onY2GridMinorChecked();
381 Plot2d_SetupViewDlg::~Plot2d_SetupViewDlg()
386 \brief Set main title attributes.
387 \param enable if \c true main title is enabled
388 \param title main title
389 \sa isMainTitleEnabled(), getMainTitle()
391 void Plot2d_SetupViewDlg::setMainTitle( bool enable, const QString& title )
393 myTitleCheck->setChecked( enable );
394 if ( !title.isNull() )
395 myTitleEdit->setText( title );
396 onMainTitleChecked();
400 \brief Check if main title is enabled.
401 \return \c true if main title is enabled
404 bool Plot2d_SetupViewDlg::isMainTitleEnabled()
406 return myTitleCheck->isChecked();
410 \brief Get main title.
414 QString Plot2d_SetupViewDlg::getMainTitle()
416 return myTitleEdit->text();
420 \brief Set horizontal axis title attributes.
421 \param enable if \c true horizontal axis title is enabled
422 \param title horizontal axis title
423 \sa isXTitleEnabled(), getXTitle()
425 void Plot2d_SetupViewDlg::setXTitle( bool enable, const QString& title )
427 myTitleXCheck->setChecked( enable );
428 if ( !title.isNull() )
429 myTitleXEdit->setText( title );
434 \brief Check if main title is enabled.
435 \return \c true if horizontal axis title is enabled
438 bool Plot2d_SetupViewDlg::isXTitleEnabled()
440 return myTitleXCheck->isChecked();
444 \brief Get horizontal axis title.
445 \return horizontal axis title
448 QString Plot2d_SetupViewDlg::getXTitle()
450 return myTitleXEdit->text();
454 \brief Set left vertical axis title attributes.
455 \param enable if \c true left vertical axis title is enabled
456 \param title left vertical axis title
457 \sa setY2Title(), isYTitleEnabled(), getYTitle()
459 void Plot2d_SetupViewDlg::setYTitle( bool enable, const QString& title )
461 myTitleYCheck->setChecked( enable );
462 if ( !title.isNull() )
463 myTitleYEdit->setText( title );
468 \brief Set right vertical axis title attributes.
469 \param enable if \c true right vertical axis title is enabled
470 \param title right vertical axis title
471 \sa setYTitle(), isY2TitleEnabled(), getY2Title()
473 void Plot2d_SetupViewDlg::setY2Title( bool enable, const QString& title )
475 myTitleY2Check->setChecked( enable );
476 if ( !title.isNull() )
477 myTitleY2Edit->setText( title );
482 \brief Check if left vertical axis title is enabled.
483 \return \c true if right vertical axis title is enabled
486 bool Plot2d_SetupViewDlg::isYTitleEnabled()
488 return myTitleYCheck->isChecked();
492 \brief Check if right vertical axis title is enabled.
493 \return \c true if right vertical axis title is enabled
496 bool Plot2d_SetupViewDlg::isY2TitleEnabled()
498 return myTitleY2Check->isChecked();
502 \brief Get left vertical axis title.
503 \return left vertical axis title
506 QString Plot2d_SetupViewDlg::getYTitle()
508 return myTitleYEdit->text();
512 \brief Get right vertical axis title.
513 \return right vertical axis title
516 QString Plot2d_SetupViewDlg::getY2Title()
518 return myTitleY2Edit->text();
522 \brief Set curve type.
523 \param type curve type: 0 (points), 1 (lines) or 2 (splines)
526 void Plot2d_SetupViewDlg::setCurveType( const int type )
528 myCurveCombo->setCurrentIndex( type );
532 \brief Get curve type.
533 \return curve type: 0 (points), 1 (lines) or 2 (splines)
536 int Plot2d_SetupViewDlg::getCurveType()
538 return myCurveCombo->currentIndex();
542 \brief Set legend attribute.
543 \param if \c true legend is shown
544 \param pos legend position: 0 (left), 1 (right), 2 (top), 3 (bottom)
545 \sa isLegendEnabled(), getLegendPos()
547 void Plot2d_SetupViewDlg::setLegend( bool enable, int pos )
549 myLegendCheck->setChecked( enable );
550 myLegendCombo->setCurrentIndex( pos );
555 \brief Check if legend is enabled.
556 \return \c true if legend is enabled
559 bool Plot2d_SetupViewDlg::isLegendEnabled()
561 return myLegendCheck->isChecked();
565 \brief Get legend position.
566 \return legend position: 0 (left), 1 (right), 2 (top), 3 (bottom)
569 int Plot2d_SetupViewDlg::getLegendPos()
571 return myLegendCombo->currentIndex();
575 \brief Set marker size.
576 \param size marker size
579 void Plot2d_SetupViewDlg::setMarkerSize( const int size )
581 myMarkerSpin->setValue( size );
585 \brief Get marker size.
589 int Plot2d_SetupViewDlg::getMarkerSize()
591 return myMarkerSpin->value();
595 \brief Set background color.
596 \param color background color
597 \sa getBackgroundColor()
599 void Plot2d_SetupViewDlg::setBackgroundColor( const QColor& color )
601 myBackgroundBtn->setColor( color );
605 \brief Get background color.
606 \return background color
607 \sa setBackgroundColor()
609 QColor Plot2d_SetupViewDlg::getBackgroundColor()
611 return myBackgroundBtn->color();
615 \brief Set major grid parameters.
616 \param enableX if \c true, horizontal major grid is enabled
617 \param divX maximum number of ticks for horizontal major grid
618 \param enableY if \c true, left vertical major grid is enabled
619 \param divY maximum number of ticks for left vertical major grid
620 \param enableY2 if \c true, right vertical major grid is enabled
621 \param divY2 maximum number of ticks for right vertical major grid
624 void Plot2d_SetupViewDlg::setMajorGrid( bool enableX, const int divX,
625 bool enableY, const int divY,
626 bool enableY2, const int divY2 )
628 myXGridCheck->setChecked( enableX );
629 myXGridSpin->setValue( divX );
630 myYGridCheck->setChecked( enableY );
631 myYGridSpin->setValue( divY );
632 onXGridMajorChecked();
633 onYGridMajorChecked();
635 myY2GridCheck->setChecked( enableY2 );
636 myY2GridSpin->setValue( divY2 );
637 onY2GridMajorChecked();
642 \brief Get major grid parameters.
643 \param enableX \c true if horizontal major grid is enabled
644 \param divX maximum number of ticks for horizontal major grid
645 \param enableY \c true if left vertical major grid is enabled
646 \param divY maximum number of ticks for left vertical major grid
647 \param enableY2 \c true if right vertical major grid is enabled
648 \param divY2 maximum number of ticks for right vertical major grid
651 void Plot2d_SetupViewDlg::getMajorGrid( bool& enableX, int& divX,
652 bool& enableY, int& divY,
653 bool& enableY2, int& divY2 )
655 enableX = myXGridCheck->isChecked();
656 divX = myXGridSpin->value();
657 enableY = myYGridCheck->isChecked();
658 divY = myYGridSpin->value();
660 enableY2 = myY2GridCheck->isChecked();
661 divY2 = myY2GridSpin->value();
670 \brief Set minor grid parameters.
671 \param enableX if \c true, horizontal minor grid is enabled
672 \param divX maximum number of ticks for horizontal minor grid
673 \param enableY if \c true, left vertical minor grid is enabled
674 \param divY maximum number of ticks for left vertical minor grid
675 \param enableY2 if \c true, right vertical minor grid is enabled
676 \param divY2 maximum number of ticks for right vertical minor grid
679 void Plot2d_SetupViewDlg::setMinorGrid( bool enableX, const int divX,
680 bool enableY, const int divY,
681 bool enableY2, const int divY2 )
683 myXMinGridCheck->setChecked( enableX );
684 myXMinGridSpin->setValue( divX );
685 myYMinGridCheck->setChecked( enableY );
686 myYMinGridSpin->setValue( divY );
687 onXGridMinorChecked();
688 onYGridMinorChecked();
690 myY2MinGridCheck->setChecked( enableY2 );
691 myY2MinGridSpin->setValue( divY2 );
692 onY2GridMinorChecked();
697 \brief Get minor grid parameters.
698 \param enableX \c true if horizontal minor grid is enabled
699 \param divX maximum number of ticks for horizontal minor grid
700 \param enableY \c true if left vertical minor grid is enabled
701 \param divY maximum number of ticks for left vertical minor grid
702 \param enableY2 \c true if right vertical minor grid is enabled
703 \param divY2 maximum number of ticks for right vertical minor grid
706 void Plot2d_SetupViewDlg::getMinorGrid( bool& enableX, int& divX,
707 bool& enableY, int& divY,
708 bool& enableY2, int& divY2 )
710 enableX = myXMinGridCheck->isChecked();
711 divX = myXMinGridSpin->value();
712 enableY = myYMinGridCheck->isChecked();
713 divY = myYMinGridSpin->value();
714 if ( mySecondAxisY ) {
715 enableY2 = myY2MinGridCheck->isChecked();
716 divY2 = myY2MinGridSpin->value();
725 \brief Set scale mode for horizontal and vertical axes.
726 \param xMode horizontal axis scale mode: 0 (linear), 1 (logarithmic)
727 \param yMode vertical axis scale mode: 0 (linear), 1 (logarithmic)
728 \sa getXScaleMode(), getYScaleMode()
730 void Plot2d_SetupViewDlg::setScaleMode( const int xMode, const int yMode )
732 myXModeCombo->setCurrentIndex( xMode );
733 myYModeCombo->setCurrentIndex( yMode );
737 \brief Get scale mode for horizontal axis.
738 \return horizontal axis scale mode: 0 (linear), 1 (logarithmic)
741 int Plot2d_SetupViewDlg::getXScaleMode()
743 return myXModeCombo->currentIndex();
747 \brief Get scale mode for vertical axis.
748 \return vertical axis scale mode: 0 (linear), 1 (logarithmic)
751 int Plot2d_SetupViewDlg::getYScaleMode()
753 return myYModeCombo->currentIndex();
757 \brief Called when user clicks "Show main title" check box.
759 void Plot2d_SetupViewDlg::onMainTitleChecked()
761 myTitleEdit->setEnabled( myTitleCheck->isChecked() );
765 \brief Called when user clicks "Show horizontal axis title" check box.
767 void Plot2d_SetupViewDlg::onXTitleChecked()
769 myTitleXEdit->setEnabled( myTitleXCheck->isChecked() );
773 \brief Called when user clicks "Show vertical left axis title" check box.
775 void Plot2d_SetupViewDlg::onYTitleChecked()
777 myTitleYEdit->setEnabled( myTitleYCheck->isChecked() );
781 \brief Called when user clicks "Show vertical right axis title" check box.
783 void Plot2d_SetupViewDlg::onY2TitleChecked()
785 myTitleY2Edit->setEnabled( myTitleY2Check->isChecked() );
789 \brief Called when user clicks "Show Legend" check box.
791 void Plot2d_SetupViewDlg::onLegendChecked()
793 myLegendCombo->setEnabled( myLegendCheck->isChecked() );
797 \brief Called when user clicks "Enable horizontal major grid" check box.
799 void Plot2d_SetupViewDlg::onXGridMajorChecked()
801 myXMinGridCheck->setEnabled( myXGridCheck->isChecked() );
805 \brief Called when user clicks "Enable left vertical major grid" check box.
807 void Plot2d_SetupViewDlg::onYGridMajorChecked()
809 myYMinGridCheck->setEnabled( myYGridCheck->isChecked() );
813 \brief Called when user clicks "Enable right vertical major grid" check box.
815 void Plot2d_SetupViewDlg::onY2GridMajorChecked()
817 myY2MinGridCheck->setEnabled( myY2GridCheck->isChecked() );
821 \brief Called when user clicks "Enable horizontal minor grid" check box.
823 void Plot2d_SetupViewDlg::onXGridMinorChecked()
828 \brief Called when user clicks "Enable left vertical minor grid" check box.
830 void Plot2d_SetupViewDlg::onYGridMinorChecked()
835 \brief Called when user clicks "Enable right vertical minor grid" check box.
837 void Plot2d_SetupViewDlg::onY2GridMinorChecked()
842 \brief Get "Set settings as default" check box value.
843 \return \c true if "Set settings as default" check box is on
845 bool Plot2d_SetupViewDlg::isSetAsDefault()
847 return myDefCheck->isChecked();
851 Slot, called when user clicks "Help" button
853 void Plot2d_SetupViewDlg::onHelp()
855 SUIT_Application* app = SUIT_Session::session()->activeApplication();
857 app->onHelpContextModule( "GUI", "plot2d_viewer_page.html", "settings" );