Salome HOME
*** empty log message ***
[modules/visu.git] / src / VISUGUI / VisuGUI_CursorDlg.cxx
1 //  VISU VISUGUI : GUI of VISU component
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
21 //
22 //
23 //
24 //  File   : VisuGUI_CursorDlg.cxx
25 //  Author : Laurent CORNABE & Hubert ROLLAND
26 //  Module : VISU
27 //  $Header$
28
29 using namespace std;
30 #include "VisuGUI_CursorDlg.h"
31 #include <qlayout.h>
32
33 /*!
34   Constructor
35 */
36 VisuGUI_CursorDlg::VisuGUI_CursorDlg( QWidget* parent,  const char* name, bool modal, WFlags fl )
37     : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
38 {
39   if ( !name )
40     setName( "VisuGUI_CursorDlg" );
41   setCaption( name );
42   setSizeGripEnabled( TRUE );
43
44   QGridLayout* TopLayout = new QGridLayout( this );
45   TopLayout->setSpacing( 6 );
46   TopLayout->setMargin( 11 );
47
48   TopGroupBox = new QGroupBox( this, "TopGroupBox" );
49   TopGroupBox->setColumnLayout(0, Qt::Vertical );
50   TopGroupBox->layout()->setSpacing( 0 );
51   TopGroupBox->layout()->setMargin( 0 );
52   QGridLayout* TopGroupBoxLayout = new QGridLayout( TopGroupBox->layout() );
53   TopGroupBoxLayout->setAlignment( Qt::AlignTop );
54   TopGroupBoxLayout->setSpacing( 6 );
55   TopGroupBoxLayout->setMargin( 11 );
56
57   Comment1 = new QLabel( tr( "TextLabel1" ), TopGroupBox, "Comment1" );
58   Comment1->setAlignment( QLabel::AlignCenter );
59   TopGroupBoxLayout->addWidget( Comment1, 0, 0 );
60
61   Comment2 = new QLabel(  tr( "TextLabel2" ), TopGroupBox, "Comment2" );
62   Comment2->setAlignment( QLabel::AlignCenter );
63   TopGroupBoxLayout->addWidget( Comment2, 1, 0 );
64
65   SpinBox1 = new QSpinBox( 1, 100, 1, TopGroupBox, "SpinBox1" );
66   SpinBox1->setValue( 100 );
67   SpinBox1->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
68   SpinBox1->setMinimumSize( 70, 0 );
69   QHBoxLayout* SLayout = new QHBoxLayout;
70   SLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
71   SLayout->addWidget( SpinBox1 );
72   SLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
73   TopGroupBoxLayout->addLayout( SLayout, 2, 0 );
74
75   GroupButtons = new QGroupBox (this, "GroupButtons");
76   GroupButtons->setGeometry(QRect(10, 10, 281, 48));
77   GroupButtons->setColumnLayout(0, Qt::Vertical);
78   GroupButtons->layout()->setSpacing(0);
79   GroupButtons->layout()->setMargin(0);
80   QGridLayout* GroupButtonsLayout = new QGridLayout (GroupButtons->layout());
81   GroupButtonsLayout->setAlignment(Qt::AlignTop);
82   GroupButtonsLayout->setSpacing(6);
83   GroupButtonsLayout->setMargin(11);
84
85   buttonOk = new QPushButton (tr("&OK"), GroupButtons, "buttonOk");
86   buttonOk->setAutoDefault(TRUE);
87   buttonOk->setDefault(TRUE);
88   GroupButtonsLayout->addWidget(buttonOk, 0, 0);
89
90   GroupButtonsLayout->addItem(new QSpacerItem (5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, 1);
91
92   buttonCancel = new QPushButton(tr("&Cancel") , GroupButtons, "buttonCancel");
93   buttonCancel->setAutoDefault(TRUE);
94   GroupButtonsLayout->addWidget(buttonCancel, 0, 2);
95
96   TopLayout->addWidget(TopGroupBox,  0, 0);
97   TopLayout->addWidget(GroupButtons, 1, 0);
98
99   // signals and slots connections
100   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
101   connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
102 }
103
104 /*!
105   Destructor
106 */
107 VisuGUI_CursorDlg::~VisuGUI_CursorDlg()
108 {
109 }