1 // SALOME SALOMEGUI : implementation of desktop and GUI kernel
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 : SALOMEGUI_LoadStudiesDlg.cxx
25 // Author : Nicolas REJNERI
29 #include "SALOMEGUI_LoadStudiesDlg.h"
34 #include <qpushbutton.h>
37 #define SPACING_SIZE 6
38 #define MARGIN_SIZE 11
39 #define MIN_LISTBOX_WIDTH 150
40 #define MIN_LISTBOX_HEIGHT 100
42 SALOMEGUI_LoadStudiesDlg::SALOMEGUI_LoadStudiesDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
43 : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
46 setName( "SALOMEGUI_LoadStudiesDlg" );
49 setSizeGripEnabled( TRUE );
51 QGridLayout* aTopLayout = new QGridLayout(this);
52 aTopLayout->setMargin(MARGIN_SIZE);
53 aTopLayout->setSpacing(SPACING_SIZE);
55 TextLabel1 = new QLabel( this, "TextLabel1" );
56 TextLabel1->setGeometry( QRect( 11, 12, 297, 16 ) );
57 TextLabel1->setText( tr( "MEN_STUDIES_CHOICE" ) );
59 QHBoxLayout* aBtnLayout = new QHBoxLayout;
60 aBtnLayout->setSpacing( SPACING_SIZE );
61 aBtnLayout->setMargin( 0 );
63 buttonOk = new QPushButton( this, "buttonOk" );
64 buttonOk->setText( tr( "BUT_OK" ) );
65 buttonOk->setAutoDefault( true );
66 buttonOk->setDefault( true );
68 buttonCancel = new QPushButton( this, "buttonCancel" );
69 buttonCancel->setText( tr( "BUT_CANCEL" ) );
70 buttonCancel->setAutoDefault( true );
72 aBtnLayout->addWidget( buttonOk );
73 aBtnLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
74 aBtnLayout->addWidget( buttonCancel );
76 ListComponent = new QListBox( this, "ListComponent" );
77 ListComponent->setVScrollBarMode(QListBox::AlwaysOn);
78 ListComponent->setMinimumSize(MIN_LISTBOX_WIDTH, MIN_LISTBOX_HEIGHT);
79 ListComponent->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
80 ListComponent->setSelectionMode(QListBox::Single);
82 aTopLayout->addWidget(TextLabel1, 0, 0);
83 aTopLayout->addWidget(ListComponent, 1, 0);
84 aTopLayout->addLayout(aBtnLayout, 2, 0);
86 // signals and slots connections
87 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
88 connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
92 * Destroys the object and frees any allocated resources
94 SALOMEGUI_LoadStudiesDlg::~SALOMEGUI_LoadStudiesDlg()
96 // no need to delete child widgets, Qt does it all for us