1 #include "STD_LoadStudiesDlg.h"
6 #include <qpushbutton.h>
10 #define MARGIN_SIZE 11
11 #define MIN_LISTBOX_WIDTH 150
12 #define MIN_LISTBOX_HEIGHT 100
14 //================================================================================
16 * \brief creates a Load study dialog box
17 * \param parent a parent widget
18 * \param modal bool argument, if true the dialog box is a modal dialog box
19 * \param f style flags
22 //================================================================================
23 STD_LoadStudiesDlg::STD_LoadStudiesDlg( QWidget* parent, bool modal, WFlags fl )
24 : QDialog(parent, "STD_LoadStudiesDlg", modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
27 setCaption( tr("DLG_LOAD_STUDY_CAPTION") );
28 setSizeGripEnabled( TRUE );
30 QGridLayout* aTopLayout = new QGridLayout(this);
31 aTopLayout->setMargin(MARGIN_SIZE);
32 aTopLayout->setSpacing(SPACING_SIZE);
34 TextLabel1 = new QLabel( this, "TextLabel1" );
35 TextLabel1->setGeometry( QRect( 11, 12, 297, 16 ) );
36 TextLabel1->setText( tr( "MEN_STUDIES_CHOICE" ) );
38 QHBoxLayout* aBtnLayout = new QHBoxLayout;
39 aBtnLayout->setSpacing( SPACING_SIZE );
40 aBtnLayout->setMargin( 0 );
42 buttonOk = new QPushButton( this, "buttonOk" );
43 buttonOk->setText( tr( "BUT_OK" ) );
44 buttonOk->setAutoDefault( true );
45 buttonOk->setDefault( true );
47 buttonCancel = new QPushButton( this, "buttonCancel" );
48 buttonCancel->setText( tr( "BUT_CANCEL" ) );
49 buttonCancel->setAutoDefault( true );
51 aBtnLayout->addWidget( buttonOk );
52 aBtnLayout->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
53 aBtnLayout->addWidget( buttonCancel );
55 ListComponent = new QListBox( this, "ListComponent" );
56 ListComponent->setVScrollBarMode(QListBox::AlwaysOn);
57 ListComponent->setMinimumSize(MIN_LISTBOX_WIDTH, MIN_LISTBOX_HEIGHT);
58 ListComponent->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
59 ListComponent->setSelectionMode(QListBox::Single);
61 aTopLayout->addWidget(TextLabel1, 0, 0);
62 aTopLayout->addWidget(ListComponent, 1, 0);
63 aTopLayout->addLayout(aBtnLayout, 2, 0);
65 // signals and slots connections
66 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
67 connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );