X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ImmersibleZoneDlg.cxx;h=fecb29f8df47fb317e8d279610ae3f4455128244;hb=81c9f5cdf82909d0aebd2c491c50fa7516cc80b7;hp=b5f8a05e87e905c003cbe30e45a2932208d77fc3;hpb=84f8b4a57d3cdad820bc1333a5066699cd1c8ae3;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ImmersibleZoneDlg.cxx b/src/HYDROGUI/HYDROGUI_ImmersibleZoneDlg.cxx index b5f8a05e..fecb29f8 100644 --- a/src/HYDROGUI/HYDROGUI_ImmersibleZoneDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ImmersibleZoneDlg.cxx @@ -22,7 +22,6 @@ #include "HYDROGUI_ImmersibleZoneDlg.h" -#include "HYDROGUI_ColorWidget.h" #include "HYDROGUI_Tool.h" #include @@ -30,8 +29,6 @@ #include #include #include -#include -#include HYDROGUI_ImmersibleZoneDlg::HYDROGUI_ImmersibleZoneDlg( HYDROGUI_Module* theModule, const QString& theTitle ) : HYDROGUI_InputPanel( theModule, theTitle ) @@ -60,43 +57,11 @@ HYDROGUI_ImmersibleZoneDlg::HYDROGUI_ImmersibleZoneDlg( HYDROGUI_Module* theModu aPolyLayout->setSpacing( 5 ); aPolyLayout->addWidget( new QLabel( tr( "ZONE_POLYLINE" ), aPolylineFrame ) ); aPolyLayout->addWidget( myPolylines ); - - - QFrame* aFillingFrame = new QFrame( aParamGroup ); - QLabel* aFillingLabel = new QLabel( tr( "FILLING_COLOR" ), aFillingFrame ); - myFillingTransparent = new QRadioButton( tr( "TRANSPARENT" ), aFillingFrame ); - myFillingTransparent->setChecked( true ); - myFillingColor = new QRadioButton( tr( "COLOR" ), aFillingFrame ); - myFillingColorBox = new HYDROGUI_ColorWidget( aFillingFrame ); - - QGridLayout* aFillingLayout = new QGridLayout( aFillingFrame ); - aFillingLayout->setMargin( 0 ); - aFillingLayout->setSpacing( 5 ); - aFillingLayout->addWidget( aFillingLabel, 0, 0, 2, 1 ); - aFillingLayout->addWidget( myFillingTransparent, 0, 1 ); - aFillingLayout->addWidget( myFillingColor, 1, 1 ); - aFillingLayout->addWidget( myFillingColorBox, 1, 2 ); - - - myBorderColorGroup = new QGroupBox( tr( "BORDER_COLOR" ), mainFrame() ); - myBorderColorGroup->setCheckable( true ); - - myBorderColorBox = new HYDROGUI_ColorWidget( myBorderColorGroup ); - - QBoxLayout* aBorderColorLayout = new QHBoxLayout( myBorderColorGroup ); - aBorderColorLayout->setMargin( 5 ); - aBorderColorLayout->setSpacing( 5 ); - aBorderColorLayout->addWidget( new QLabel( tr( "COLOR" ), myBorderColorGroup ) ); - aBorderColorLayout->addWidget( myBorderColorBox ); - - + QBoxLayout* aParamLayout = new QVBoxLayout( aParamGroup ); aParamLayout->setMargin( 5 ); aParamLayout->setSpacing( 5 ); aParamLayout->addWidget( aPolylineFrame ); - aParamLayout->addWidget( aFillingFrame ); - aParamLayout->addWidget( myBorderColorGroup ); - QGroupBox* aBathGroup = new QGroupBox( tr( "ZONE_BATHYMETRY" ), mainFrame() ); @@ -119,11 +84,6 @@ HYDROGUI_ImmersibleZoneDlg::HYDROGUI_ImmersibleZoneDlg( HYDROGUI_Module* theModu // Connect signals and slots connect( myPolylines, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onZoneDefChanged() ) ); - connect( myFillingTransparent, SIGNAL( toggled( bool ) ), this, SLOT( onZoneDefChanged() ) ); - connect( myFillingColor, SIGNAL( toggled( bool ) ), this, SLOT( onZoneDefChanged() ) ); - connect( myFillingColorBox, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( onFillingColorChanged() ) ); - connect( myBorderColorGroup, SIGNAL( toggled( bool ) ), this, SLOT( onZoneDefChanged() ) ); - connect( myBorderColorBox, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( onZoneDefChanged() ) ); } HYDROGUI_ImmersibleZoneDlg::~HYDROGUI_ImmersibleZoneDlg() @@ -139,12 +99,6 @@ void HYDROGUI_ImmersibleZoneDlg::reset() myPolylines->clear(); myBathymetries->clear(); - myFillingTransparent->setChecked( true ); - myFillingColorBox->resetColor(); - - myBorderColorGroup->setChecked( false ); - myBorderColorBox->resetColor(); - blockSignals( isBlocked ); onZoneDefChanged(); @@ -209,59 +163,6 @@ QString HYDROGUI_ImmersibleZoneDlg::getBathymetryName() const return myBathymetries->currentText(); } -void HYDROGUI_ImmersibleZoneDlg::setFillingColor( const QColor& theColor ) -{ - bool isBlocked = blockSignals( true ); - - if( theColor.alpha() == 0 ) // transparent - myFillingTransparent->setChecked( true ); - else - myFillingColor->setChecked( true ); - - myFillingColorBox->setColor( theColor ); - - blockSignals( isBlocked ); - - onZoneDefChanged(); -} - -QColor HYDROGUI_ImmersibleZoneDlg::getFillingColor() const -{ - QColor aColor( 255, 255, 255, 0 ); // transparent - if( myFillingColor->isChecked() ) - aColor = myFillingColorBox->color(); - return aColor; -} - -void HYDROGUI_ImmersibleZoneDlg::setBorderColor( const QColor& theColor ) -{ - bool isBlocked = blockSignals( true ); - - bool isTransparent = theColor.alpha() == 0; - myBorderColorGroup->setChecked( !isTransparent ); - myBorderColorBox->setColor( !isTransparent ? theColor : QColor( Qt::black ) ); - - blockSignals( isBlocked ); - - onZoneDefChanged(); -} - -QColor HYDROGUI_ImmersibleZoneDlg::getBorderColor() const -{ - QColor aColor( Qt::transparent ); // transparent - if( myBorderColorGroup->isChecked() ) - aColor = myBorderColorBox->color(); - return aColor; -} - -void HYDROGUI_ImmersibleZoneDlg::onFillingColorChanged() -{ - if ( !myFillingColor->isChecked() ) - return; - - onZoneDefChanged(); -} - void HYDROGUI_ImmersibleZoneDlg::onZoneDefChanged() { if ( signalsBlocked() ) @@ -270,5 +171,3 @@ void HYDROGUI_ImmersibleZoneDlg::onZoneDefChanged() QString aPolylineName = getPolylineName(); emit CreatePreview( aPolylineName ); } - -