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