1 // File : Plot2d_SetupPlot2dDlg.cxx
2 // Created : Wed Jun 27 16:39:06 2001
3 // Author : Vadim SANDLER
6 // Copyright : Open CASCADE
9 #include "Plot2d_SetupPlot2dDlg.h"
10 #include "QAD_Application.h"
11 #include "QAD_Desktop.h"
12 #include "QAD_Tools.h"
13 #include "QAD_MessageBox.h"
14 #include "Plot2d_Curve.h"
15 #include "Plot2d_CurveContainer.h"
18 #include <qpushbutton.h>
19 #include <qcheckbox.h>
20 #include <qtoolbutton.h>
21 #include <qcombobox.h>
22 #include <qscrollview.h>
24 #include <qcolordialog.h>
27 #define DLG_SIZE_WIDTH 500
28 #define DLG_SIZE_HEIGHT 400
29 #define MAX_LINE_WIDTH 100
30 #define MARGIN_SIZE 11
31 #define SPACING_SIZE 6
36 Plot2d_SetupPlot2dDlg::Plot2d_SetupPlot2dDlg( SALOMEDS::SObject_var object, QWidget* parent )
37 : QDialog( parent ? parent : QAD_Application::getDesktop(),
38 "Plot2d_SetupPlot2dDlg",
40 WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
42 setCaption( tr("TLT_SETUP_PLOT2D") );
43 setSizeGripEnabled( TRUE );
44 QGridLayout* topLayout = new QGridLayout( this );
45 topLayout->setSpacing( SPACING_SIZE );
46 topLayout->setMargin( MARGIN_SIZE );
48 myItems.setAutoDelete( false );
50 myObject = SALOMEDS::SObject::_duplicate( object );
53 myView = new QScrollView( this );
54 QFrame* frame = new QFrame( myView );
55 frame->setFrameStyle( QFrame::Plain | QFrame::NoFrame );
56 QGridLayout* frameLayout = new QGridLayout( frame, 1, 12 );
57 frameLayout->setMargin( MARGIN_SIZE ); frameLayout->setSpacing( SPACING_SIZE );
61 QLabel* labAxis = new QLabel( tr( "AXIS_LBL" ), frame );
62 QLabel* labData = new QLabel( tr( "DATA_LBL" ), frame );
63 QLabel* labUnit = new QLabel( tr( "UNITS_LBL" ), frame );
64 QLabel* labAttr = new QLabel( tr( "ATTRIBUTES_LBL" ), frame );
65 labAxis->setAlignment( AlignCenter );
66 labData->setAlignment( AlignCenter );
67 labUnit->setAlignment( AlignCenter );
68 labAttr->setAlignment( AlignCenter );
69 QFont font = labAxis->font(); font.setBold( true );
70 labAxis->setFont( font );
71 labData->setFont( font );
72 labUnit->setFont( font );
73 labAttr->setFont( font );
75 frameLayout->addMultiCellWidget( labAxis, 0, 0, 0, 1 );
76 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
77 frameLayout->addWidget( lin, 0, 2 );
78 frameLayout->addWidget( labData, 0, 3 );
79 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
80 frameLayout->addWidget( lin, 0, 4 );
81 frameLayout->addWidget( labUnit, 0, 5 );
82 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
83 frameLayout->addWidget( lin, 0, 6 );
84 frameLayout->addMultiCellWidget( labAttr, 0, 0, 7, 11 );
85 frameLayout->setColStretch( 12, 5 );
86 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::HLine | QFrame::Sunken );
87 frameLayout->addMultiCellWidget( lin, 1, 1, 0, 12 );
90 SALOMEDS::GenericAttribute_var anAttr;
91 SALOMEDS::AttributeTableOfInteger_var tblIntAttr;
92 SALOMEDS::AttributeTableOfReal_var tblRealAttr;
94 /* Try table of integer */
95 if ( myObject->FindAttribute( anAttr, "AttributeTableOfInteger" ) ) {
96 tblIntAttr = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
97 if ( !tblIntAttr->_is_nil() ) {
99 int nbRows = tblIntAttr->GetNbRows() ;
100 SALOMEDS::StringSeq_var rowTitles = tblIntAttr->GetRowTitles();
101 SALOMEDS::StringSeq_var rowUnits = tblIntAttr->GetRowUnits();
102 for ( int i = 0; i < nbRows; i++ ) {
103 Plot2d_ItemContainer* item = new Plot2d_ItemContainer( this );
104 item->createWidgets( frame );
105 frameLayout->addWidget( item->myHBtn, row, 0 );
106 frameLayout->addWidget( item->myVBtn, row, 1 );
107 frameLayout->addWidget( item->myTitleLab, row, 3 );
108 if ( rowTitles->length() > 0 )
109 item->myTitleLab->setText( QString( strdup( rowTitles[ i ] ) ) );
110 frameLayout->addWidget( item->myUnitLab, row, 5 );
111 if ( rowUnits->length() > 0 )
112 item->myUnitLab->setText( QString( strdup( rowUnits[ i ] ) ) );
113 frameLayout->addWidget( item->myAutoCheck, row, 7 );
114 frameLayout->addWidget( item->myLineCombo, row, 8 );
115 frameLayout->addWidget( item->myLineSpin, row, 9 );
116 frameLayout->addWidget( item->myMarkerCombo, row, 10 );
117 frameLayout->addWidget( item->myColorBtn, row, 11 );
118 connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
119 connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
120 myItems.append( item );
125 MESSAGE("Plot2d_SetupPlot2dDlg::Plot2d_SetupPlot2dDlg : Exception has been caught (int)!!!");
129 /* Try table of real */
130 else if ( myObject->FindAttribute( anAttr, "AttributeTableOfReal" ) ) {
131 tblRealAttr = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
132 if ( !tblRealAttr->_is_nil() ) {
134 int nbRows = tblRealAttr->GetNbRows() ;
135 SALOMEDS::StringSeq_var rowTitles = tblRealAttr->GetRowTitles();
136 SALOMEDS::StringSeq_var rowUnits = tblRealAttr->GetRowUnits();
137 for ( int i = 0; i < nbRows; i++ ) {
138 Plot2d_ItemContainer* item = new Plot2d_ItemContainer( this );
139 item->createWidgets( frame );
140 frameLayout->addWidget( item->myHBtn, row, 0 );
141 frameLayout->addWidget( item->myVBtn, row, 1 );
142 frameLayout->addWidget( item->myTitleLab, row, 3 );
143 if ( rowTitles->length() > 0 )
144 item->myTitleLab->setText( QString( strdup( rowTitles[ i ] ) ) );
145 frameLayout->addWidget( item->myUnitLab, row, 5 );
146 if ( rowUnits->length() > 0 )
147 item->myUnitLab->setText( QString( strdup( rowUnits[ i ] ) ) );
148 frameLayout->addWidget( item->myAutoCheck, row, 7 );
149 frameLayout->addWidget( item->myLineCombo, row, 8 );
150 frameLayout->addWidget( item->myLineSpin, row, 9 );
151 frameLayout->addWidget( item->myMarkerCombo, row, 10 );
152 frameLayout->addWidget( item->myColorBtn, row, 11 );
153 connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
154 connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
155 myItems.append( item );
160 MESSAGE("Plot2d_SetupPlot2dDlg::Plot2d_SetupPlot2dDlg : Exception has been caught (real)!!!");
164 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
165 frameLayout->addMultiCellWidget( lin, 2, row+1, 2, 2 );
166 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
167 frameLayout->addMultiCellWidget( lin, 2, row+1, 4, 4 );
168 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
169 frameLayout->addMultiCellWidget( lin, 2, row+1, 6, 6 );
170 frameLayout->setRowStretch( row+1, 5 );
172 myView->addChild( frame, 0, 0 );
173 myView->setResizePolicy( QScrollView::AutoOneFit );
175 myView->setMinimumWidth( frame->sizeHint().width() + MARGIN_SIZE * 2 );
177 /* OK/Cancel buttons */
178 myOkBtn = new QPushButton( tr( "BUT_OK" ), this, "buttonOk" );
179 myOkBtn->setAutoDefault( TRUE );
180 myOkBtn->setDefault( TRUE );
181 myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this, "buttonCancel" );
182 myCancelBtn->setAutoDefault( TRUE );
184 topLayout->addMultiCellWidget( myView, 0, 0, 0, 2 );
185 topLayout->addWidget( myOkBtn, 1, 0 );
186 topLayout->setColStretch( 1, 5 );
187 topLayout->addWidget( myCancelBtn, 1, 2 );
189 connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
190 connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
194 /* Center widget inside it's parent widget */
195 resize( DLG_SIZE_WIDTH, DLG_SIZE_HEIGHT );
196 QAD_Tools::centerWidget( this, parentWidget() );
201 Plot2d_SetupPlot2dDlg::~Plot2d_SetupPlot2dDlg()
205 Gets curves info ( indexes of row data in the table for horizontal and verical axes )
207 void Plot2d_SetupPlot2dDlg::getCurvesSource( int& horIndex, QValueList<int>& verIndexes )
209 /* collecting horizontal and vertical axis items */
212 for ( i = 0; i < myItems.count(); i++ ) {
213 if ( myItems.at( i )->isHorizontalOn() ) {
216 else if ( myItems.at( i )->isVerticalOn() ) {
217 verIndexes.append( i );
222 Gets curve attributes
224 bool Plot2d_SetupPlot2dDlg::getCurveAttributes( const int vIndex,
231 if ( vIndex >= 0 && vIndex < myItems.count() ) {
232 isAuto = myItems.at( vIndex )->isAutoAssign();
233 marker = myItems.at( vIndex )->getMarker();
234 line = myItems.at( vIndex )->getLine();
235 lineWidth = myItems.at( vIndex )->getLineWidth();
236 color = myItems.at( vIndex )->getColor();
242 Creates and returns curves presentations
244 void Plot2d_SetupPlot2dDlg::getCurves( Plot2d_CurveContainer& container )
246 SALOMEDS::GenericAttribute_var anAttr;
247 SALOMEDS::AttributeTableOfInteger_var tblIntAttr;
248 SALOMEDS::AttributeTableOfReal_var tblRealAttr;
250 /* clearing container contents */
253 /* collecting horizontal and vertical axis items */
256 QValueList<int> verIndex;
257 getCurvesSource( horIndex, verIndex );
258 if ( horIndex < 0 || verIndex.isEmpty() ) /* no curves can be created */
261 /* Try table of integer */
262 if ( myObject->FindAttribute( anAttr, "AttributeTableOfInteger" ) ) {
263 tblIntAttr = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
264 if ( !tblIntAttr->_is_nil() ) {
266 int nbCols = tblIntAttr->GetNbColumns() ;
267 SALOMEDS::StringSeq_var rowTitles = tblIntAttr->GetRowTitles();
268 SALOMEDS::StringSeq_var rowUnits = tblIntAttr->GetRowUnits();
270 for ( i = 0; i < verIndex.count(); i++ ) {
271 Plot2d_Curve* curve = new Plot2d_Curve();
273 if ( rowTitles->length() > 0 ) {
274 curve->setHorTitle( strdup( rowTitles[ horIndex ] ) );
275 curve->setVerTitle( strdup( rowTitles[ verIndex[i] ] ) );
278 if ( rowUnits->length() > 0 ) {
279 curve->setHorUnits( strdup( rowUnits[ horIndex ] ) );
280 curve->setVerUnits( strdup( rowUnits[ verIndex[i] ] ) );
284 for ( j = 1; j <= nbCols; j++ ) {
285 if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) )
288 if ( nbPoints > 0 ) {
289 double* xList = new double[ nbPoints ];
290 double* yList = new double[ nbPoints ];
291 for ( j = 1; j <= nbCols; j++ ) {
292 if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) ) {
293 xList[j-1] = tblIntAttr->GetValue( horIndex +1, j );
294 yList[j-1] = tblIntAttr->GetValue( verIndex[i]+1, j );
297 curve->setData( xList, yList, nbPoints );
300 curve->setLine( (Plot2d_Curve::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
301 curve->setMarker( (Plot2d_Curve::MarkerType)myItems.at( verIndex[i] )->getMarker() );
302 curve->setColor( myItems.at( verIndex[i] )->getColor() );
303 curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
304 // add curve into container
305 container.addCurve( curve );
309 MESSAGE("Plot2d_SetupPlot2dDlg::getCurves : Exception has been caught (int)!!!");
313 /* Try table of real */
314 else if ( myObject->FindAttribute( anAttr, "AttributeTableOfReal" ) ) {
315 tblRealAttr = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
316 if ( !tblRealAttr->_is_nil() ) {
318 int nbCols = tblRealAttr->GetNbColumns() ;
319 SALOMEDS::StringSeq_var rowTitles = tblRealAttr->GetRowTitles();
320 SALOMEDS::StringSeq_var rowUnits = tblRealAttr->GetRowUnits();
322 for ( i = 0; i < verIndex.count(); i++ ) {
323 Plot2d_Curve* curve = new Plot2d_Curve();
325 if ( rowTitles->length() > 0 ) {
326 curve->setHorTitle( strdup( rowTitles[ horIndex ] ) );
327 curve->setVerTitle( strdup( rowTitles[ verIndex[i] ] ) );
330 if ( rowUnits->length() > 0 ) {
331 curve->setHorUnits( strdup( rowUnits[ horIndex ] ) );
332 curve->setVerUnits( strdup( rowUnits[ verIndex[i] ] ) );
336 for ( j = 1; j <= nbCols; j++ ) {
337 if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) )
340 if ( nbPoints > 0 ) {
341 double* xList = new double[ nbPoints ];
342 double* yList = new double[ nbPoints ];
343 for ( j = 1; j <= nbCols; j++ ) {
344 if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) ) {
345 xList[j-1] = tblRealAttr->GetValue( horIndex +1, j );
346 yList[j-1] = tblRealAttr->GetValue( verIndex[i]+1, j );
349 curve->setData( xList, yList, nbPoints );
352 curve->setLine( (Plot2d_Curve::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
353 curve->setMarker( (Plot2d_Curve::MarkerType)myItems.at( verIndex[i] )->getMarker() );
354 curve->setColor( myItems.at( verIndex[i] )->getColor() );
355 curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
356 // add curve into container
357 container.addCurve( curve );
361 MESSAGE("Plot2d_SetupPlot2dDlg::getCurves : Exception has been caught (real)!!!");
367 Slot, called when any <H> button is clicked
369 void Plot2d_SetupPlot2dDlg::onHBtnToggled( bool on )
371 Plot2d_ItemContainer* item = ( Plot2d_ItemContainer* )sender();
373 for ( int i = 0; i < myItems.count(); i++ ) {
374 if ( myItems.at( i ) != item )
375 myItems.at( i )->setHorizontalOn( false );
381 Slot, called when any <V> button is clicked
383 void Plot2d_SetupPlot2dDlg::onVBtnToggled( bool on )
385 Plot2d_ItemContainer* item = ( Plot2d_ItemContainer* )sender();
386 QList<Plot2d_ItemContainer> itemList;
387 itemList.setAutoDelete( false );
391 for ( i = 0; i < myItems.count(); i++ ) {
392 if ( myItems.at( i ) != item && !myItems.at( i )->isHorizontalOn() ) {
393 if ( myItems.at( i )->myUnitLab->text() == item->myUnitLab->text() ) {
394 if ( myItems.at( i )->isVerticalOn() )
397 itemList.append( myItems.at( i ) );
400 myItems.at( i )->setVerticalOn( false );
404 if ( totalOn == 0 && !itemList.isEmpty() &&
405 QAD_MessageBox::info2( this,
407 tr( "QUE_WANT_SAME_UNITS" ),
411 for ( i = 0; i < itemList.count(); i++ ) {
412 itemList.at( i )->blockSignals( true );
413 itemList.at( i )->setVerticalOn( true );
414 itemList.at( i )->blockSignals( false );
421 Enables/disables buttons
423 void Plot2d_SetupPlot2dDlg::enableControls()
427 for ( int i = 0; i < myItems.count(); i++ ) {
428 if ( myItems.at( i )->isHorizontalOn() ) {
433 for ( int i = 0; i < myItems.count(); i++ ) {
434 if ( myItems.at( i )->isVerticalOn() )
436 myItems.at( i )->enableWidgets( bHSet && myItems.at( i )->isVerticalOn() );
438 myOkBtn->setEnabled( bHSet && bVSet );
441 // ====================================================================================
445 Plot2d_ItemContainer::Plot2d_ItemContainer( QObject* parent, const char* name )
446 : QObject( parent, name ),
453 void Plot2d_ItemContainer::createWidgets( QWidget* parentWidget )
455 myHBtn = new QToolButton( parentWidget );
456 myHBtn->setText( tr( " H " ) );
457 myHBtn->setToggleButton( true );
458 myHBtn->setOn( false );
460 myVBtn = new QToolButton( parentWidget );
461 myVBtn->setText( tr( " V " ) );
462 myVBtn->setToggleButton( true );
463 myVBtn->setOn( false );
465 myTitleLab = new QLabel( parentWidget );
466 myUnitLab = new QLabel( parentWidget );
467 myUnitLab->setAlignment( AlignCenter);
469 myAutoCheck = new QCheckBox( tr( "AUTO_CHECK_LBL" ), parentWidget );
470 myAutoCheck->setChecked( true );
472 myLineCombo = new QComboBox( false, parentWidget );
473 myLineCombo->insertItem( tr( "NONE_LINE_LBL" ) );
474 myLineCombo->insertItem( tr( "SOLID_LINE_LBL" ) );
475 myLineCombo->insertItem( tr( "DASH_LINE_LBL" ) );
476 myLineCombo->insertItem( tr( "DOT_LINE_LBL" ) );
477 myLineCombo->insertItem( tr( "DASHDOT_LINE_LBL" ) );
478 myLineCombo->insertItem( tr( "DAHSDOTDOT_LINE_LBL" ) );
479 myLineCombo->setCurrentItem( 1 ); // SOLID by default
481 myLineSpin = new QSpinBox( 0, MAX_LINE_WIDTH, 1, parentWidget );
482 myLineSpin->setValue( 0 ); // width = 0 by default
484 myMarkerCombo = new QComboBox( false, parentWidget );
485 myMarkerCombo->insertItem( tr( "NONE_MARKER_LBL" ) );
486 myMarkerCombo->insertItem( tr( "CIRCLE_MARKER_LBL" ) );
487 myMarkerCombo->insertItem( tr( "RECTANGLE_MARKER_LBL" ) );
488 myMarkerCombo->insertItem( tr( "DIAMOND_MARKER_LBL" ) );
489 myMarkerCombo->insertItem( tr( "DTRIANGLE_MARKER_LBL" ) );
490 myMarkerCombo->insertItem( tr( "UTRIANGLE_MARKER_LBL" ) );
491 myMarkerCombo->insertItem( tr( "LTRIANGLE_MARKER_LBL" ) );
492 myMarkerCombo->insertItem( tr( "RTRIANGLE_MARKER_LBL" ) );
493 myMarkerCombo->insertItem( tr( "CROSS_MARKER_LBL" ) );
494 myMarkerCombo->insertItem( tr( "XCROSS_MARKER_LBL" ) );
495 myMarkerCombo->setCurrentItem( 1 ); // CIRCLE by default
497 myColorBtn = new QToolButton( parentWidget );
499 connect( myAutoCheck, SIGNAL( clicked() ), this, SLOT( onAutoChanged() ) );
500 connect( myColorBtn, SIGNAL( clicked() ), this, SLOT( onColorChanged() ) );
501 connect( myHBtn, SIGNAL( toggled( bool ) ), this, SLOT( onHVToggled( bool ) ) );
502 connect( myVBtn, SIGNAL( toggled( bool ) ), this, SLOT( onHVToggled( bool ) ) );
503 setColor( QColor( 0, 0, 0 ) );
507 Enables attributes widgets
509 void Plot2d_ItemContainer::enableWidgets( bool enable )
515 Sets horizontal button's state on
517 void Plot2d_ItemContainer::setHorizontalOn( bool on )
522 Gets horizontal button's state
524 bool Plot2d_ItemContainer::isHorizontalOn() const
526 return myHBtn->isOn();
529 Sets vertical button's state on
531 void Plot2d_ItemContainer::setVerticalOn( bool on )
536 Gets vertical button's state
538 bool Plot2d_ItemContainer::isVerticalOn() const
540 return myVBtn->isOn();
543 Sets item AutoAssign flag state
545 void Plot2d_ItemContainer::setAutoAssign( bool on )
547 myAutoCheck->setChecked( on );
551 Gets item AutoAssign flag state
553 bool Plot2d_ItemContainer::isAutoAssign() const
555 return myAutoCheck->isChecked();
558 Sets item line type and width
560 void Plot2d_ItemContainer::setLine( const int line, const int width )
562 myLineCombo->setCurrentItem( line );
567 int Plot2d_ItemContainer::getLine() const
569 return myLineCombo->currentItem();
574 int Plot2d_ItemContainer::getLineWidth() const
576 return myLineSpin->value();
579 Sets item marker type
581 void Plot2d_ItemContainer::setMarker( const int marker )
583 myMarkerCombo->setCurrentItem( marker );
586 Gets item marker type
588 int Plot2d_ItemContainer::getMarker() const
590 return myMarkerCombo->currentItem();
595 void Plot2d_ItemContainer::setColor( const QColor& color )
597 QPalette pal = myColorBtn->palette();
598 QColorGroup ca = pal.active();
599 ca.setColor( QColorGroup::Button, color );
600 QColorGroup ci = pal.inactive();
601 ci.setColor( QColorGroup::Button, color );
603 pal.setInactive( ci );
604 myColorBtn->setPalette( pal );
609 QColor Plot2d_ItemContainer::getColor() const
611 return myColorBtn->palette().active().button();
614 Enables/disables widgets
616 void Plot2d_ItemContainer::updateState()
618 myAutoCheck->setEnabled( myEnabled );
619 myLineCombo->setEnabled( myEnabled && !myAutoCheck->isChecked() );
620 myLineSpin->setEnabled( myEnabled && !myAutoCheck->isChecked() );
621 myMarkerCombo->setEnabled( myEnabled && !myAutoCheck->isChecked() );
622 myColorBtn->setEnabled( myEnabled && !myAutoCheck->isChecked() );
625 Slot, called when user clickes <Auto assign> check box
627 void Plot2d_ItemContainer::onAutoChanged()
630 emit( autoClicked() );
633 <Color> button slot, invokes color selection dialog box
635 void Plot2d_ItemContainer::onColorChanged()
637 QColor color = QColorDialog::getColor( getColor() );
638 if ( color.isValid() ) {
643 <H> and <V> buttons slot
645 void Plot2d_ItemContainer::onHVToggled( bool on )
647 const QObject* snd = sender();
648 if ( snd == myHBtn ) {
650 if ( myVBtn->isOn() ) {
651 // blockSignals( true );
652 myVBtn->setOn( false );
653 // blockSignals( false );
656 emit horToggled( on );
660 if ( myHBtn->isOn() ) {
661 // blockSignals( true );
662 myHBtn->setOn( false );
663 // blockSignals( false );
666 emit verToggled( on );