2 #include <HYDROGUI_InputPanel.h>
3 #include <HYDROGUI_Module.h>
4 #include <CAM_Application.h>
5 #include <SUIT_Desktop.h>
9 HYDROGUI_InputPanel::HYDROGUI_InputPanel( HYDROGUI_Module* theModule, const QString& theTitle )
10 : QDockWidget( theModule->application()->desktop() ),
14 setWindowTitle( theTitle );
15 setAllowedAreas( Qt::RightDockWidgetArea );
17 QFrame* aFrame = new QFrame( this );
19 QVBoxLayout* aLayout = new QVBoxLayout( aFrame );
21 myMainFrame = new QFrame( this );
22 QGridLayout* aMainLayout = new QGridLayout( myMainFrame );
23 myBtnFrame = new QFrame( this );
24 aLayout->addWidget( myMainFrame, 1 );
25 aLayout->addWidget( myBtnFrame, 0 );
27 QHBoxLayout* aBtnsLayout = new QHBoxLayout( myBtnFrame );
28 aBtnsLayout->setMargin( 5 );
29 aBtnsLayout->setSpacing( 5 );
31 myApply = new QPushButton( tr( "APPLY" ), myBtnFrame ),
32 myCancel = new QPushButton( tr( "CANCEL" ), myBtnFrame );
33 myHelp = new QPushButton( tr( "HELP" ), myBtnFrame );
35 aBtnsLayout->addWidget( myApply, 0 );
36 aBtnsLayout->addWidget( myCancel, 0 );
37 aBtnsLayout->addStretch( 1 );
38 aBtnsLayout->addWidget( myHelp, 0 );
40 connect( myApply, SIGNAL( clicked() ), this, SLOT( OnApply() ) );
41 connect( myCancel, SIGNAL( clicked() ), this, SLOT( OnCancel() ) );
42 connect( myHelp, SIGNAL( clicked() ), this, SLOT( OnHelp() ) );
45 HYDROGUI_InputPanel::~HYDROGUI_InputPanel()
49 void HYDROGUI_InputPanel::OnApply()
53 void HYDROGUI_InputPanel::OnCancel()
57 void HYDROGUI_InputPanel::OnHelp()
61 void HYDROGUI_InputPanel::addWidget( const QString& theLabel, QWidget* theWidget )
63 QGridLayout* aMainLayout = dynamic_cast<QGridLayout*>( myMainFrame->layout() );
64 int aRow = aMainLayout->rowCount();
65 aMainLayout->addWidget( new QLabel( theLabel, this ), aRow, 0 );
66 aMainLayout->addWidget( theWidget, aRow, 1 );