1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : Plot2d_SetupPlot2dDlg.cxx
6 // Author : Vadim SANDLER
10 #include "SPlot2d_SetupPlot2dDlg.h"
11 #include "SPlot2d_Curve.h"
13 #include "SUIT_Tools.h"
14 #include "SUIT_MessageBox.h"
16 #include <SALOMEDSClient_AttributeTableOfInteger.hxx>
17 #include <SALOMEDSClient_AttributeTableOfReal.hxx>
20 #include <qpushbutton.h>
21 #include <qcheckbox.h>
22 #include <qtoolbutton.h>
23 #include <qcombobox.h>
24 #include <qscrollview.h>
26 #include <qcolordialog.h>
32 #include "utilities.h"
36 #define DLG_SIZE_WIDTH 500
37 #define DLG_SIZE_HEIGHT 400
38 #define MAX_LINE_WIDTH 100
39 #define MARGIN_SIZE 11
40 #define SPACING_SIZE 6
45 SPlot2d_SetupPlot2dDlg::SPlot2d_SetupPlot2dDlg( _PTR(SObject) object, QWidget* parent )
47 "SPlot2d_SetupPlot2dDlg",
49 WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
51 setCaption( tr("TLT_SETUP_PLOT2D") );
52 setSizeGripEnabled( TRUE );
53 QGridLayout* topLayout = new QGridLayout( this );
54 topLayout->setSpacing( SPACING_SIZE );
55 topLayout->setMargin( MARGIN_SIZE );
57 myItems.setAutoDelete( false );
62 myView = new QScrollView( this );
63 QFrame* frame = new QFrame( myView );
64 frame->setFrameStyle( QFrame::Plain | QFrame::NoFrame );
65 QGridLayout* frameLayout = new QGridLayout( frame, 1, 12 );
66 frameLayout->setMargin( MARGIN_SIZE ); frameLayout->setSpacing( SPACING_SIZE );
70 QLabel* labAxis = new QLabel( tr( "AXIS_LBL" ), frame );
71 QLabel* labData = new QLabel( tr( "DATA_LBL" ), frame );
72 QLabel* labUnit = new QLabel( tr( "UNITS_LBL" ), frame );
73 QLabel* labAttr = new QLabel( tr( "ATTRIBUTES_LBL" ), frame );
74 labAxis->setAlignment( AlignCenter );
75 labData->setAlignment( AlignCenter );
76 labUnit->setAlignment( AlignCenter );
77 labAttr->setAlignment( AlignCenter );
78 QFont font = labAxis->font(); font.setBold( true );
79 labAxis->setFont( font );
80 labData->setFont( font );
81 labUnit->setFont( font );
82 labAttr->setFont( font );
84 frameLayout->addMultiCellWidget( labAxis, 0, 0, 0, 1 );
85 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
86 frameLayout->addWidget( lin, 0, 2 );
87 frameLayout->addWidget( labData, 0, 3 );
88 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
89 frameLayout->addWidget( lin, 0, 4 );
90 frameLayout->addWidget( labUnit, 0, 5 );
91 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
92 frameLayout->addWidget( lin, 0, 6 );
93 frameLayout->addMultiCellWidget( labAttr, 0, 0, 7, 11 );
94 frameLayout->setColStretch( 12, 5 );
95 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::HLine | QFrame::Sunken );
96 frameLayout->addMultiCellWidget( lin, 1, 1, 0, 12 );
99 _PTR(GenericAttribute) anAttr;
100 _PTR(AttributeTableOfInteger) tblIntAttr;
101 _PTR(AttributeTableOfReal) tblRealAttr;
103 /* Try table of integer */
104 if ( myObject->FindAttribute( anAttr, "AttributeTableOfInteger" ) ) {
108 int nbRows = tblIntAttr->GetNbRows() ;
109 vector<string> rowTitles = tblIntAttr->GetRowTitles();
110 vector<string> rowUnits = tblIntAttr->GetRowUnits();
111 for ( int i = 0; i < nbRows; i++ ) {
112 SPlot2d_ItemContainer* item = new SPlot2d_ItemContainer( this );
113 item->createWidgets( frame );
114 frameLayout->addWidget( item->myHBtn, row, 0 );
115 frameLayout->addWidget( item->myVBtn, row, 1 );
116 frameLayout->addWidget( item->myTitleLab, row, 3 );
117 if ( rowTitles.size() > 0 )
118 item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
119 frameLayout->addWidget( item->myUnitLab, row, 5 );
120 if ( rowUnits.size() > 0 )
121 item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
122 frameLayout->addWidget( item->myAutoCheck, row, 7 );
123 frameLayout->addWidget( item->myLineCombo, row, 8 );
124 frameLayout->addWidget( item->myLineSpin, row, 9 );
125 frameLayout->addWidget( item->myMarkerCombo, row, 10 );
126 frameLayout->addWidget( item->myColorBtn, row, 11 );
127 connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
128 connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
129 myItems.append( item );
134 MESSAGE("SPlot2d_SetupPlot2dDlg::SPlot2d_SetupPlot2dDlg : Exception has been caught (int)!!!");
138 /* Try table of real */
139 else if ( myObject->FindAttribute( anAttr, "AttributeTableOfReal" ) ) {
140 tblRealAttr = anAttr;
143 int nbRows = tblRealAttr->GetNbRows() ;
144 vector<string> rowTitles = tblRealAttr->GetRowTitles();
145 vector<string> rowUnits = tblRealAttr->GetRowUnits();
146 for ( int i = 0; i < nbRows; i++ ) {
147 SPlot2d_ItemContainer* item = new SPlot2d_ItemContainer( this );
148 item->createWidgets( frame );
149 frameLayout->addWidget( item->myHBtn, row, 0 );
150 frameLayout->addWidget( item->myVBtn, row, 1 );
151 frameLayout->addWidget( item->myTitleLab, row, 3 );
152 if ( rowTitles.size() > 0 )
153 item->myTitleLab->setText( QString( rowTitles[ i ].c_str() ) );
154 frameLayout->addWidget( item->myUnitLab, row, 5 );
155 if ( rowUnits.size() > 0 )
156 item->myUnitLab->setText( QString( rowUnits[ i ].c_str() ) );
157 frameLayout->addWidget( item->myAutoCheck, row, 7 );
158 frameLayout->addWidget( item->myLineCombo, row, 8 );
159 frameLayout->addWidget( item->myLineSpin, row, 9 );
160 frameLayout->addWidget( item->myMarkerCombo, row, 10 );
161 frameLayout->addWidget( item->myColorBtn, row, 11 );
162 connect( item, SIGNAL( horToggled( bool ) ), this, SLOT( onHBtnToggled( bool ) ) );
163 connect( item, SIGNAL( verToggled( bool ) ), this, SLOT( onVBtnToggled( bool ) ) );
164 myItems.append( item );
169 MESSAGE("SPlot2d_SetupPlot2dDlg::SPlot2d_SetupPlot2dDlg : Exception has been caught (real)!!!");
173 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
174 frameLayout->addMultiCellWidget( lin, 2, row+1, 2, 2 );
175 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
176 frameLayout->addMultiCellWidget( lin, 2, row+1, 4, 4 );
177 lin = new QFrame( frame ); lin->setFrameStyle( QFrame::VLine | QFrame::Sunken );
178 frameLayout->addMultiCellWidget( lin, 2, row+1, 6, 6 );
179 frameLayout->setRowStretch( row+1, 5 );
181 myView->addChild( frame, 0, 0 );
182 myView->setResizePolicy( QScrollView::AutoOneFit );
184 myView->setMinimumWidth( frame->sizeHint().width() + MARGIN_SIZE * 2 );
186 /* OK/Cancel buttons */
187 myOkBtn = new QPushButton( tr( "BUT_OK" ), this, "buttonOk" );
188 myOkBtn->setAutoDefault( TRUE );
189 myOkBtn->setDefault( TRUE );
190 myCancelBtn = new QPushButton( tr( "BUT_CANCEL" ), this, "buttonCancel" );
191 myCancelBtn->setAutoDefault( TRUE );
193 topLayout->addMultiCellWidget( myView, 0, 0, 0, 2 );
194 topLayout->addWidget( myOkBtn, 1, 0 );
195 topLayout->setColStretch( 1, 5 );
196 topLayout->addWidget( myCancelBtn, 1, 2 );
198 connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( accept() ) );
199 connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
203 /* Center widget inside it's parent widget */
204 resize( DLG_SIZE_WIDTH, DLG_SIZE_HEIGHT );
205 SUIT_Tools::centerWidget( this, parentWidget() );
210 SPlot2d_SetupPlot2dDlg::~SPlot2d_SetupPlot2dDlg()
214 Gets curves info ( indexes of row data in the table for horizontal and verical axes )
216 void SPlot2d_SetupPlot2dDlg::getCurvesSource( int& horIndex, QValueList<int>& verIndexes )
218 /* collecting horizontal and vertical axis items */
221 for ( i = 0; i < myItems.count(); i++ ) {
222 if ( myItems.at( i )->isHorizontalOn() ) {
225 else if ( myItems.at( i )->isVerticalOn() ) {
226 verIndexes.append( i );
231 Gets curve attributes
233 bool SPlot2d_SetupPlot2dDlg::getCurveAttributes( const int vIndex,
240 if ( vIndex >= 0 && vIndex < myItems.count() ) {
241 isAuto = myItems.at( vIndex )->isAutoAssign();
242 marker = myItems.at( vIndex )->getMarker();
243 line = myItems.at( vIndex )->getLine();
244 lineWidth = myItems.at( vIndex )->getLineWidth();
245 color = myItems.at( vIndex )->getColor();
251 Creates and returns curves presentations
253 void SPlot2d_SetupPlot2dDlg::getCurves( QPtrList<Plot2d_Curve>& container )
255 _PTR(GenericAttribute) anAttr;
256 _PTR(AttributeTableOfInteger) tblIntAttr;
257 _PTR(AttributeTableOfReal) tblRealAttr;
259 /* clearing container contents */
262 /* collecting horizontal and vertical axis items */
265 QValueList<int> verIndex;
266 getCurvesSource( horIndex, verIndex );
267 if ( horIndex < 0 || verIndex.isEmpty() ) /* no curves can be created */
270 /* Try table of integer */
271 if ( myObject->FindAttribute( anAttr, "AttributeTableOfInteger" ) ) {
275 int nbCols = tblIntAttr->GetNbColumns() ;
276 vector<string> rowTitles = tblIntAttr->GetRowTitles();
277 vector<string> rowUnits = tblIntAttr->GetRowUnits();
279 for ( i = 0; i < verIndex.count(); i++ ) {
280 SPlot2d_Curve* curve = new SPlot2d_Curve();
282 if ( rowTitles.size() > 0 ) {
283 curve->setHorTitle( QString( rowTitles[ horIndex ].c_str() ) );
284 curve->setVerTitle( QString( rowTitles[ verIndex[i] ].c_str() ) );
287 if ( rowUnits.size() > 0 ) {
288 curve->setHorUnits( QString( rowUnits[ horIndex ].c_str() ) );
289 curve->setVerUnits( QString( rowUnits[ verIndex[i] ].c_str() ) );
293 for ( j = 1; j <= nbCols; j++ ) {
294 if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) )
297 if ( nbPoints > 0 ) {
298 double* xList = new double[ nbPoints ];
299 double* yList = new double[ nbPoints ];
300 for ( j = 1; j <= nbCols; j++ ) {
301 if ( tblIntAttr->HasValue( horIndex+1, j ) && tblIntAttr->HasValue( verIndex[i]+1, j ) ) {
302 xList[j-1] = tblIntAttr->GetValue( horIndex +1, j );
303 yList[j-1] = tblIntAttr->GetValue( verIndex[i]+1, j );
306 curve->setData( xList, yList, nbPoints );
309 curve->setLine( (Plot2d_Curve::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
310 curve->setMarker( (Plot2d_Curve::MarkerType)myItems.at( verIndex[i] )->getMarker() );
311 curve->setColor( myItems.at( verIndex[i] )->getColor() );
312 curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
313 // add curve into container
314 container.append( curve );
318 MESSAGE("SPlot2d_SetupPlot2dDlg::getCurves : Exception has been caught (int)!!!");
322 /* Try table of real */
323 else if ( myObject->FindAttribute( anAttr, "AttributeTableOfReal" ) ) {
324 tblRealAttr = anAttr;
327 int nbCols = tblRealAttr->GetNbColumns() ;
328 vector<string> rowTitles = tblRealAttr->GetRowTitles();
329 vector<string> rowUnits = tblRealAttr->GetRowUnits();
331 for ( i = 0; i < verIndex.count(); i++ ) {
332 SPlot2d_Curve* curve = new SPlot2d_Curve();
334 if ( rowTitles.size() > 0 ) {
335 curve->setHorTitle( QString( rowTitles[ horIndex ].c_str() ) );
336 curve->setVerTitle( QString( rowTitles[ verIndex[i] ].c_str() ) );
339 if ( rowUnits.size() > 0 ) {
340 curve->setHorUnits( QString( rowUnits[ horIndex ].c_str() ) );
341 curve->setVerUnits( QString( rowUnits[ verIndex[i] ].c_str() ) );
345 for ( j = 1; j <= nbCols; j++ ) {
346 if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) )
349 if ( nbPoints > 0 ) {
350 double* xList = new double[ nbPoints ];
351 double* yList = new double[ nbPoints ];
352 for ( j = 1; j <= nbCols; j++ ) {
353 if ( tblRealAttr->HasValue( horIndex+1, j ) && tblRealAttr->HasValue( verIndex[i]+1, j ) ) {
354 xList[j-1] = tblRealAttr->GetValue( horIndex +1, j );
355 yList[j-1] = tblRealAttr->GetValue( verIndex[i]+1, j );
358 curve->setData( xList, yList, nbPoints );
361 curve->setLine( (Plot2d_Curve::LineType)myItems.at( verIndex[i] )->getLine(), myItems.at( verIndex[i] )->getLineWidth() );
362 curve->setMarker( (Plot2d_Curve::MarkerType)myItems.at( verIndex[i] )->getMarker() );
363 curve->setColor( myItems.at( verIndex[i] )->getColor() );
364 curve->setAutoAssign( myItems.at( verIndex[i] )->isAutoAssign() );
365 // add curve into container
366 container.append( curve );
370 MESSAGE("SPlot2d_SetupPlot2dDlg::getCurves : Exception has been caught (real)!!!");
376 Slot, called when any <H> button is clicked
378 void SPlot2d_SetupPlot2dDlg::onHBtnToggled( bool on )
380 SPlot2d_ItemContainer* item = ( SPlot2d_ItemContainer* )sender();
382 for ( int i = 0; i < myItems.count(); i++ ) {
383 if ( myItems.at( i ) != item )
384 myItems.at( i )->setHorizontalOn( false );
390 Slot, called when any <V> button is clicked
392 void SPlot2d_SetupPlot2dDlg::onVBtnToggled( bool on )
394 SPlot2d_ItemContainer* item = ( SPlot2d_ItemContainer* )sender();
395 QPtrList<SPlot2d_ItemContainer> itemList;
396 itemList.setAutoDelete( false );
400 for ( i = 0; i < myItems.count(); i++ ) {
401 if ( myItems.at( i ) != item && !myItems.at( i )->isHorizontalOn() ) {
402 if ( myItems.at( i )->myUnitLab->text() == item->myUnitLab->text() ) {
403 if ( myItems.at( i )->isVerticalOn() )
406 itemList.append( myItems.at( i ) );
409 myItems.at( i )->setVerticalOn( false );
413 if ( totalOn == 0 && !itemList.isEmpty() &&
414 SUIT_MessageBox::info2( this,
416 tr( "QUE_WANT_SAME_UNITS" ),
420 for ( i = 0; i < itemList.count(); i++ ) {
421 itemList.at( i )->blockSignals( true );
422 itemList.at( i )->setVerticalOn( true );
423 itemList.at( i )->blockSignals( false );
430 Enables/disables buttons
432 void SPlot2d_SetupPlot2dDlg::enableControls()
436 for ( int i = 0; i < myItems.count(); i++ ) {
437 if ( myItems.at( i )->isHorizontalOn() ) {
443 for ( int i = 0; i < myItems.count(); i++ ) {
445 for ( i = 0; i < myItems.count(); i++ ) {
447 if ( myItems.at( i )->isVerticalOn() )
449 myItems.at( i )->enableWidgets( bHSet && myItems.at( i )->isVerticalOn() );
451 myOkBtn->setEnabled( bHSet && bVSet );
454 // ====================================================================================
458 SPlot2d_ItemContainer::SPlot2d_ItemContainer( QObject* parent, const char* name )
459 : QObject( parent, name ),
466 void SPlot2d_ItemContainer::createWidgets( QWidget* parentWidget )
468 myHBtn = new QToolButton( parentWidget );
469 myHBtn->setText( tr( "H" ) );
470 myHBtn->setToggleButton( true );
471 myHBtn->setOn( false );
473 myVBtn = new QToolButton( parentWidget );
474 myVBtn->setText( tr( "V" ) );
475 myVBtn->setToggleButton( true );
476 myVBtn->setOn( false );
478 myTitleLab = new QLabel( parentWidget );
479 myUnitLab = new QLabel( parentWidget );
480 myUnitLab->setAlignment( AlignCenter);
482 myAutoCheck = new QCheckBox( tr( "AUTO_CHECK_LBL" ), parentWidget );
483 myAutoCheck->setChecked( true );
485 myLineCombo = new QComboBox( false, parentWidget );
486 myLineCombo->insertItem( tr( "NONE_LINE_LBL" ) );
487 myLineCombo->insertItem( tr( "SOLID_LINE_LBL" ) );
488 myLineCombo->insertItem( tr( "DASH_LINE_LBL" ) );
489 myLineCombo->insertItem( tr( "DOT_LINE_LBL" ) );
490 myLineCombo->insertItem( tr( "DASHDOT_LINE_LBL" ) );
491 myLineCombo->insertItem( tr( "DAHSDOTDOT_LINE_LBL" ) );
492 myLineCombo->setCurrentItem( 1 ); // SOLID by default
494 myLineSpin = new QSpinBox( 0, MAX_LINE_WIDTH, 1, parentWidget );
495 myLineSpin->setValue( 0 ); // width = 0 by default
497 myMarkerCombo = new QComboBox( false, parentWidget );
498 myMarkerCombo->insertItem( tr( "NONE_MARKER_LBL" ) );
499 myMarkerCombo->insertItem( tr( "CIRCLE_MARKER_LBL" ) );
500 myMarkerCombo->insertItem( tr( "RECTANGLE_MARKER_LBL" ) );
501 myMarkerCombo->insertItem( tr( "DIAMOND_MARKER_LBL" ) );
502 myMarkerCombo->insertItem( tr( "DTRIANGLE_MARKER_LBL" ) );
503 myMarkerCombo->insertItem( tr( "UTRIANGLE_MARKER_LBL" ) );
504 myMarkerCombo->insertItem( tr( "LTRIANGLE_MARKER_LBL" ) );
505 myMarkerCombo->insertItem( tr( "RTRIANGLE_MARKER_LBL" ) );
506 myMarkerCombo->insertItem( tr( "CROSS_MARKER_LBL" ) );
507 myMarkerCombo->insertItem( tr( "XCROSS_MARKER_LBL" ) );
508 myMarkerCombo->setCurrentItem( 1 ); // CIRCLE by default
510 myColorBtn = new QToolButton( parentWidget );
511 myColorBtn->setMinimumWidth( 20 );
513 connect( myAutoCheck, SIGNAL( clicked() ), this, SLOT( onAutoChanged() ) );
514 connect( myColorBtn, SIGNAL( clicked() ), this, SLOT( onColorChanged() ) );
515 connect( myHBtn, SIGNAL( toggled( bool ) ), this, SLOT( onHVToggled( bool ) ) );
516 connect( myVBtn, SIGNAL( toggled( bool ) ), this, SLOT( onHVToggled( bool ) ) );
517 setColor( QColor( 0, 0, 0 ) );
521 Enables attributes widgets
523 void SPlot2d_ItemContainer::enableWidgets( bool enable )
529 Sets horizontal button's state on
531 void SPlot2d_ItemContainer::setHorizontalOn( bool on )
536 Gets horizontal button's state
538 bool SPlot2d_ItemContainer::isHorizontalOn() const
540 return myHBtn->isOn();
543 Sets vertical button's state on
545 void SPlot2d_ItemContainer::setVerticalOn( bool on )
550 Gets vertical button's state
552 bool SPlot2d_ItemContainer::isVerticalOn() const
554 return myVBtn->isOn();
557 Sets item AutoAssign flag state
559 void SPlot2d_ItemContainer::setAutoAssign( bool on )
561 myAutoCheck->setChecked( on );
565 Gets item AutoAssign flag state
567 bool SPlot2d_ItemContainer::isAutoAssign() const
569 return myAutoCheck->isChecked();
572 Sets item line type and width
574 void SPlot2d_ItemContainer::setLine( const int line, const int width )
576 myLineCombo->setCurrentItem( line );
581 int SPlot2d_ItemContainer::getLine() const
583 return myLineCombo->currentItem();
588 int SPlot2d_ItemContainer::getLineWidth() const
590 return myLineSpin->value();
593 Sets item marker type
595 void SPlot2d_ItemContainer::setMarker( const int marker )
597 myMarkerCombo->setCurrentItem( marker );
600 Gets item marker type
602 int SPlot2d_ItemContainer::getMarker() const
604 return myMarkerCombo->currentItem();
609 void SPlot2d_ItemContainer::setColor( const QColor& color )
611 QPalette pal = myColorBtn->palette();
612 QColorGroup ca = pal.active();
613 ca.setColor( QColorGroup::Button, color );
614 QColorGroup ci = pal.inactive();
615 ci.setColor( QColorGroup::Button, color );
617 pal.setInactive( ci );
618 myColorBtn->setPalette( pal );
623 QColor SPlot2d_ItemContainer::getColor() const
625 return myColorBtn->palette().active().button();
628 Enables/disables widgets
630 void SPlot2d_ItemContainer::updateState()
632 myAutoCheck->setEnabled( myEnabled );
633 myLineCombo->setEnabled( myEnabled && !myAutoCheck->isChecked() );
634 myLineSpin->setEnabled( myEnabled && !myAutoCheck->isChecked() );
635 myMarkerCombo->setEnabled( myEnabled && !myAutoCheck->isChecked() );
636 myColorBtn->setEnabled( myEnabled && !myAutoCheck->isChecked() );
639 Slot, called when user clickes <Auto assign> check box
641 void SPlot2d_ItemContainer::onAutoChanged()
644 emit( autoClicked() );
647 <Color> button slot, invokes color selection dialog box
649 void SPlot2d_ItemContainer::onColorChanged()
651 QColor color = QColorDialog::getColor( getColor() );
652 if ( color.isValid() ) {
657 <H> and <V> buttons slot
659 void SPlot2d_ItemContainer::onHVToggled( bool on )
661 const QObject* snd = sender();
662 if ( snd == myHBtn ) {
664 if ( myVBtn->isOn() ) {
665 // blockSignals( true );
666 myVBtn->setOn( false );
667 // blockSignals( false );
670 emit horToggled( on );
674 if ( myHBtn->isOn() ) {
675 // blockSignals( true );
676 myHBtn->setOn( false );
677 // blockSignals( false );
680 emit verToggled( on );