1 // VISU VISUGUI : GUI of VISU 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 : VisuGUI_CursorDlg.cxx
25 // Author : Laurent CORNABE & Hubert ROLLAND
30 #include "VisuGUI_CursorDlg.h"
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 )
40 setName( "VisuGUI_CursorDlg" );
42 setSizeGripEnabled( TRUE );
44 QGridLayout* TopLayout = new QGridLayout( this );
45 TopLayout->setSpacing( 6 );
46 TopLayout->setMargin( 11 );
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 );
57 Comment1 = new QLabel( tr( "TextLabel1" ), TopGroupBox, "Comment1" );
58 Comment1->setAlignment( QLabel::AlignCenter );
59 TopGroupBoxLayout->addWidget( Comment1, 0, 0 );
61 Comment2 = new QLabel( tr( "TextLabel2" ), TopGroupBox, "Comment2" );
62 Comment2->setAlignment( QLabel::AlignCenter );
63 TopGroupBoxLayout->addWidget( Comment2, 1, 0 );
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 );
75 GroupButtons = new QGroupBox( this, "GroupButtons" );
76 GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) );
77 GroupButtons->setTitle( tr( "" ) );
78 GroupButtons->setColumnLayout(0, Qt::Vertical );
79 GroupButtons->layout()->setSpacing( 0 );
80 GroupButtons->layout()->setMargin( 0 );
81 QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
82 GroupButtonsLayout->setAlignment( Qt::AlignTop );
83 GroupButtonsLayout->setSpacing( 6 );
84 GroupButtonsLayout->setMargin( 11 );
86 buttonOk = new QPushButton( tr( "&OK" ), GroupButtons, "buttonOk" );
87 buttonOk->setAutoDefault( TRUE );
88 buttonOk->setDefault( TRUE );
89 GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
90 GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
91 buttonCancel = new QPushButton( tr( "&Cancel" ) , GroupButtons, "buttonCancel" );
92 buttonCancel->setAutoDefault( TRUE );
93 GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
95 TopLayout->addWidget( TopGroupBox, 0, 0 );
96 TopLayout->addWidget( GroupButtons, 1, 0 );
98 // signals and slots connections
99 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
100 connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
106 VisuGUI_CursorDlg::~VisuGUI_CursorDlg()