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 #include "utilities.h"
32 #define DLG_SIZE_WIDTH 500
33 #define DLG_SIZE_HEIGHT 400
34 #define MAX_LINE_WIDTH 100
35 #define MARGIN_SIZE 11
36 #define SPACING_SIZE 6
41 Plot2d_SetupPlot2dDlg::Plot2d_SetupPlot2dDlg( SALOMEDS::SObject_var object, QWidget* parent )
42 : QDialog( parent ? parent : QAD_Application::getDesktop(),
43 "Plot2d_SetupPlot2dDlg",
45 WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
47 setCaption( tr("TLT_SETUP_PLOT2D") );
48 setSizeGripEnabled( TRUE );
49 QGridLayout* topLayout = new QGridLayout( this );
50 topLayout->setSpacing( SPACING_SIZE );
51 topLayout->setMargin( MARGIN_SIZE );
53 myItems.setAutoDelete( false );
55 myObject = SALOMEDS::SObject::_duplicate( object );
58 myView = new QScrollView( this );
59 QFrame* frame = new QFrame( myView );
60 frame->setFrameStyle( QFrame::Plain | QFrame::NoFrame );
61 QGridLayout* frameLayout = new QGridLayout( frame, 1, 12 );
62 frameLayout->setMargin( MARGIN_SIZE ); frameLayout->setSpacing( SPACING_SIZE );
66 QLabel* labAxis = new QLabel( tr( "AXIS_LBL" ), frame );
67 QLabel* labData = new QLabel( tr( "DATA_LBL" ), frame );
68 QLabel* labUnit = new QLabel( tr( "UNITS_LBL" ), frame );
69 QLabel* labAttr = new QLabel( tr( "ATTRIBUTES_LBL" ), frame );
70 labAxis->setAlignment( AlignCenter );
71 labData->setAlignment( AlignCenter );
72 labUnit->setAlignment( AlignCenter );
73 labAttr->setAlignment( AlignCenter );
74 QFont font = labAxis->font(); font.setBold( true );
75 labAxis->setFont( font );
76 labData->setFont( font );
77 labUnit->setFont( font );
78 labAttr->setFont( font );
80 frameLayout->addMultiCellWidget( labAxis, 0, 0, 0, 1 );
81 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
82 frameLayout->addWidget( lin, 0, 2 );
83 frameLayout->addWidget( labData, 0, 3 );
84 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
85 frameLayout->addWidget( lin, 0, 4 );
86 frameLayout->addWidget( labUnit, 0, 5 );
87 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
88 frameLayout->addWidget( lin, 0, 6 );
89 frameLayout->addMultiCellWidget( labAttr, 0, 0, 7, 11 );
90 frameLayout->setColStretch( 12, 5 );
91 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::HLine | QFrame::Sunken );
92 frameLayout->addMultiCellWidget( lin, 1, 1, 0, 12 );
95 SALOMEDS::GenericAttribute_var anAttr;
96 SALOMEDS::AttributeTableOfInteger_var tblIntAttr;
97 SALOMEDS::AttributeTableOfReal_var tblRealAttr;
99 /* Try table of integer */
100 if ( myObject->FindAttribute( anAttr, "AttributeTableOfInteger" ) ) {
101 tblIntAttr = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
102 if ( !tblIntAttr->_is_nil() ) {
104 int nbRows = tblIntAttr->GetNbRows() ;
105 SALOMEDS::StringSeq_var rowTitles = tblIntAttr->GetRowTitles();
106 SALOMEDS::StringSeq_var rowUnits = tblIntAttr->GetRowUnits();
107 for ( int i = 0; i < nbRows; i++ ) {
108 Plot2d_ItemContainer* item = new Plot2d_ItemContainer( this );
109 item->createWidgets( frame );
110 frameLayout->addWidget( item->myHBtn, row, 0 );
111 frameLayout->addWidget( item->myVBtn, row, 1 );
112 frameLayout->addWidget( item->myTitleLab, row, 3 );
113 if ( rowTitles->length() > 0 )
114 item->myTitleLab->setText( QString( rowTitles[ i ] ) );
115 frameLayout->addWidget( item->myUnitLab, row, 5 );
116 if ( rowUnits->length() > 0 )
117 item->myUnitLab->setText( QString( rowUnits[ i ] ) );
118 frameLayout->addWidget( item->myAutoCheck, row, 7 );
119 frameLayout->addWidget( item->myLineCombo, row, 8 );
120 frameLayout->addWidget( item->myLineSpin, row, 9 );
121 frameLayout->addWidget( item->myMarkerCombo, row, 10 );
122 frameLayout->addWidget( item->myColorBtn, row, 11 );
123 connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
124 connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
125 myItems.append( item );
130 MESSAGE("Plot2d_SetupPlot2dDlg::Plot2d_SetupPlot2dDlg : Exception has been caught (int)!!!");
134 /* Try table of real */
135 else if ( myObject->FindAttribute( anAttr, "AttributeTableOfReal" ) ) {
136 tblRealAttr = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
137 if ( !tblRealAttr->_is_nil() ) {
139 int nbRows = tblRealAttr->GetNbRows() ;
140 SALOMEDS::StringSeq_var rowTitles = tblRealAttr->GetRowTitles();
141 SALOMEDS::StringSeq_var rowUnits = tblRealAttr->GetRowUnits();
142 for ( int i = 0; i < nbRows; i++ ) {
143 Plot2d_ItemContainer* item = new Plot2d_ItemContainer( this );
144 item->createWidgets( frame );
145 frameLayout->addWidget( item->myHBtn, row, 0 );
146 frameLayout->addWidget( item->myVBtn, row, 1 );
147 frameLayout->addWidget( item->myTitleLab, row, 3 );
148 if ( rowTitles->length() > 0 )
149 item->myTitleLab->setText( QString( rowTitles[ i ] ) );
150 frameLayout->addWidget( item->myUnitLab, row, 5 );
151 if ( rowUnits->length() > 0 )
152 item->myUnitLab->setText( QString( rowUnits[ i ] ) );
153 frameLayout->addWidget( item->myAutoCheck, row, 7 );
154 frameLayout->addWidget( item->myLineCombo, row, 8 );
155 frameLayout->addWidget( item->myLineSpin, row, 9 );
156 frameLayout->addWidget( item->myMarkerCombo, row, 10 );
157 frameLayout->addWidget( item->myColorBtn, row, 11 );
158 connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
159 connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
160 myItems.append( item );
165 MESSAGE("Plot2d_SetupPlot2dDlg::Plot2d_SetupPlot2dDlg : Exception has been caught (real)!!!");
169 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
170 frameLayout->addMultiCellWidget( lin, 2, row+1, 2, 2 );
171 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
172 frameLayout->addMultiCellWidget( lin, 2, row+1, 4, 4 );
173 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
174 frameLayout->addMultiCellWidget( lin, 2, row+1, 6, 6 );
175 frameLayout->setRowStretch( row+1, 5 );
177 myView->addChild( frame, 0, 0 );
178 myView->setResizePolicy( QScrollView::AutoOneFit );
180 myView->setMinimumWidth( frame->sizeHint().width() + MARGIN_SIZE * 2 );
182 /* OK/Cancel buttons */
183 myOkBtn = new QPushButton( tr( "BUT_OK" ), this, "buttonOk" );
184 myOkBtn->setAutoDefault( TRUE );
185 myOkBtn->setDefault( TRUE );
186 myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this, "buttonCancel" );
187 myCancelBtn->setAutoDefault( TRUE );
189 topLayout->addMultiCellWidget( myView, 0, 0, 0, 2 );
190 topLayout->addWidget( myOkBtn, 1, 0 );
191 topLayout->setColStretch( 1, 5 );
192 topLayout->addWidget( myCancelBtn, 1, 2 );
194 connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
195 connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
199 /* Center widget inside it's parent widget */
200 resize( DLG_SIZE_WIDTH, DLG_SIZE_HEIGHT );
201 QAD_Tools::centerWidget( this, parentWidget() );
206 Plot2d_SetupPlot2dDlg::~Plot2d_SetupPlot2dDlg()
210 Gets curves info ( indexes of row data in the table for horizontal and verical axes )
212 void Plot2d_SetupPlot2dDlg::getCurvesSource( int& horIndex, QValueList<int>& verIndexes )
214 /* collecting horizontal and vertical axis items */
217 for ( i = 0; i < myItems.count(); i++ ) {
218 if ( myItems.at( i )->isHorizontalOn() ) {
221 else if ( myItems.at( i )->isVerticalOn() ) {
222 verIndexes.append( i );
227 Gets curve attributes
229 bool Plot2d_SetupPlot2dDlg::getCurveAttributes( const int vIndex,
236 if ( vIndex >= 0 && vIndex < myItems.count() ) {
237 isAuto = myItems.at( vIndex )->isAutoAssign();
238 marker = myItems.at( vIndex )->getMarker();
239 line = myItems.at( vIndex )->getLine();
240 lineWidth = myItems.at( vIndex )->getLineWidth();
241 color = myItems.at( vIndex )->getColor();
247 Creates and returns curves presentations
249 void Plot2d_SetupPlot2dDlg::getCurves( Plot2d_CurveContainer& container )
251 SALOMEDS::GenericAttribute_var anAttr;
252 SALOMEDS::AttributeTableOfInteger_var tblIntAttr;
253 SALOMEDS::AttributeTableOfReal_var tblRealAttr;
255 /* clearing container contents */
258 /* collecting horizontal and vertical axis items */
261 QValueList<int> verIndex;
262 getCurvesSource( horIndex, verIndex );
263 if ( horIndex < 0 || verIndex.isEmpty() ) /* no curves can be created */
266 /* Try table of integer */
267 if ( myObject->FindAttribute( anAttr, "AttributeTableOfInteger" ) ) {
268 tblIntAttr = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
269 if ( !tblIntAttr->_is_nil() ) {
271 int nbCols = tblIntAttr->GetNbColumns() ;
272 SALOMEDS::StringSeq_var rowTitles = tblIntAttr->GetRowTitles();
273 SALOMEDS::StringSeq_var rowUnits = tblIntAttr->GetRowUnits();
275 for ( i = 0; i < verIndex.count(); i++ ) {
276 Plot2d_Curve* curve = new Plot2d_Curve();
278 if ( rowTitles->length() > 0 ) {
279 curve->setHorTitle( QString( rowTitles[ horIndex ] ) );
280 curve->setVerTitle( QString( rowTitles[ verIndex[i] ] ) );
283 if ( rowUnits->length() > 0 ) {
284 curve->setHorUnits( QString( rowUnits[ horIndex ] ) );
285 curve->setVerUnits( QString( rowUnits[ verIndex[i] ] ) );
289 for ( j = 1; j <= nbCols; j++ ) {
290 if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) )
293 if ( nbPoints > 0 ) {
294 double* xList = new double[ nbPoints ];
295 double* yList = new double[ nbPoints ];
296 for ( j = 1; j <= nbCols; j++ ) {
297 if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) ) {
298 xList[j-1] = tblIntAttr->GetValue( horIndex +1, j );
299 yList[j-1] = tblIntAttr->GetValue( verIndex[i]+1, j );
302 curve->setData( xList, yList, nbPoints );
305 curve->setLine( (Plot2d_Curve::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
306 curve->setMarker( (Plot2d_Curve::MarkerType)myItems.at( verIndex[i] )->getMarker() );
307 curve->setColor( myItems.at( verIndex[i] )->getColor() );
308 curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
309 // add curve into container
310 container.addCurve( curve );
314 MESSAGE("Plot2d_SetupPlot2dDlg::getCurves : Exception has been caught (int)!!!");
318 /* Try table of real */
319 else if ( myObject->FindAttribute( anAttr, "AttributeTableOfReal" ) ) {
320 tblRealAttr = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
321 if ( !tblRealAttr->_is_nil() ) {
323 int nbCols = tblRealAttr->GetNbColumns() ;
324 SALOMEDS::StringSeq_var rowTitles = tblRealAttr->GetRowTitles();
325 SALOMEDS::StringSeq_var rowUnits = tblRealAttr->GetRowUnits();
327 for ( i = 0; i < verIndex.count(); i++ ) {
328 Plot2d_Curve* curve = new Plot2d_Curve();
330 if ( rowTitles->length() > 0 ) {
331 curve->setHorTitle( QString( rowTitles[ horIndex ] ) );
332 curve->setVerTitle( QString( rowTitles[ verIndex[i] ] ) );
335 if ( rowUnits->length() > 0 ) {
336 curve->setHorUnits( QString( rowUnits[ horIndex ] ) );
337 curve->setVerUnits( QString( rowUnits[ verIndex[i] ] ) );
341 for ( j = 1; j <= nbCols; j++ ) {
342 if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) )
345 if ( nbPoints > 0 ) {
346 double* xList = new double[ nbPoints ];
347 double* yList = new double[ nbPoints ];
348 for ( j = 1; j <= nbCols; j++ ) {
349 if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) ) {
350 xList[j-1] = tblRealAttr->GetValue( horIndex +1, j );
351 yList[j-1] = tblRealAttr->GetValue( verIndex[i]+1, j );
354 curve->setData( xList, yList, nbPoints );
357 curve->setLine( (Plot2d_Curve::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
358 curve->setMarker( (Plot2d_Curve::MarkerType)myItems.at( verIndex[i] )->getMarker() );
359 curve->setColor( myItems.at( verIndex[i] )->getColor() );
360 curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
361 // add curve into container
362 container.addCurve( curve );
366 MESSAGE("Plot2d_SetupPlot2dDlg::getCurves : Exception has been caught (real)!!!");
372 Slot, called when any <H> button is clicked
374 void Plot2d_SetupPlot2dDlg::onHBtnToggled( bool on )
376 Plot2d_ItemContainer* item = ( Plot2d_ItemContainer* )sender();
378 for ( int i = 0; i < myItems.count(); i++ ) {
379 if ( myItems.at( i ) != item )
380 myItems.at( i )->setHorizontalOn( false );
386 Slot, called when any <V> button is clicked
388 void Plot2d_SetupPlot2dDlg::onVBtnToggled( bool on )
390 Plot2d_ItemContainer* item = ( Plot2d_ItemContainer* )sender();
391 QList<Plot2d_ItemContainer> itemList;
392 itemList.setAutoDelete( false );
396 for ( i = 0; i < myItems.count(); i++ ) {
397 if ( myItems.at( i ) != item && !myItems.at( i )->isHorizontalOn() ) {
398 if ( myItems.at( i )->myUnitLab->text() == item->myUnitLab->text() ) {
399 if ( myItems.at( i )->isVerticalOn() )
402 itemList.append( myItems.at( i ) );
405 myItems.at( i )->setVerticalOn( false );
409 if ( totalOn == 0 && !itemList.isEmpty() &&
410 QAD_MessageBox::info2( this,
412 tr( "QUE_WANT_SAME_UNITS" ),
416 for ( i = 0; i < itemList.count(); i++ ) {
417 itemList.at( i )->blockSignals( true );
418 itemList.at( i )->setVerticalOn( true );
419 itemList.at( i )->blockSignals( false );
426 Enables/disables buttons
428 void Plot2d_SetupPlot2dDlg::enableControls()
432 for ( int i = 0; i < myItems.count(); i++ ) {
433 if ( myItems.at( i )->isHorizontalOn() ) {
438 for ( int i = 0; i < myItems.count(); i++ ) {
439 if ( myItems.at( i )->isVerticalOn() )
441 myItems.at( i )->enableWidgets( bHSet && myItems.at( i )->isVerticalOn() );
443 myOkBtn->setEnabled( bHSet && bVSet );
446 // ====================================================================================
450 Plot2d_ItemContainer::Plot2d_ItemContainer( QObject* parent, const char* name )
451 : QObject( parent, name ),
458 void Plot2d_ItemContainer::createWidgets( QWidget* parentWidget )
460 myHBtn = new QToolButton( parentWidget );
461 myHBtn->setText( tr( " H " ) );
462 myHBtn->setToggleButton( true );
463 myHBtn->setOn( false );
465 myVBtn = new QToolButton( parentWidget );
466 myVBtn->setText( tr( " V " ) );
467 myVBtn->setToggleButton( true );
468 myVBtn->setOn( false );
470 myTitleLab = new QLabel( parentWidget );
471 myUnitLab = new QLabel( parentWidget );
472 myUnitLab->setAlignment( AlignCenter);
474 myAutoCheck = new QCheckBox( tr( "AUTO_CHECK_LBL" ), parentWidget );
475 myAutoCheck->setChecked( true );
477 myLineCombo = new QComboBox( false, parentWidget );
478 myLineCombo->insertItem( tr( "NONE_LINE_LBL" ) );
479 myLineCombo->insertItem( tr( "SOLID_LINE_LBL" ) );
480 myLineCombo->insertItem( tr( "DASH_LINE_LBL" ) );
481 myLineCombo->insertItem( tr( "DOT_LINE_LBL" ) );
482 myLineCombo->insertItem( tr( "DASHDOT_LINE_LBL" ) );
483 myLineCombo->insertItem( tr( "DAHSDOTDOT_LINE_LBL" ) );
484 myLineCombo->setCurrentItem( 1 ); // SOLID by default
486 myLineSpin = new QSpinBox( 0, MAX_LINE_WIDTH, 1, parentWidget );
487 myLineSpin->setValue( 0 ); // width = 0 by default
489 myMarkerCombo = new QComboBox( false, parentWidget );
490 myMarkerCombo->insertItem( tr( "NONE_MARKER_LBL" ) );
491 myMarkerCombo->insertItem( tr( "CIRCLE_MARKER_LBL" ) );
492 myMarkerCombo->insertItem( tr( "RECTANGLE_MARKER_LBL" ) );
493 myMarkerCombo->insertItem( tr( "DIAMOND_MARKER_LBL" ) );
494 myMarkerCombo->insertItem( tr( "DTRIANGLE_MARKER_LBL" ) );
495 myMarkerCombo->insertItem( tr( "UTRIANGLE_MARKER_LBL" ) );
496 myMarkerCombo->insertItem( tr( "LTRIANGLE_MARKER_LBL" ) );
497 myMarkerCombo->insertItem( tr( "RTRIANGLE_MARKER_LBL" ) );
498 myMarkerCombo->insertItem( tr( "CROSS_MARKER_LBL" ) );
499 myMarkerCombo->insertItem( tr( "XCROSS_MARKER_LBL" ) );
500 myMarkerCombo->setCurrentItem( 1 ); // CIRCLE by default
502 myColorBtn = new QToolButton( parentWidget );
504 connect( myAutoCheck, SIGNAL( clicked() ), this, SLOT( onAutoChanged() ) );
505 connect( myColorBtn, SIGNAL( clicked() ), this, SLOT( onColorChanged() ) );
506 connect( myHBtn, SIGNAL( toggled( bool ) ), this, SLOT( onHVToggled( bool ) ) );
507 connect( myVBtn, SIGNAL( toggled( bool ) ), this, SLOT( onHVToggled( bool ) ) );
508 setColor( QColor( 0, 0, 0 ) );
512 Enables attributes widgets
514 void Plot2d_ItemContainer::enableWidgets( bool enable )
520 Sets horizontal button's state on
522 void Plot2d_ItemContainer::setHorizontalOn( bool on )
527 Gets horizontal button's state
529 bool Plot2d_ItemContainer::isHorizontalOn() const
531 return myHBtn->isOn();
534 Sets vertical button's state on
536 void Plot2d_ItemContainer::setVerticalOn( bool on )
541 Gets vertical button's state
543 bool Plot2d_ItemContainer::isVerticalOn() const
545 return myVBtn->isOn();
548 Sets item AutoAssign flag state
550 void Plot2d_ItemContainer::setAutoAssign( bool on )
552 myAutoCheck->setChecked( on );
556 Gets item AutoAssign flag state
558 bool Plot2d_ItemContainer::isAutoAssign() const
560 return myAutoCheck->isChecked();
563 Sets item line type and width
565 void Plot2d_ItemContainer::setLine( const int line, const int width )
567 myLineCombo->setCurrentItem( line );
572 int Plot2d_ItemContainer::getLine() const
574 return myLineCombo->currentItem();
579 int Plot2d_ItemContainer::getLineWidth() const
581 return myLineSpin->value();
584 Sets item marker type
586 void Plot2d_ItemContainer::setMarker( const int marker )
588 myMarkerCombo->setCurrentItem( marker );
591 Gets item marker type
593 int Plot2d_ItemContainer::getMarker() const
595 return myMarkerCombo->currentItem();
600 void Plot2d_ItemContainer::setColor( const QColor& color )
602 QPalette pal = myColorBtn->palette();
603 QColorGroup ca = pal.active();
604 ca.setColor( QColorGroup::Button, color );
605 QColorGroup ci = pal.inactive();
606 ci.setColor( QColorGroup::Button, color );
608 pal.setInactive( ci );
609 myColorBtn->setPalette( pal );
614 QColor Plot2d_ItemContainer::getColor() const
616 return myColorBtn->palette().active().button();
619 Enables/disables widgets
621 void Plot2d_ItemContainer::updateState()
623 myAutoCheck->setEnabled( myEnabled );
624 myLineCombo->setEnabled( myEnabled && !myAutoCheck->isChecked() );
625 myLineSpin->setEnabled( myEnabled && !myAutoCheck->isChecked() );
626 myMarkerCombo->setEnabled( myEnabled && !myAutoCheck->isChecked() );
627 myColorBtn->setEnabled( myEnabled && !myAutoCheck->isChecked() );
630 Slot, called when user clickes <Auto assign> check box
632 void Plot2d_ItemContainer::onAutoChanged()
635 emit( autoClicked() );
638 <Color> button slot, invokes color selection dialog box
640 void Plot2d_ItemContainer::onColorChanged()
642 QColor color = QColorDialog::getColor( getColor() );
643 if ( color.isValid() ) {
648 <H> and <V> buttons slot
650 void Plot2d_ItemContainer::onHVToggled( bool on )
652 const QObject* snd = sender();
653 if ( snd == myHBtn ) {
655 if ( myVBtn->isOn() ) {
656 // blockSignals( true );
657 myVBtn->setOn( false );
658 // blockSignals( false );
661 emit horToggled( on );
665 if ( myHBtn->isOn() ) {
666 // blockSignals( true );
667 myHBtn->setOn( false );
668 // blockSignals( false );
671 emit verToggled( on );