Salome HOME
basic implementation of images operations support
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_TwoImagesDlg.cxx
1
2 #include <HYDROGUI_TwoImagesDlg.h>
3 #include <HYDROGUI_ObjSelector.h>
4 #include <HYDROGUI_ColorWidget.h>
5 #include <QLineEdit>
6 #include <QRadioButton>
7 #include <QLayout>
8
9 HYDROGUI_TwoImagesDlg::HYDROGUI_TwoImagesDlg( HYDROGUI_Module* theModule, const QString& theTitle )
10 : HYDROGUI_InputPanel( theModule, theTitle )
11 {
12   printf( "two images operation\n" );
13   myName = new QLineEdit();
14   myImage1 = new HYDROGUI_ObjSelector( module(), 0 );
15   myImage2 = new HYDROGUI_ObjSelector( module(), 0 );
16   myTransparent = new QRadioButton( tr( "TRANSPARENT" ) );
17   myTransparent->setChecked( true );
18   myColor = new QRadioButton( tr( "COLOR" ) );
19   myColorBox = new HYDROGUI_ColorWidget( 0 );
20
21   addWidget( tr( "NAME" ), myName );
22   addSeparator();
23   addWidget( tr( "IMAGE_1" ), myImage1 );
24   addWidget( tr( "IMAGE_2" ), myImage2 );
25
26   QFrame* aBackground = new QFrame();
27   QGridLayout* aLayout = new QGridLayout( aBackground );
28   aLayout->addWidget( myTransparent, 0, 0 );
29   aLayout->addWidget( myColor, 1, 0 );
30   aLayout->addWidget( myColorBox, 1, 1 );
31
32   addWidget( tr( "BACKGROUND" ), aBackground );
33   addSeparator();
34   setRowStretch();
35 }
36
37 HYDROGUI_TwoImagesDlg::~HYDROGUI_TwoImagesDlg()
38 {
39 }
40
41 void HYDROGUI_TwoImagesDlg::GetSelectedImages( QString& theName1, QString& theName2 ) const
42 {
43   theName1 = myImage1->GetName();
44   theName2 = myImage2->GetName();
45 }