1 // GEOM GEOMGUI : GUI for Geometry component
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : GEOMBase_NbIsosDlg.cxx
30 #include "GEOMToolsGUI_NbIsosDlg.h"
31 #include "QAD_Tools.h"
34 #include <qpushbutton.h>
35 #include <qgroupbox.h>
39 //=================================================================================
40 // class : GEOMBase_NbIsosDlg()
41 // purpose : Constructs a GEOMBase_NbIsosDlg which is a child of 'parent', with the
42 // name 'name' and widget flags set to 'f'.
43 // The dialog will by default be modeless, unless you set 'modal' to
44 // TRUE to construct a modal dialog.
45 //=================================================================================
46 GEOMBase_NbIsosDlg::GEOMBase_NbIsosDlg(QWidget* parent, const char* name, bool modal, WFlags fl)
47 :QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
50 setName("GEOMBase_NbIsosDlg");
52 setSizeGripEnabled(TRUE);
53 QGridLayout* MyDialogLayout = new QGridLayout(this);
54 MyDialogLayout->setSpacing(6);
55 MyDialogLayout->setMargin(11);
57 /***************************************************************/
58 QGroupBox* GroupC1 = new QGroupBox( this, "GroupC1" );
59 GroupC1->setColumnLayout(0, Qt::Vertical );
60 GroupC1->layout()->setSpacing( 0 );
61 GroupC1->layout()->setMargin( 0 );
62 QGridLayout* GroupC1Layout = new QGridLayout( GroupC1->layout() );
63 GroupC1Layout->setAlignment( Qt::AlignTop );
64 GroupC1Layout->setSpacing( 6 );
65 GroupC1Layout->setMargin( 11 );
67 TextLabel1 = new QLabel( GroupC1, "TextLabel1" );
68 TextLabel1->setText( tr( "GEOM_MEN_ISOU") );
69 GroupC1Layout->addWidget( TextLabel1, 0, 0 );
71 SpinBoxU = new QSpinBox( GroupC1, "SpinBoxU" );
72 SpinBoxU->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
73 SpinBoxU->setMinValue( 0 );
74 SpinBoxU->setValue( 1 );
75 GroupC1Layout->addWidget( SpinBoxU, 0, 1 );
77 TextLabel2 = new QLabel( GroupC1, "TextLabel2" );
78 TextLabel2->setText( tr( "GEOM_MEN_ISOV") ) ;
79 GroupC1Layout->addWidget( TextLabel2, 0, 2 );
81 SpinBoxV = new QSpinBox( GroupC1, "SpinBoxV");
82 SpinBoxV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
83 SpinBoxV->setValue( 1 );
84 SpinBoxV->setMinValue( 0 );
85 GroupC1Layout->addWidget( SpinBoxV, 0, 3 );
87 /***************************************************************/
88 QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
89 GroupButtons->setColumnLayout(0, Qt::Vertical );
90 GroupButtons->layout()->setSpacing( 0 );
91 GroupButtons->layout()->setMargin( 0 );
92 QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
93 GroupButtonsLayout->setAlignment( Qt::AlignTop );
94 GroupButtonsLayout->setSpacing( 6 );
95 GroupButtonsLayout->setMargin( 11 );
97 buttonOk = new QPushButton( GroupButtons, "buttonOk" );
98 buttonOk->setText( tr( "GEOM_BUT_OK" ) ) ;
99 buttonOk->setAutoDefault( TRUE );
100 buttonOk->setDefault( TRUE );
101 GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
103 GroupButtonsLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
105 buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
106 buttonCancel->setText( tr( "GEOM_BUT_CANCEL" ) ) ;
107 buttonCancel->setAutoDefault( TRUE );
108 GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
109 /***************************************************************/
111 MyDialogLayout->addWidget(GroupC1, 0, 0);
112 MyDialogLayout->addWidget(GroupButtons, 1, 0);
115 // signals and slots connections
116 connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
117 connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
119 /* Move widget on the botton right corner of main widget */
120 QAD_Tools::centerWidget(this, parent);
124 //=================================================================================
125 // function : ~GEOMBase_NbIsosDlg()
126 // purpose : Destroys the object and frees any allocated resources
127 //=================================================================================
128 GEOMBase_NbIsosDlg::~GEOMBase_NbIsosDlg()
130 // no need to delete child widgets, Qt does it all for us