From eff285c8b10685511de2efec8ada0fbc290fb345 Mon Sep 17 00:00:00 2001 From: akl Date: Fri, 21 Mar 2008 07:58:53 +0000 Subject: [PATCH] Fix 2 problems: 1) only 2 digits after point in some spinboxes: use initSpinBox method. 2) Min and Max fields are not enabled if to select 'Use imposed range' button: add 'Use field range' and 'Use imposed range' buttons into QButtonGroup. --- src/VISUGUI/VisuGUI_Prs3dDlg.cxx | 42 ++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/VISUGUI/VisuGUI_Prs3dDlg.cxx b/src/VISUGUI/VisuGUI_Prs3dDlg.cxx index 46684c60..3625210a 100644 --- a/src/VISUGUI/VisuGUI_Prs3dDlg.cxx +++ b/src/VISUGUI/VisuGUI_Prs3dDlg.cxx @@ -626,6 +626,8 @@ VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane( QWidget* parent, bool thePreview ) RBFrange = new QRadioButton (tr("FIELD_RANGE_BTN"), aGB); RBIrange = new QRadioButton (tr("IMPOSED_RANGE_BTN"), aGB); + RangeGroup->addButton( RBFrange, 0 ); + RangeGroup->addButton( RBIrange, 1 ); RBFrange->setChecked( true ); MinEdit = new QLineEdit( aGB ); @@ -727,13 +729,15 @@ VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane( QWidget* parent, bool thePreview ) OriginGroupLayout->setMargin( 11 ); QLabel* XLabel = new QLabel (tr("LBL_X"), OriginGroup); - XSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, OriginGroup ); + XSpin = new QtxDoubleSpinBox( OriginGroup ); + VISU::initSpinBox(XSpin, 0.0, +1.0); XSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); XSpin->setMinimumWidth( 70 ); XSpin->setValue( 0.01 ); QLabel* YLabel = new QLabel (tr("LBL_Y"), OriginGroup); - YSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, OriginGroup ); + YSpin = new QtxDoubleSpinBox( OriginGroup ); + VISU::initSpinBox(YSpin, 0.0, +1.0); YSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); YSpin->setMinimumWidth( 70 ); YSpin->setValue( 0.01 ); @@ -757,13 +761,15 @@ VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane( QWidget* parent, bool thePreview ) DimGroupLayout->setMargin( 11 ); QLabel* WidthLabel = new QLabel (tr("LBL_WIDTH"), DimGroup); - WidthSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, DimGroup ); + WidthSpin = new QtxDoubleSpinBox( DimGroup ); + VISU::initSpinBox(WidthSpin, 0.0, +1.0); WidthSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); WidthSpin->setMinimumWidth( 70 ); WidthSpin->setValue( 0.1 ); QLabel* HeightLabel = new QLabel (tr("LBL_HEIGHT"), DimGroup); - HeightSpin = new QtxDoubleSpinBox( 0.0, 1.0, 0.1, DimGroup ); + HeightSpin = new QtxDoubleSpinBox( DimGroup ); + VISU::initSpinBox(HeightSpin, 0.0, +1.0); HeightSpin->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); HeightSpin->setMinimumWidth( 70 ); HeightSpin->setValue( 0.8 ); @@ -816,20 +822,20 @@ VisuGUI_ScalarBarPane::VisuGUI_ScalarBarPane( QWidget* parent, bool thePreview ) myBarDlg->setUnitsVisible(aResourceMgr->booleanValue("VISU", propertyName + "display_units", true)); // signals and slots connections =========================================== - connect( RangeGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( changeRange( int ) ) ); - connect( myModeCombo, SIGNAL( activated( int ) ), this, SLOT( changeScalarMode( int ) ) ); - connect( OrientGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( changeDefaults( int ) ) ); - connect( XSpin, SIGNAL( valueChanged( double ) ), this, SLOT( XYChanged( double ) ) ); - connect( YSpin, SIGNAL( valueChanged( double ) ), this, SLOT( XYChanged( double ) ) ); - connect( myTextBtn, SIGNAL( clicked() ), this, SLOT( onTextPref() ) ); - connect( myBarBtn, SIGNAL( clicked() ), this, SLOT( onBarPref() ) ); - connect( myPreviewCheck, SIGNAL( toggled( bool )), this, SLOT( onPreviewCheck( bool ) ) ); - connect( ColorSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() )); - connect( LabelSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() )); - connect( WidthSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() )); - connect( HeightSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() )); - connect( CBLog, SIGNAL( toggled( bool ) ), this, SLOT( updatePreview() )); - connect( myBarDlg, SIGNAL( updatePreview() ), this, SLOT( updatePreview() )); + connect( RangeGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( changeRange( int ) ) ); + connect( myModeCombo, SIGNAL( activated( int ) ), this, SLOT( changeScalarMode( int ) ) ); + connect( OrientGroup, SIGNAL( buttonClicked( int ) ), this, SLOT( changeDefaults( int ) ) ); + connect( XSpin, SIGNAL( valueChanged( double ) ), this, SLOT( XYChanged( double ) ) ); + connect( YSpin, SIGNAL( valueChanged( double ) ), this, SLOT( XYChanged( double ) ) ); + connect( myTextBtn, SIGNAL( clicked() ), this, SLOT( onTextPref() ) ); + connect( myBarBtn, SIGNAL( clicked() ), this, SLOT( onBarPref() ) ); + connect( myPreviewCheck, SIGNAL( toggled( bool )), this, SLOT( onPreviewCheck( bool ) ) ); + connect( ColorSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() )); + connect( LabelSpin, SIGNAL( valueChanged( int ) ), this, SLOT( updatePreview() )); + connect( WidthSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() )); + connect( HeightSpin, SIGNAL( valueChanged( double ) ), this, SLOT( updatePreview() )); + connect( CBLog, SIGNAL( toggled( bool ) ), this, SLOT( updatePreview() )); + connect( myBarDlg, SIGNAL( updatePreview() ), this, SLOT( updatePreview() )); changeDefaults( 0 ); myIsStoreTextProp = false; myBusy = false; -- 2.39.2