1 // SMESH SMESHGUI : GUI for SMESH component
3 // Copyright (C) 2005 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 // File : SMESHGUI_ConvToQuadDlg.cxx
23 // 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 createObject( tr( "MESH" ), mainFrame(), 0 );
53 myMedNdsOnGeom = new QCheckBox( tr( "MEDIUMNDS" ), mainFrame() );
56 myBGBox = new QGroupBox( mainFrame() );
57 myBG = new QButtonGroup( mainFrame() );
58 QHBoxLayout* aBGLayout = new QHBoxLayout( myBGBox );
59 aBGLayout->setMargin(MARGIN);
60 aBGLayout->setSpacing(SPACING);
62 myRB1 = new QRadioButton( tr( "RADIOBTN_1" ), myBGBox );
63 myRB2 = new QRadioButton( tr( "RADIOBTN_2" ), myBGBox );
65 aBGLayout->addWidget(myRB1);
66 aBGLayout->addWidget(myRB2);
67 myBG->addButton(myRB1, 0);
68 myBG->addButton(myRB2, 1);
69 myRB1->setChecked( true );
72 QGridLayout* aLay = new QGridLayout( mainFrame() );
74 aLay->setSpacing( SPACING );
76 aLay->addWidget( objectWg( 0, Label ), 0, 0 );
77 aLay->addWidget( objectWg( 0, Btn ), 0, 1 );
78 aLay->addWidget( objectWg( 0, Control ), 0, 2 );
79 aLay->addWidget( myMedNdsOnGeom, 1, 0, 1, 3 );
80 aLay->addWidget( myBGBox, 2, 0, 1, 3 );
82 connect(myBG, SIGNAL( buttonClicked( int ) ), this, SIGNAL( onClicked( int ) ) );
85 SMESHGUI_ConvToQuadDlg::~SMESHGUI_ConvToQuadDlg()
89 bool SMESHGUI_ConvToQuadDlg::IsMediumNdsOnGeom() const
91 return !myMedNdsOnGeom->isChecked();
94 void SMESHGUI_ConvToQuadDlg::SetMediumNdsOnGeom(const bool theCheck)
96 myMedNdsOnGeom->setChecked(theCheck);
99 bool SMESHGUI_ConvToQuadDlg::IsEnabledCheck() const
101 return myMedNdsOnGeom->isEnabled();
104 void SMESHGUI_ConvToQuadDlg::SetEnabledCheck( const bool theCheck )
106 myMedNdsOnGeom->setEnabled( theCheck );
109 int SMESHGUI_ConvToQuadDlg::CurrentRB( )
111 return myBG->checkedId();
114 void SMESHGUI_ConvToQuadDlg::SetEnabledControls( const bool theCheck )
116 myBGBox->setEnabled( theCheck );
117 myMedNdsOnGeom->setEnabled( theCheck );
118 setButtonEnabled( theCheck, QtxDialog::OK | QtxDialog::Apply );
121 void SMESHGUI_ConvToQuadDlg::SetEnabledRB( const int idx, const bool theCheck )
125 myRB2->setEnabled( theCheck );
126 myRB1->setEnabled( !theCheck );
127 myRB1->setChecked( true );
131 myRB1->setEnabled( theCheck );
132 myRB2->setEnabled( !theCheck );
133 myRB2->setChecked( true );
135 emit onClicked( myBG->checkedId() );