Salome HOME
6755abe57e3890054997d1616d837fc63b94ea37
[modules/geom.git] / src / GEOMGUI / GeometryGUI_NbIsosDlg.cxx
1 using namespace std;
2 //  File      : GeometryGUI_NbIsosDlg.cxx
3 //  Created   : Wed Mar 13 12:27:28 2002
4 //  Author    : 
5 //  Project   : SALOME
6 //  Module    : GEOM
7 //  Copyright : OPEN CASCADE
8 //  $Header: 
9
10
11 #include "GeometryGUI_NbIsosDlg.h"
12 #include "GeometryGUI.h"
13 #include "QAD_Tools.h"
14
15 #include <qlabel.h>
16 #include <qpushbutton.h>
17 #include <qgroupbox.h>
18 #include <qlayout.h>
19 #include <qspinbox.h>
20
21 //=================================================================================
22 // class    : GeometryGUI_NbIsosDlg()
23 // purpose  : Constructs a GeometryGUI_NbIsosDlg which is a child of 'parent', with the 
24 //            name 'name' and widget flags set to 'f'.
25 //            The dialog will by default be modeless, unless you set 'modal' to
26 //            TRUE to construct a modal dialog.
27 //=================================================================================
28 GeometryGUI_NbIsosDlg::GeometryGUI_NbIsosDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
29     : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
30 {
31   if ( !name )
32     setName( "GeometryGUI_NbIsosDlg" );
33   setCaption( name );
34   setSizeGripEnabled( TRUE );
35   QGridLayout* MyDialogLayout = new QGridLayout( this ); 
36   MyDialogLayout->setSpacing( 6 );
37   MyDialogLayout->setMargin( 11 );
38   
39   /***************************************************************/
40   QGroupBox* GroupC1 = new QGroupBox( this, "GroupC1" );
41   GroupC1->setColumnLayout(0, Qt::Vertical );
42   GroupC1->layout()->setSpacing( 0 );
43   GroupC1->layout()->setMargin( 0 );
44   QGridLayout* GroupC1Layout = new QGridLayout( GroupC1->layout() );
45   GroupC1Layout->setAlignment( Qt::AlignTop );
46   GroupC1Layout->setSpacing( 6 );
47   GroupC1Layout->setMargin( 11 );
48   
49   TextLabel1 = new QLabel( GroupC1, "TextLabel1" );
50   TextLabel1->setText( tr( "GEOM_MEN_ISOU") );
51   GroupC1Layout->addWidget( TextLabel1, 0, 0 );
52   
53   SpinBoxU = new QSpinBox( GroupC1, "SpinBoxU" );
54   SpinBoxU->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
55   SpinBoxU->setMinValue( 1 );
56   SpinBoxU->setValue( 1 );
57   GroupC1Layout->addWidget( SpinBoxU, 0, 1 );
58
59   TextLabel2 = new QLabel( GroupC1, "TextLabel2" );
60   TextLabel2->setText( tr( "GEOM_MEN_ISOV") ) ;
61   GroupC1Layout->addWidget( TextLabel2, 0, 2 );
62
63   SpinBoxV = new QSpinBox( GroupC1, "SpinBoxV");
64   SpinBoxV->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
65   SpinBoxV->setValue( 1 );
66   SpinBoxV->setMinValue( 1 );
67   GroupC1Layout->addWidget( SpinBoxV, 0, 3 );
68   
69   /***************************************************************/
70   QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
71   GroupButtons->setColumnLayout(0, Qt::Vertical );
72   GroupButtons->layout()->setSpacing( 0 );
73   GroupButtons->layout()->setMargin( 0 );
74   QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
75   GroupButtonsLayout->setAlignment( Qt::AlignTop );
76   GroupButtonsLayout->setSpacing( 6 );
77   GroupButtonsLayout->setMargin( 11 );
78   
79   buttonOk = new QPushButton( GroupButtons, "buttonOk" );
80   buttonOk->setText( tr( "GEOM_BUT_OK" ) ) ;
81   buttonOk->setAutoDefault( TRUE );
82   buttonOk->setDefault( TRUE );
83   GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
84   
85   GroupButtonsLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
86   
87   buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
88   buttonCancel->setText( tr( "GEOM_BUT_CANCEL" ) ) ;
89   buttonCancel->setAutoDefault( TRUE );
90   GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
91   /***************************************************************/
92   
93   MyDialogLayout->addWidget( GroupC1,      0, 0 );
94   MyDialogLayout->addWidget( GroupButtons, 1, 0 );
95   
96   /* Retrieve GeomGUI */
97   myGeomGUI = GeometryGUI::GetGeometryGUI() ;
98   
99   // signals and slots connections
100   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
101   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
102   
103   /* Move widget on the botton right corner of main widget */
104   QAD_Tools::centerWidget( this, parent );
105 }
106
107
108 //=================================================================================
109 // function : ~GeometryGUI_NbIsosDlg()
110 // purpose  : Destroys the object and frees any allocated resources
111 //=================================================================================
112 GeometryGUI_NbIsosDlg::~GeometryGUI_NbIsosDlg()
113 {
114     // no need to delete child widgets, Qt does it all for us
115 }
116