2 // File : SALOMEGUI_CloseDlg.cxx
3 // Created : Wed Feb 26 11:40:52 2003
4 // Author : Vasily RUSYAEV (vrv)
5 // Copyright : Open CASCADE
7 #include "SALOMEGUI_CloseDlg.h"
9 #include <qpushbutton.h>
10 #include <qhbuttongroup.h>
13 #include <qmessagebox.h>
16 SALOMEGUI_CloseDlg::SALOMEGUI_CloseDlg ( QWidget * parent, const char * name, bool modal, WFlags f )
17 : QDialog ( parent, "", TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
19 setSizeGripEnabled ( TRUE ) ;
20 setCaption( tr( "CAPTION" ) );
22 QVBoxLayout* m_vbL = new QVBoxLayout( this );
23 m_vbL->setMargin( 11 ); m_vbL->setSpacing( 6 );
25 QLabel* m_lIcon = new QLabel (this, "m_lDescr");
26 QPixmap pm = QMessageBox::standardIcon( QMessageBox::Warning );
27 m_lIcon->setPixmap( pm );
28 m_lIcon->setScaledContents( false );
29 m_lIcon->setAlignment( Qt::AlignCenter );
31 QLabel* m_lDescr = new QLabel (this, "m_lDescr");
32 m_lDescr->setText ( tr ("CLOSE_DESCRIPTION") );
33 m_lDescr->setAlignment( Qt::AlignCenter );
34 m_lDescr->setMinimumHeight( m_lDescr->sizeHint().height()*5 );
35 m_lDescr->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
37 QHBoxLayout* m_hl1 = new QHBoxLayout();
38 m_hl1->setMargin( 0 ); m_hl1->setSpacing( 6 );
39 m_hl1->addWidget( m_lIcon );
40 m_hl1->addWidget( m_lDescr );
42 m_pb1 = new QPushButton( tr ("SAVE_CLOSE"), this );
43 m_pb2 = new QPushButton( tr ("CLOSE"), this );
44 m_pb3 = new QPushButton( tr ("UNLOAD"), this );
45 m_pb4 = new QPushButton( tr ("CANCEL"), this );
47 QGridLayout* m_hl2 = new QGridLayout();
48 m_hl2->setMargin( 0 ); m_hl2->setSpacing( 6 );
49 m_hl2->addWidget( m_pb1, 0, 0 );
50 m_hl2->addWidget( m_pb2, 0, 1 );
51 m_hl2->addWidget( m_pb3, 0, 2 );
52 m_hl2->addColSpacing( 3, 10 );
53 m_hl2->setColStretch( 3, 5 );
54 m_hl2->addWidget( m_pb4, 0, 4 );
56 m_vbL->addLayout( m_hl1 );
57 m_vbL->addLayout( m_hl2 );
59 connect( m_pb1, SIGNAL( clicked() ), this, SLOT( onButtonClicked() ) );
60 connect( m_pb2, SIGNAL( clicked() ), this, SLOT( onButtonClicked() ) );
61 connect( m_pb3, SIGNAL( clicked() ), this, SLOT( onButtonClicked() ) );
62 connect( m_pb4, SIGNAL( clicked() ), this, SLOT( reject() ) );
65 void SALOMEGUI_CloseDlg::onButtonClicked()
67 QPushButton* btn = ( QPushButton* )sender();