Salome HOME
NRI : Correction 1.1a version.
[modules/visu.git] / src / VISUGUI / VisuGUI_CellsResultsDlg.cxx
1 using namespace std;
2 //  File      : VisuGUI_CellsResultsDlg.cxx
3 //  Created   : Wed Aug 01 10:23:06 2001
4 //  Author    : Laurent CORNABE & Hubert ROLLAND 
5 //  Project   : SALOME
6 //  Module    : VISUGUI
7 //  Copyright : PRINCIPIA
8 //  $Header$
9
10 #include "VisuGUI_CellsResultsDlg.h"
11 #include <qlayout.h>
12 #include <qheader.h>
13
14 /*!
15    Constructor
16 */
17 VisuGUI_CellsResultsDlg::VisuGUI_CellsResultsDlg( QWidget* parent,  const char* name, bool modal, WFlags fl )
18      : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
19 {
20   if ( !name )
21     setName( "VisuGUI_CellsResultsDlg" );
22   setCaption( tr( "Results on selected Cell" ) );
23   setSizeGripEnabled( TRUE );
24   
25   QGridLayout* TopLayout = new QGridLayout( this ); 
26   TopLayout->setSpacing( 6 );
27   TopLayout->setMargin( 11 );
28   
29   GroupLimit = new QGroupBox( this, "GroupLimit" );
30   GroupLimit->setTitle( tr( "Results on Cell" ) );
31   GroupLimit->setColumnLayout(0, Qt::Vertical );
32   GroupLimit->layout()->setSpacing( 0 );
33   GroupLimit->layout()->setMargin( 0 );
34   QGridLayout* GroupLimitLayout = new QGridLayout( GroupLimit->layout() );
35   GroupLimitLayout->setAlignment( Qt::AlignTop );
36   GroupLimitLayout->setSpacing( 6 );
37   GroupLimitLayout->setMargin( 11 );
38   
39   IdCell = new QLabel( tr( "IdCell" ), GroupLimit, "IdCell" );
40   QFont IdCell_font = IdCell->font();
41   IdCell_font.setBold( TRUE );
42   IdCell->setFont( IdCell_font ); 
43   IdCell->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight );
44   IdCell->setFrameStyle( QLabel::Box | QLabel::Plain );
45   IdCell->setMargin( 5 );
46   QHBoxLayout* IdLayout = new QHBoxLayout;
47   
48   IdLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ));
49   IdLayout->addWidget( IdCell );
50   GroupLimitLayout->addMultiCellLayout( IdLayout, 0, 0, 0, 2);
51
52   NbPoints = new QLabel( tr( "Number of Points :"), GroupLimit, "NbPoints" );
53   GroupLimitLayout->addWidget( NbPoints, 1, 0 );
54   NbPoint = new QLabel( tr( "NbPoints" ), GroupLimit, "NbPoint" );
55   NbPoint->setAlignment( AlignLeft );
56   GroupLimitLayout->addWidget( NbPoint, 1, 1 );
57   GroupLimitLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 1, 2 );
58
59   ListPoints = new QListView( GroupLimit, "ListPoints" );
60   ListPoints->setMinimumSize( 300, 120 );
61   ListPoints->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
62   ListPoints->addColumn( tr( "Point" ) );
63   ListPoints->addColumn( tr( "X" ) );
64   ListPoints->addColumn( tr( "Y" ) );
65   ListPoints->addColumn( tr( "Z" ) );
66   ListPoints->setAllColumnsShowFocus( true );
67   ListPoints->setShowToolTips( true );
68   ListPoints->setSelectionMode( QListView::Single );
69   ListPoints->header()->setStretchEnabled( true );
70   ListPoints->header()->setStretchEnabled( true, 0 );
71   ListPoints->header()->setStretchEnabled( true, 1 );
72   ListPoints->header()->setStretchEnabled( true, 2 );
73   ListPoints->header()->setStretchEnabled( true, 3 );
74   GroupLimitLayout->addMultiCellWidget( ListPoints, 2, 2, 0, 2 );
75
76   Scalar_Results = new QLabel( tr( "Scalar result :" ), GroupLimit, "Scalar_Results" );
77   GroupLimitLayout->addWidget( Scalar_Results, 3, 0 );
78   ScalValue = new QLabel( tr( "Scalar Value" ), GroupLimit, "ScalValue" );
79   ScalValue->setAlignment( AlignLeft );
80   GroupLimitLayout->addWidget( ScalValue, 3, 1 );
81   GroupLimitLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 3, 2 );
82
83   Vector_Results = new QLabel( tr( "Vector result :" ), GroupLimit, "Vector_Results" );
84   GroupLimitLayout->addWidget( Vector_Results, 4, 0 );
85   VectTxt = new QLabel( tr( "Vector Txt" ), GroupLimit, "VectTxt" );
86   VectTxt->setAlignment( AlignLeft );
87   GroupLimitLayout->addWidget( VectTxt, 4, 1 );
88   GroupLimitLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 4, 2 );
89
90   GroupButtons = new QGroupBox( this, "GroupButtons" );
91   GroupButtons->setColumnLayout(0, Qt::Vertical );
92   GroupButtons->layout()->setSpacing( 0 );
93   GroupButtons->layout()->setMargin( 0 );
94   QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
95   GroupButtonsLayout->setAlignment( Qt::AlignTop );
96   GroupButtonsLayout->setSpacing( 6 );
97   GroupButtonsLayout->setMargin( 11 );
98
99   buttonOk = new QPushButton( tr( "&OK" ), GroupButtons, "buttonOk" );
100   buttonOk->setAutoDefault( TRUE );
101   buttonOk->setDefault( TRUE );
102   GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 0 );
103   GroupButtonsLayout->addWidget( buttonOk, 0, 1 );
104   GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 2 );
105   
106   TopLayout->addWidget( GroupLimit,   0, 0 );
107   TopLayout->addWidget( GroupButtons, 1, 0 );
108
109   // signals and slots connections
110   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
111 }
112
113 /*!
114    Destructor
115 */
116 VisuGUI_CellsResultsDlg::~VisuGUI_CellsResultsDlg()
117 {
118 }