1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : Plot2d_SetupPlot2dDlg.cxx
6 // Author : Vadim SANDLER
10 #include "Plot2d_SetupPlot2dDlg.h"
11 #include "QAD_Application.h"
12 #include "QAD_Desktop.h"
13 #include "QAD_Tools.h"
14 #include "QAD_MessageBox.h"
15 #include "Plot2d_Curve.h"
16 #include "Plot2d_CurveContainer.h"
19 #include <qpushbutton.h>
20 #include <qcheckbox.h>
21 #include <qtoolbutton.h>
22 #include <qcombobox.h>
23 #include <qscrollview.h>
25 #include <qcolordialog.h>
28 #define DLG_SIZE_WIDTH 500
29 #define DLG_SIZE_HEIGHT 400
30 #define MAX_LINE_WIDTH 100
31 #define MARGIN_SIZE 11
32 #define SPACING_SIZE 6
37 Plot2d_SetupPlot2dDlg::Plot2d_SetupPlot2dDlg( SALOMEDS::SObject_var object, QWidget* parent )
38 : QDialog( parent ? parent : QAD_Application::getDesktop(),
39 "Plot2d_SetupPlot2dDlg",
41 WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
43 setCaption( tr("TLT_SETUP_PLOT2D") );
44 setSizeGripEnabled( TRUE );
45 QGridLayout* topLayout = new QGridLayout( this );
46 topLayout->setSpacing( SPACING_SIZE );
47 topLayout->setMargin( MARGIN_SIZE );
49 myItems.setAutoDelete( false );
51 myObject = SALOMEDS::SObject::_duplicate( object );
54 myView = new QScrollView( this );
55 QFrame* frame = new QFrame( myView );
56 frame->setFrameStyle( QFrame::Plain | QFrame::NoFrame );
57 QGridLayout* frameLayout = new QGridLayout( frame, 1, 12 );
58 frameLayout->setMargin( MARGIN_SIZE ); frameLayout->setSpacing( SPACING_SIZE );
62 QLabel* labAxis = new QLabel( tr( "AXIS_LBL" ), frame );
63 QLabel* labData = new QLabel( tr( "DATA_LBL" ), frame );
64 QLabel* labUnit = new QLabel( tr( "UNITS_LBL" ), frame );
65 QLabel* labAttr = new QLabel( tr( "ATTRIBUTES_LBL" ), frame );
66 labAxis->setAlignment( AlignCenter );
67 labData->setAlignment( AlignCenter );
68 labUnit->setAlignment( AlignCenter );
69 labAttr->setAlignment( AlignCenter );
70 QFont font = labAxis->font(); font.setBold( true );
71 labAxis->setFont( font );
72 labData->setFont( font );
73 labUnit->setFont( font );
74 labAttr->setFont( font );
76 frameLayout->addMultiCellWidget( labAxis, 0, 0, 0, 1 );
77 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
78 frameLayout->addWidget( lin, 0, 2 );
79 frameLayout->addWidget( labData, 0, 3 );
80 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
81 frameLayout->addWidget( lin, 0, 4 );
82 frameLayout->addWidget( labUnit, 0, 5 );
83 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
84 frameLayout->addWidget( lin, 0, 6 );
85 frameLayout->addMultiCellWidget( labAttr, 0, 0, 7, 11 );
86 frameLayout->setColStretch( 12, 5 );
87 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::HLine | QFrame::Sunken );
88 frameLayout->addMultiCellWidget( lin, 1, 1, 0, 12 );
91 SALOMEDS::GenericAttribute_var anAttr;
92 SALOMEDS::AttributeTableOfInteger_var tblIntAttr;
93 SALOMEDS::AttributeTableOfReal_var tblRealAttr;
95 /* Try table of integer */
96 if ( myObject->FindAttribute( anAttr, "AttributeTableOfInteger" ) ) {
97 tblIntAttr = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
98 if ( !tblIntAttr->_is_nil() ) {
100 int nbRows = tblIntAttr->GetNbRows() ;
101 SALOMEDS::StringSeq_var rowTitles = tblIntAttr->GetRowTitles();
102 SALOMEDS::StringSeq_var rowUnits = tblIntAttr->GetRowUnits();
103 for ( int i = 0; i < nbRows; i++ ) {
104 Plot2d_ItemContainer* item = new Plot2d_ItemContainer( this );
105 item->createWidgets( frame );
106 frameLayout->addWidget( item->myHBtn, row, 0 );
107 frameLayout->addWidget( item->myVBtn, row, 1 );
108 frameLayout->addWidget( item->myTitleLab, row, 3 );
109 if ( rowTitles->length() > 0 )
110 item->myTitleLab->setText( QString( strdup( rowTitles[ i ] ) ) );
111 frameLayout->addWidget( item->myUnitLab, row, 5 );
112 if ( rowUnits->length() > 0 )
113 item->myUnitLab->setText( QString( strdup( rowUnits[ i ] ) ) );
114 frameLayout->addWidget( item->myAutoCheck, row, 7 );
115 frameLayout->addWidget( item->myLineCombo, row, 8 );
116 frameLayout->addWidget( item->myLineSpin, row, 9 );
117 frameLayout->addWidget( item->myMarkerCombo, row, 10 );
118 frameLayout->addWidget( item->myColorBtn, row, 11 );
119 connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
120 connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
121 myItems.append( item );
126 MESSAGE("Plot2d_SetupPlot2dDlg::Plot2d_SetupPlot2dDlg : Exception has been caught (int)!!!");
130 /* Try table of real */
131 else if ( myObject->FindAttribute( anAttr, "AttributeTableOfReal" ) ) {
132 tblRealAttr = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
133 if ( !tblRealAttr->_is_nil() ) {
135 int nbRows = tblRealAttr->GetNbRows() ;
136 SALOMEDS::StringSeq_var rowTitles = tblRealAttr->GetRowTitles();
137 SALOMEDS::StringSeq_var rowUnits = tblRealAttr->GetRowUnits();
138 for ( int i = 0; i < nbRows; i++ ) {
139 Plot2d_ItemContainer* item = new Plot2d_ItemContainer( this );
140 item->createWidgets( frame );
141 frameLayout->addWidget( item->myHBtn, row, 0 );
142 frameLayout->addWidget( item->myVBtn, row, 1 );
143 frameLayout->addWidget( item->myTitleLab, row, 3 );
144 if ( rowTitles->length() > 0 )
145 item->myTitleLab->setText( QString( strdup( rowTitles[ i ] ) ) );
146 frameLayout->addWidget( item->myUnitLab, row, 5 );
147 if ( rowUnits->length() > 0 )
148 item->myUnitLab->setText( QString( strdup( rowUnits[ i ] ) ) );
149 frameLayout->addWidget( item->myAutoCheck, row, 7 );
150 frameLayout->addWidget( item->myLineCombo, row, 8 );
151 frameLayout->addWidget( item->myLineSpin, row, 9 );
152 frameLayout->addWidget( item->myMarkerCombo, row, 10 );
153 frameLayout->addWidget( item->myColorBtn, row, 11 );
154 connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
155 connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
156 myItems.append( item );
161 MESSAGE("Plot2d_SetupPlot2dDlg::Plot2d_SetupPlot2dDlg : Exception has been caught (real)!!!");
165 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
166 frameLayout->addMultiCellWidget( lin, 2, row+1, 2, 2 );
167 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
168 frameLayout->addMultiCellWidget( lin, 2, row+1, 4, 4 );
169 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
170 frameLayout->addMultiCellWidget( lin, 2, row+1, 6, 6 );
171 frameLayout->setRowStretch( row+1, 5 );
173 myView->addChild( frame, 0, 0 );
174 myView->setResizePolicy( QScrollView::AutoOneFit );
176 myView->setMinimumWidth( frame->sizeHint().width() + MARGIN_SIZE * 2 );
178 /* OK/Cancel buttons */
179 myOkBtn = new QPushButton( tr( "BUT_OK" ), this, "buttonOk" );
180 myOkBtn->setAutoDefault( TRUE );
181 myOkBtn->setDefault( TRUE );
182 myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this, "buttonCancel" );
183 myCancelBtn->setAutoDefault( TRUE );
185 topLayout->addMultiCellWidget( myView, 0, 0, 0, 2 );
186 topLayout->addWidget( myOkBtn, 1, 0 );
187 topLayout->setColStretch( 1, 5 );
188 topLayout->addWidget( myCancelBtn, 1, 2 );
190 connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
191 connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
195 /* Center widget inside it's parent widget */
196 resize( DLG_SIZE_WIDTH, DLG_SIZE_HEIGHT );
197 QAD_Tools::centerWidget( this, parentWidget() );
202 Plot2d_SetupPlot2dDlg::~Plot2d_SetupPlot2dDlg()
206 Gets curves info ( indexes of row data in the table for horizontal and verical axes )
208 void Plot2d_SetupPlot2dDlg::getCurvesSource( int& horIndex, QValueList<int>& verIndexes )
210 /* collecting horizontal and vertical axis items */
213 for ( i = 0; i < myItems.count(); i++ ) {
214 if ( myItems.at( i )->isHorizontalOn() ) {
217 else if ( myItems.at( i )->isVerticalOn() ) {
218 verIndexes.append( i );
223 Gets curve attributes
225 bool Plot2d_SetupPlot2dDlg::getCurveAttributes( const int vIndex,
232 if ( vIndex >= 0 && vIndex < myItems.count() ) {
233 isAuto = myItems.at( vIndex )->isAutoAssign();
234 marker = myItems.at( vIndex )->getMarker();
235 line = myItems.at( vIndex )->getLine();
236 lineWidth = myItems.at( vIndex )->getLineWidth();
237 color = myItems.at( vIndex )->getColor();
243 Creates and returns curves presentations
245 void Plot2d_SetupPlot2dDlg::getCurves( Plot2d_CurveContainer& container )
247 SALOMEDS::GenericAttribute_var anAttr;
248 SALOMEDS::AttributeTableOfInteger_var tblIntAttr;
249 SALOMEDS::AttributeTableOfReal_var tblRealAttr;
251 /* clearing container contents */
254 /* collecting horizontal and vertical axis items */
257 QValueList<int> verIndex;
258 getCurvesSource( horIndex, verIndex );
259 if ( horIndex < 0 || verIndex.isEmpty() ) /* no curves can be created */
262 /* Try table of integer */
263 if ( myObject->FindAttribute( anAttr, "AttributeTableOfInteger" ) ) {
264 tblIntAttr = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
265 if ( !tblIntAttr->_is_nil() ) {
267 int nbCols = tblIntAttr->GetNbColumns() ;
268 SALOMEDS::StringSeq_var rowTitles = tblIntAttr->GetRowTitles();
269 SALOMEDS::StringSeq_var rowUnits = tblIntAttr->GetRowUnits();
271 for ( i = 0; i < verIndex.count(); i++ ) {
272 Plot2d_Curve* curve = new Plot2d_Curve();
274 if ( rowTitles->length() > 0 ) {
275 curve->setHorTitle( strdup( rowTitles[ horIndex ] ) );
276 curve->setVerTitle( strdup( rowTitles[ verIndex[i] ] ) );
279 if ( rowUnits->length() > 0 ) {
280 curve->setHorUnits( strdup( rowUnits[ horIndex ] ) );
281 curve->setVerUnits( strdup( rowUnits[ verIndex[i] ] ) );
285 for ( j = 1; j <= nbCols; j++ ) {
286 if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) )
289 if ( nbPoints > 0 ) {
290 double* xList = new double[ nbPoints ];
291 double* yList = new double[ nbPoints ];
292 for ( j = 1; j <= nbCols; j++ ) {
293 if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) ) {
294 xList[j-1] = tblIntAttr->GetValue( horIndex +1, j );
295 yList[j-1] = tblIntAttr->GetValue( verIndex[i]+1, j );
298 curve->setData( xList, yList, nbPoints );
301 curve->setLine( (Plot2d_Curve::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
302 curve->setMarker( (Plot2d_Curve::MarkerType)myItems.at( verIndex[i] )->getMarker() );
303 curve->setColor( myItems.at( verIndex[i] )->getColor() );
304 curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
305 // add curve into container
306 container.addCurve( curve );
310 MESSAGE("Plot2d_SetupPlot2dDlg::getCurves : Exception has been caught (int)!!!");
314 /* Try table of real */
315 else if ( myObject->FindAttribute( anAttr, "AttributeTableOfReal" ) ) {
316 tblRealAttr = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
317 if ( !tblRealAttr->_is_nil() ) {
319 int nbCols = tblRealAttr->GetNbColumns() ;
320 SALOMEDS::StringSeq_var rowTitles = tblRealAttr->GetRowTitles();
321 SALOMEDS::StringSeq_var rowUnits = tblRealAttr->GetRowUnits();
323 for ( i = 0; i < verIndex.count(); i++ ) {
324 Plot2d_Curve* curve = new Plot2d_Curve();
326 if ( rowTitles->length() > 0 ) {
327 curve->setHorTitle( strdup( rowTitles[ horIndex ] ) );
328 curve->setVerTitle( strdup( rowTitles[ verIndex[i] ] ) );
331 if ( rowUnits->length() > 0 ) {
332 curve->setHorUnits( strdup( rowUnits[ horIndex ] ) );
333 curve->setVerUnits( strdup( rowUnits[ verIndex[i] ] ) );
337 for ( j = 1; j <= nbCols; j++ ) {
338 if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) )
341 if ( nbPoints > 0 ) {
342 double* xList = new double[ nbPoints ];
343 double* yList = new double[ nbPoints ];
344 for ( j = 1; j <= nbCols; j++ ) {
345 if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) ) {
346 xList[j-1] = tblRealAttr->GetValue( horIndex +1, j );
347 yList[j-1] = tblRealAttr->GetValue( verIndex[i]+1, j );
350 curve->setData( xList, yList, nbPoints );
353 curve->setLine( (Plot2d_Curve::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
354 curve->setMarker( (Plot2d_Curve::MarkerType)myItems.at( verIndex[i] )->getMarker() );
355 curve->setColor( myItems.at( verIndex[i] )->getColor() );
356 curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
357 // add curve into container
358 container.addCurve( curve );
362 MESSAGE("Plot2d_SetupPlot2dDlg::getCurves : Exception has been caught (real)!!!");
368 Slot, called when any <H> button is clicked
370 void Plot2d_SetupPlot2dDlg::onHBtnToggled( bool on )
372 Plot2d_ItemContainer* item = ( Plot2d_ItemContainer* )sender();
374 for ( int i = 0; i < myItems.count(); i++ ) {
375 if ( myItems.at( i ) != item )
376 myItems.at( i )->setHorizontalOn( false );
382 Slot, called when any <V> button is clicked
384 void Plot2d_SetupPlot2dDlg::onVBtnToggled( bool on )
386 Plot2d_ItemContainer* item = ( Plot2d_ItemContainer* )sender();
387 QList<Plot2d_ItemContainer> itemList;
388 itemList.setAutoDelete( false );
392 for ( i = 0; i < myItems.count(); i++ ) {
393 if ( myItems.at( i ) != item && !myItems.at( i )->isHorizontalOn() ) {
394 if ( myItems.at( i )->myUnitLab->text() == item->myUnitLab->text() ) {
395 if ( myItems.at( i )->isVerticalOn() )
398 itemList.append( myItems.at( i ) );
401 myItems.at( i )->setVerticalOn( false );
405 if ( totalOn == 0 && !itemList.isEmpty() &&
406 QAD_MessageBox::info2( this,
408 tr( "QUE_WANT_SAME_UNITS" ),
412 for ( i = 0; i < itemList.count(); i++ ) {
413 itemList.at( i )->blockSignals( true );
414 itemList.at( i )->setVerticalOn( true );
415 itemList.at( i )->blockSignals( false );
422 Enables/disables buttons
424 void Plot2d_SetupPlot2dDlg::enableControls()
428 for ( int i = 0; i < myItems.count(); i++ ) {
429 if ( myItems.at( i )->isHorizontalOn() ) {
434 for ( int i = 0; i < myItems.count(); i++ ) {
435 if ( myItems.at( i )->isVerticalOn() )
437 myItems.at( i )->enableWidgets( bHSet && myItems.at( i )->isVerticalOn() );
439 myOkBtn->setEnabled( bHSet && bVSet );
442 // ====================================================================================
446 Plot2d_ItemContainer::Plot2d_ItemContainer( QObject* parent, const char* name )
447 : QObject( parent, name ),
454 void Plot2d_ItemContainer::createWidgets( QWidget* parentWidget )
456 myHBtn = new QToolButton( parentWidget );
457 myHBtn->setText( tr( " H " ) );
458 myHBtn->setToggleButton( true );
459 myHBtn->setOn( false );
461 myVBtn = new QToolButton( parentWidget );
462 myVBtn->setText( tr( " V " ) );
463 myVBtn->setToggleButton( true );
464 myVBtn->setOn( false );
466 myTitleLab = new QLabel( parentWidget );
467 myUnitLab = new QLabel( parentWidget );
468 myUnitLab->setAlignment( AlignCenter);
470 myAutoCheck = new QCheckBox( tr( "AUTO_CHECK_LBL" ), parentWidget );
471 myAutoCheck->setChecked( true );
473 myLineCombo = new QComboBox( false, parentWidget );
474 myLineCombo->insertItem( tr( "NONE_LINE_LBL" ) );
475 myLineCombo->insertItem( tr( "SOLID_LINE_LBL" ) );
476 myLineCombo->insertItem( tr( "DASH_LINE_LBL" ) );
477 myLineCombo->insertItem( tr( "DOT_LINE_LBL" ) );
478 myLineCombo->insertItem( tr( "DASHDOT_LINE_LBL" ) );
479 myLineCombo->insertItem( tr( "DAHSDOTDOT_LINE_LBL" ) );
480 myLineCombo->setCurrentItem( 1 ); // SOLID by default
482 myLineSpin = new QSpinBox( 0, MAX_LINE_WIDTH, 1, parentWidget );
483 myLineSpin->setValue( 0 ); // width = 0 by default
485 myMarkerCombo = new QComboBox( false, parentWidget );
486 myMarkerCombo->insertItem( tr( "NONE_MARKER_LBL" ) );
487 myMarkerCombo->insertItem( tr( "CIRCLE_MARKER_LBL" ) );
488 myMarkerCombo->insertItem( tr( "RECTANGLE_MARKER_LBL" ) );
489 myMarkerCombo->insertItem( tr( "DIAMOND_MARKER_LBL" ) );
490 myMarkerCombo->insertItem( tr( "DTRIANGLE_MARKER_LBL" ) );
491 myMarkerCombo->insertItem( tr( "UTRIANGLE_MARKER_LBL" ) );
492 myMarkerCombo->insertItem( tr( "LTRIANGLE_MARKER_LBL" ) );
493 myMarkerCombo->insertItem( tr( "RTRIANGLE_MARKER_LBL" ) );
494 myMarkerCombo->insertItem( tr( "CROSS_MARKER_LBL" ) );
495 myMarkerCombo->insertItem( tr( "XCROSS_MARKER_LBL" ) );
496 myMarkerCombo->setCurrentItem( 1 ); // CIRCLE by default
498 myColorBtn = new QToolButton( parentWidget );
500 connect( myAutoCheck, SIGNAL( clicked() ), this, SLOT( onAutoChanged() ) );
501 connect( myColorBtn, SIGNAL( clicked() ), this, SLOT( onColorChanged() ) );
502 connect( myHBtn, SIGNAL( toggled( bool ) ), this, SLOT( onHVToggled( bool ) ) );
503 connect( myVBtn, SIGNAL( toggled( bool ) ), this, SLOT( onHVToggled( bool ) ) );
504 setColor( QColor( 0, 0, 0 ) );
508 Enables attributes widgets
510 void Plot2d_ItemContainer::enableWidgets( bool enable )
516 Sets horizontal button's state on
518 void Plot2d_ItemContainer::setHorizontalOn( bool on )
523 Gets horizontal button's state
525 bool Plot2d_ItemContainer::isHorizontalOn() const
527 return myHBtn->isOn();
530 Sets vertical button's state on
532 void Plot2d_ItemContainer::setVerticalOn( bool on )
537 Gets vertical button's state
539 bool Plot2d_ItemContainer::isVerticalOn() const
541 return myVBtn->isOn();
544 Sets item AutoAssign flag state
546 void Plot2d_ItemContainer::setAutoAssign( bool on )
548 myAutoCheck->setChecked( on );
552 Gets item AutoAssign flag state
554 bool Plot2d_ItemContainer::isAutoAssign() const
556 return myAutoCheck->isChecked();
559 Sets item line type and width
561 void Plot2d_ItemContainer::setLine( const int line, const int width )
563 myLineCombo->setCurrentItem( line );
568 int Plot2d_ItemContainer::getLine() const
570 return myLineCombo->currentItem();
575 int Plot2d_ItemContainer::getLineWidth() const
577 return myLineSpin->value();
580 Sets item marker type
582 void Plot2d_ItemContainer::setMarker( const int marker )
584 myMarkerCombo->setCurrentItem( marker );
587 Gets item marker type
589 int Plot2d_ItemContainer::getMarker() const
591 return myMarkerCombo->currentItem();
596 void Plot2d_ItemContainer::setColor( const QColor& color )
598 QPalette pal = myColorBtn->palette();
599 QColorGroup ca = pal.active();
600 ca.setColor( QColorGroup::Button, color );
601 QColorGroup ci = pal.inactive();
602 ci.setColor( QColorGroup::Button, color );
604 pal.setInactive( ci );
605 myColorBtn->setPalette( pal );
610 QColor Plot2d_ItemContainer::getColor() const
612 return myColorBtn->palette().active().button();
615 Enables/disables widgets
617 void Plot2d_ItemContainer::updateState()
619 myAutoCheck->setEnabled( myEnabled );
620 myLineCombo->setEnabled( myEnabled && !myAutoCheck->isChecked() );
621 myLineSpin->setEnabled( myEnabled && !myAutoCheck->isChecked() );
622 myMarkerCombo->setEnabled( myEnabled && !myAutoCheck->isChecked() );
623 myColorBtn->setEnabled( myEnabled && !myAutoCheck->isChecked() );
626 Slot, called when user clickes <Auto assign> check box
628 void Plot2d_ItemContainer::onAutoChanged()
631 emit( autoClicked() );
634 <Color> button slot, invokes color selection dialog box
636 void Plot2d_ItemContainer::onColorChanged()
638 QColor color = QColorDialog::getColor( getColor() );
639 if ( color.isValid() ) {
644 <H> and <V> buttons slot
646 void Plot2d_ItemContainer::onHVToggled( bool on )
648 const QObject* snd = sender();
649 if ( snd == myHBtn ) {
651 if ( myVBtn->isOn() ) {
652 // blockSignals( true );
653 myVBtn->setOn( false );
654 // blockSignals( false );
657 emit horToggled( on );
661 if ( myHBtn->isOn() ) {
662 // blockSignals( true );
663 myHBtn->setOn( false );
664 // blockSignals( false );
667 emit verToggled( on );