Salome HOME
Add Python Console to a list of VISU windows
[modules/visu.git] / src / VISUGUI / VisuGUI_PointsResultsDlg.cxx
1 //  VISU VISUGUI : GUI of VISU component
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : VisuGUI_PointsResultsDlg.cxx
25 //  Author : Laurent CORNABE & Hubert ROLLAND 
26 //  Module : VISU
27 //  $Header$
28
29 using namespace std;
30 #include "VisuGUI_PointsResultsDlg.h"
31 #include <qlayout.h>
32
33 /*!
34   Constructor
35 */
36 VisuGUI_PointsResultsDlg::VisuGUI_PointsResultsDlg (QWidget* parent, const char* name, bool modal, WFlags fl)
37     : QDialog(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
38 {
39   if (!name)
40     setName("VisuGUI_PointsResultsDlg");
41   setCaption(tr("DLG_TITLE"));
42   setSizeGripEnabled(TRUE);
43
44   QGridLayout* TopLayout = new QGridLayout( this ); 
45   TopLayout->setSpacing( 6 );
46   TopLayout->setMargin( 11 );
47
48   GroupLimit = new QGroupBox (this, "GroupLimit");
49   GroupLimit->setTitle(tr("RESULTS_GRP"));
50   GroupLimit->setColumnLayout(0, Qt::Vertical );
51   GroupLimit->layout()->setSpacing( 0 );
52   GroupLimit->layout()->setMargin( 0 );
53   QGridLayout* GroupLimitLayout = new QGridLayout( GroupLimit->layout() );
54   GroupLimitLayout->setAlignment( Qt::AlignTop );
55   GroupLimitLayout->setSpacing( 6 );
56   GroupLimitLayout->setMargin( 11 );
57
58   IdPoint = new QLabel( tr( "IdPoint" ), GroupLimit, "IdPoint" );
59   QFont IdPoint_font = IdPoint->font();
60   IdPoint_font.setBold( TRUE );
61   IdPoint->setFont( IdPoint_font ); 
62   IdPoint->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight );
63   IdPoint->setFrameStyle( QLabel::Box | QLabel::Plain );
64   IdPoint->setMargin( 5 );
65   QHBoxLayout* IdLayout = new QHBoxLayout;
66   IdLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ) );
67   IdLayout->addWidget( IdPoint );
68   GroupLimitLayout->addMultiCellLayout( IdLayout, 0, 0, 0, 2 );
69
70   CoordPointX = new QLabel( tr( "LBL_X" ), GroupLimit, "CoordPointX" );
71   CoordX = new QLineEdit( GroupLimit );
72   CoordX->setReadOnly( true );
73
74   CoordPointY = new QLabel( tr( "LBL_Y" ), GroupLimit, "CoordPointY" );
75   CoordY = new QLineEdit( GroupLimit );
76   CoordY->setReadOnly( true );
77
78   CoordPointZ = new QLabel( tr( "LBL_Z" ), GroupLimit, "CoordPointZ" );
79   CoordZ = new QLineEdit( GroupLimit );
80   CoordZ->setReadOnly( true );
81
82   QHBoxLayout* XYZLayout = new QHBoxLayout; XYZLayout->setMargin( 0 ); XYZLayout->setSpacing( 6 );
83   XYZLayout->addWidget( CoordPointX );
84   XYZLayout->addWidget( CoordX );
85   XYZLayout->addWidget( CoordPointY );
86   XYZLayout->addWidget( CoordY );
87   XYZLayout->addWidget( CoordPointZ );
88   XYZLayout->addWidget( CoordZ );
89   GroupLimitLayout->addMultiCellLayout( XYZLayout, 1, 1, 0, 2 );
90
91   GroupLimitLayout->addRowSpacing( 2, 10 );
92
93   Scalar_Results = new QLabel (tr("LBL_SCALAR_RESULT"), GroupLimit, "Scalar_Results");
94   GroupLimitLayout->addWidget( Scalar_Results, 3, 0 );
95   ScalValue = new QLabel (tr("LBL_SCALAR_VALUE"), GroupLimit, "ScalValue");
96   GroupLimitLayout->addWidget( ScalValue, 3, 1 );
97   GroupLimitLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 3, 2 );
98
99   Vector_Results = new QLabel (tr("LBL_VECTOR_RESULT"), GroupLimit, "Vector_Results");
100   GroupLimitLayout->addWidget( Vector_Results, 4, 0 );
101   VectTxt = new QLabel (tr("LBL_VECTOR_TXT"), GroupLimit, "VectTxt");
102   GroupLimitLayout->addWidget( VectTxt, 4, 1 );
103   GroupLimitLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 4, 2 );
104
105   GroupButtons = new QGroupBox( this, "GroupButtons" );
106   GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); 
107   //GroupButtons->setTitle( tr( ""  ) );
108   GroupButtons->setColumnLayout(0, Qt::Vertical );
109   GroupButtons->layout()->setSpacing( 0 );
110   GroupButtons->layout()->setMargin( 0 );
111   QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons->layout() );
112   GroupButtonsLayout->setAlignment( Qt::AlignTop );
113   GroupButtonsLayout->setSpacing( 6 );
114   GroupButtonsLayout->setMargin( 11 );
115
116   buttonOk = new QPushButton( tr( "&OK" ), GroupButtons, "buttonOk" );
117   buttonOk->setAutoDefault( TRUE );
118   buttonOk->setDefault( TRUE );
119   GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 0 );
120   GroupButtonsLayout->addWidget( buttonOk, 0, 1 );
121   GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 2 );
122   
123   TopLayout->addWidget( GroupLimit,   0, 0 );
124   TopLayout->addWidget( GroupButtons, 1, 0 );
125
126   // signals and slots connections
127   connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
128 }
129
130 /*!
131   Destructor
132 */
133 VisuGUI_PointsResultsDlg::~VisuGUI_PointsResultsDlg()
134 {
135 }
136
137
138
139
140
141
142