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
25 * Copyright (C) 2005 CEA/DEN, EDF R&D
29 * File : SMESHGUI_ConvToQuadDlg.cxx
33 #include <SMESHGUI_ConvToQuadDlg.h>
34 #include <SUIT_Session.h>
36 #include <qgroupbox.h>
38 #include <qcheckbox.h>
39 #include <qradiobutton.h>
40 #include <qbuttongroup.h>
42 SMESHGUI_ConvToQuadDlg::SMESHGUI_ConvToQuadDlg()
43 : SMESHGUI_Dialog( 0, false, true )
46 setCaption( tr( "CAPTION" ) );
48 // Create top controls
49 QGroupBox* aGrp = new QGroupBox( 3, Qt::Horizontal, mainFrame() );
50 aGrp->setFrameStyle( QFrame::NoFrame );
51 aGrp->setInsideMargin( 0 );
54 createObject( tr( "MESH" ), aGrp, 0 );
57 myMedNdsOnGeom = new QCheckBox( tr( "MEDIUMNDS" ), mainFrame() );
60 myBG = new QButtonGroup( 2, Qt::Vertical, "", mainFrame() );
61 myBG->setExclusive( true );
63 myRB1 = new QRadioButton( myBG );
64 myRB1->setText( tr( "RADIOBTN_1" ) );
65 myRB1->setChecked( true );
67 myRB2 = new QRadioButton( myBG );
68 myRB2->setText( tr( "RADIOBTN_2" ) );
71 QVBoxLayout* aLay = new QVBoxLayout( mainFrame(), 5, 5 );
72 aLay->addWidget( aGrp );
73 aLay->addWidget( myMedNdsOnGeom );
74 aLay->addWidget( myBG );
76 connect(myBG, SIGNAL( clicked( int ) ), this, SIGNAL( onClicked( int ) ) );
79 SMESHGUI_ConvToQuadDlg::~SMESHGUI_ConvToQuadDlg()
83 bool SMESHGUI_ConvToQuadDlg::IsMediumNdsOnGeom() const
85 return !myMedNdsOnGeom->isChecked();
88 void SMESHGUI_ConvToQuadDlg::SetMediumNdsOnGeom(const bool theCheck)
90 myMedNdsOnGeom->setChecked(theCheck);
93 bool SMESHGUI_ConvToQuadDlg::IsEnabledCheck() const
95 return myMedNdsOnGeom->isEnabled();
98 void SMESHGUI_ConvToQuadDlg::SetEnabledCheck( const bool theCheck )
100 myMedNdsOnGeom->setEnabled( theCheck );
103 int SMESHGUI_ConvToQuadDlg::CurrentRB( )
105 return myBG->selectedId();
108 void SMESHGUI_ConvToQuadDlg::SetEnabledControls( const bool theCheck )
110 myBG->setEnabled( theCheck );
111 myMedNdsOnGeom->setEnabled( theCheck );
112 setButtonEnabled( theCheck, QtxDialog::OK | QtxDialog::Apply );
115 void SMESHGUI_ConvToQuadDlg::SetEnabledRB( const int idx, const bool theCheck )
119 myRB2->setEnabled( theCheck );
120 myRB1->setEnabled( !theCheck );
121 myRB1->setChecked( true );
125 myRB1->setEnabled( theCheck );
126 myRB2->setEnabled( !theCheck );
127 myRB2->setChecked( true );
129 emit onClicked( myBG->selectedId() );