1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SMESH SMESHGUI : GUI for SMESH component
23 // File : SMESHGUI_ConvToQuadDlg.cxx
24 // Author : Open CASCADE S.A.S.
27 #include "SMESHGUI_ConvToQuadDlg.h"
32 #include <QRadioButton>
33 #include <QButtonGroup>
36 #include <QHBoxLayout>
37 #include <QGridLayout>
42 SMESHGUI_ConvToQuadDlg::SMESHGUI_ConvToQuadDlg()
43 : SMESHGUI_Dialog( 0, false, true )
45 setWindowTitle( tr( "CAPTION" ) );
47 // Create top controls
50 setObjectPixmap( "SMESH", tr( "ICON_SELECT" ) );
51 createObject( tr( "MESH" ), mainFrame(), 0 );
54 myMedNdsOnGeom = new QCheckBox( tr( "MEDIUMNDS" ), mainFrame() );
57 myBGBox = new QGroupBox( mainFrame() );
58 myBG = new QButtonGroup( mainFrame() );
59 QVBoxLayout* aBGLayout = new QVBoxLayout( myBGBox );
60 aBGLayout->setMargin(MARGIN);
61 aBGLayout->setSpacing(SPACING);
63 myRB1 = new QRadioButton( tr( "RADIOBTN_1" ), myBGBox );
64 myRB2 = new QRadioButton( tr( "RADIOBTN_2" ), myBGBox );
66 aBGLayout->addWidget(myRB1);
67 aBGLayout->addWidget(myRB2);
68 myBG->addButton(myRB1, 0);
69 myBG->addButton(myRB2, 1);
70 myRB1->setChecked( true );
73 QGridLayout* aLay = new QGridLayout( mainFrame() );
75 aLay->setSpacing( 5 );
77 aLay->addWidget( objectWg( 0, Label ), 0, 0 );
78 aLay->addWidget( objectWg( 0, Btn ), 0, 1 );
79 aLay->addWidget( objectWg( 0, Control ), 0, 2 );
80 aLay->addWidget( myMedNdsOnGeom, 1, 0, 1, 3 );
81 aLay->addWidget( myBGBox, 2, 0, 1, 3 );
83 connect(myBG, SIGNAL( buttonClicked( int ) ), this, SIGNAL( onClicked( int ) ) );
86 SMESHGUI_ConvToQuadDlg::~SMESHGUI_ConvToQuadDlg()
90 bool SMESHGUI_ConvToQuadDlg::IsMediumNdsOnGeom() const
92 return !myMedNdsOnGeom->isChecked();
95 void SMESHGUI_ConvToQuadDlg::SetMediumNdsOnGeom(const bool theCheck)
97 myMedNdsOnGeom->setChecked(theCheck);
100 bool SMESHGUI_ConvToQuadDlg::IsEnabledCheck() const
102 return myMedNdsOnGeom->isEnabled();
105 void SMESHGUI_ConvToQuadDlg::SetEnabledCheck( const bool theCheck )
107 myMedNdsOnGeom->setEnabled( theCheck );
110 int SMESHGUI_ConvToQuadDlg::CurrentRB( )
112 return myBG->checkedId();
115 void SMESHGUI_ConvToQuadDlg::SetEnabledControls( const bool theCheck )
117 myBGBox->setEnabled( theCheck );
118 myMedNdsOnGeom->setEnabled( theCheck );
119 setButtonEnabled( theCheck, QtxDialog::OK | QtxDialog::Apply );
122 void SMESHGUI_ConvToQuadDlg::SetEnabledRB( const int idx, const bool theCheck )
126 myRB2->setEnabled( theCheck );
127 myRB1->setEnabled( !theCheck );
128 myRB1->setChecked( true );
132 myRB1->setEnabled( theCheck );
133 myRB2->setEnabled( !theCheck );
134 myRB2->setChecked( true );
136 emit onClicked( myBG->checkedId() );