1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
19 #include "STD_LoadStudiesDlg.h"
24 #include <qpushbutton.h>
26 #define SPACING_SIZE 6
27 #define MARGIN_SIZE 11
28 #define MIN_LISTBOX_WIDTH 150
29 #define MIN_LISTBOX_HEIGHT 100
32 * \brief creates a Load study dialog box
33 * \param parent a parent widget
34 * \param modal bool argument, if true the dialog box is a modal dialog box
35 * \param f style flags
38 STD_LoadStudiesDlg::STD_LoadStudiesDlg( QWidget* parent, bool modal, WFlags fl )
39 : QDialog( parent, "STD_LoadStudiesDlg", modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
42 setCaption( tr("DLG_LOAD_STUDY_CAPTION") );
43 setSizeGripEnabled( TRUE );
45 QGridLayout* aTopLayout = new QGridLayout(this);
46 aTopLayout->setMargin(MARGIN_SIZE);
47 aTopLayout->setSpacing(SPACING_SIZE);
49 TextLabel1 = new QLabel( this, "TextLabel1" );
50 TextLabel1->setGeometry( QRect( 11, 12, 297, 16 ) );
51 TextLabel1->setText( tr( "MEN_STUDIES_CHOICE" ) );
53 QHBoxLayout* aBtnLayout = new QHBoxLayout;
54 aBtnLayout->setSpacing( SPACING_SIZE );
55 aBtnLayout->setMargin( 0 );
57 buttonOk = new QPushButton( this, "buttonOk" );
58 buttonOk->setText( tr( "BUT_OK" ) );
59 buttonOk->setAutoDefault( true );
60 buttonOk->setDefault( true );
62 buttonCancel = new QPushButton( this, "buttonCancel" );
63 buttonCancel->setText( tr( "BUT_CANCEL" ) );
64 buttonCancel->setAutoDefault( true );
66 aBtnLayout->addWidget( buttonOk );
67 aBtnLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
68 aBtnLayout->addWidget( buttonCancel );
70 ListComponent = new QListBox( this, "ListComponent" );
71 ListComponent->setVScrollBarMode(QListBox::AlwaysOn);
72 ListComponent->setMinimumSize(MIN_LISTBOX_WIDTH, MIN_LISTBOX_HEIGHT);
73 ListComponent->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
74 ListComponent->setSelectionMode(QListBox::Single);
76 aTopLayout->addWidget(TextLabel1, 0, 0);
77 aTopLayout->addWidget(ListComponent, 1, 0);
78 aTopLayout->addLayout(aBtnLayout, 2, 0);
80 // signals and slots connections
81 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
82 connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );