2 // File : SALOMEGUI_LoadStudiesDlg.cxx
3 // Created : Wed Apr 03 13:37:13 2002
4 // Author : Nicolas REJNERI
7 // Copyright : Open CASCADE 2002
10 #include "SALOMEGUI_LoadStudiesDlg.h"
15 #include <qpushbutton.h>
17 #define SPACING_SIZE 6
18 #define MARGIN_SIZE 11
19 #define MIN_LISTBOX_WIDTH 150
20 #define MIN_LISTBOX_HEIGHT 100
22 SALOMEGUI_LoadStudiesDlg::SALOMEGUI_LoadStudiesDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
23 : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
26 setName( "SALOMEGUI_LoadStudiesDlg" );
29 setSizeGripEnabled( TRUE );
31 QGridLayout* aTopLayout = new QGridLayout(this);
32 aTopLayout->setMargin(MARGIN_SIZE);
33 aTopLayout->setSpacing(SPACING_SIZE);
35 TextLabel1 = new QLabel( this, "TextLabel1" );
36 TextLabel1->setGeometry( QRect( 11, 12, 297, 16 ) );
37 TextLabel1->setText( tr( "MEN_STUDIES_CHOICE" ) );
39 QHBoxLayout* aBtnLayout = new QHBoxLayout;
40 aBtnLayout->setSpacing( SPACING_SIZE );
41 aBtnLayout->setMargin( 0 );
43 buttonOk = new QPushButton( this, "buttonOk" );
44 buttonOk->setText( tr( "BUT_OK" ) );
45 buttonOk->setAutoDefault( true );
46 buttonOk->setDefault( true );
48 buttonCancel = new QPushButton( this, "buttonCancel" );
49 buttonCancel->setText( tr( "BUT_CANCEL" ) );
50 buttonCancel->setAutoDefault( true );
52 aBtnLayout->addWidget( buttonOk );
53 aBtnLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
54 aBtnLayout->addWidget( buttonCancel );
56 ListComponent = new QListBox( this, "ListComponent" );
57 ListComponent->setVScrollBarMode(QListBox::AlwaysOn);
58 ListComponent->setMinimumSize(MIN_LISTBOX_WIDTH, MIN_LISTBOX_HEIGHT);
59 ListComponent->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
60 ListComponent->setSelectionMode(QListBox::Single);
62 aTopLayout->addWidget(TextLabel1, 0, 0);
63 aTopLayout->addWidget(ListComponent, 1, 0);
64 aTopLayout->addLayout(aBtnLayout, 2, 0);
66 // signals and slots connections
67 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
68 connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
72 * Destroys the object and frees any allocated resources
74 SALOMEGUI_LoadStudiesDlg::~SALOMEGUI_LoadStudiesDlg()
76 // no need to delete child widgets, Qt does it all for us