]> SALOME platform Git repositories - modules/smesh.git/blob - SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.cxx
Salome HOME
bos #43434 [CEA][Windows] auto in function declaration
[modules/smesh.git] / SMESHGUI / SMESHGUI_Preferences_ScalarBarDlg.cxx
1 using namespace std;
2 //  File      : SMESHGUI_Preferences_ScalarBarDlg.cxx
3 //  Created   : Tue Jun 11 17:23:32 2002
4 //  Author    : Nicolas REJNERI
5
6 //  Project   : SALOME
7 //  Module    : SMESH
8 //  Copyright : Open CASCADE 2002
9 //  $Header$
10
11 #include "SMESHGUI_Preferences_ScalarBarDlg.h"
12
13 #include <qbuttongroup.h>
14 #include <qcheckbox.h>
15 #include <qcombobox.h>
16 #include <qgroupbox.h>
17 #include <qlabel.h>
18 #include <qlineedit.h>
19 #include <qpushbutton.h>
20 #include <qradiobutton.h>
21 #include <qspinbox.h>
22 #include <qlayout.h>
23 #include <qvariant.h>
24 #include <qtooltip.h>
25 #include <qwhatsthis.h>
26
27 /* 
28  *  Constructs a SMESHGUI_Preferences_ScalarBarDlg which is a child of 'parent', with the 
29  *  name 'name' and widget flags set to 'f' 
30  *
31  *  The dialog will by default be modeless, unless you set 'modal' to
32  *  TRUE to construct a modal dialog.
33  */
34 SMESHGUI_Preferences_ScalarBarDlg::SMESHGUI_Preferences_ScalarBarDlg( QWidget* parent,  const char* name, bool modal, WFlags fl )
35     : QDialog( parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
36 {
37     if ( !name )
38         setName( "SMESHGUI_Preferences_ScalarBarDlg" );
39     setCaption( tr( "SMESH_PREFERENCES_SCALARBAR"  ) );
40     setSizeGripEnabled( TRUE );
41
42     grid = new QGridLayout( this ); 
43     grid->setSpacing( 6 );
44     grid->setMargin( 11 );
45
46     /******************************************************************************/
47     Properties = new QGroupBox( this, "Properties" );
48     Properties->setTitle( tr( "SMESH_PROPERTIES"  ) );
49     Properties->setColumnLayout(0, Qt::Vertical );
50     Properties->layout()->setSpacing( 0 );
51     Properties->layout()->setMargin( 0 );
52     grid_4 = new QGridLayout( Properties->layout() );
53     grid_4->setAlignment( Qt::AlignTop );
54     grid_4->setSpacing( 6 );
55     grid_4->setMargin( 11 );
56
57     /* Font */
58     grid_5 = new QGridLayout; 
59     grid_5->setSpacing( 6 );
60     grid_5->setMargin( 0 );
61     TextLabel2 = new QLabel( Properties, "TextLabel2" );
62     TextLabel2->setText( tr( "SMESH_FONT"  ) );
63     grid_5->addWidget( TextLabel2, 0, 0 );
64     ComboBox1 = new QComboBox( FALSE, Properties, "ComboBox1" );
65     ComboBox1->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
66     ComboBox1->insertItem( tr( "SMESH_FONT_ARIAL" ) );
67     ComboBox1->insertItem( tr( "SMESH_FONT_COURIER" ) );
68     ComboBox1->insertItem( tr( "SMESH_FONT_TIMES" ) );
69     grid_5->addWidget( ComboBox1, 0, 1 );
70     grid_4->addLayout( grid_5, 0, 0 );
71     
72     /* Font attributes */
73     grid_6 = new QGridLayout; 
74     grid_6->setSpacing( 6 );
75     grid_6->setMargin( 0 );
76     Bold = new QCheckBox( Properties, "Bold" );
77     Bold->setText( tr( "SMESH_FONT_BOLD"  ) );
78     grid_6->addWidget( Bold, 0, 0 );
79     Italic = new QCheckBox( Properties, "Italic" );
80     Italic->setText( tr( "SMESH_FONT_ITALIC"  ) );
81     grid_6->addWidget( Italic, 0, 1 );
82     Shadow = new QCheckBox( Properties, "Shadow" );
83     Shadow->setText( tr( "SMESH_FONT_SHADOW"  ) );
84     grid_6->addWidget( Shadow, 0, 2 );
85     grid_4->addLayout( grid_6, 1, 0 );
86
87     grid_7 = new QGridLayout; 
88     grid_7->setSpacing( 6 );
89     grid_7->setMargin( 0 );
90     NumberColors = new QLabel( Properties, "NumberColors" );
91     NumberColors->setText( tr( "SMESH_NUMBEROFCOLORS"  ) );
92     grid_7->addWidget( NumberColors, 0, 0 );
93     SpinBoxColors = new QSpinBox( Properties, "SpinBoxColors" );
94     SpinBoxColors->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
95     SpinBoxColors->setMinValue( 1 );
96     grid_7->addWidget( SpinBoxColors, 0, 1 );
97     NumberLabels = new QLabel( Properties, "NumberLabels" );
98     NumberLabels->setText( tr( "SMESH_NUMBEROFLABELS"  ) );
99     grid_7->addWidget( NumberLabels, 1, 0 );
100     SpinBoxLabels = new QSpinBox( Properties, "SpinBoxLabels" );
101     SpinBoxLabels->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
102     SpinBoxLabels->setMinValue( 1 );
103     grid_7->addWidget( SpinBoxLabels, 1, 1 );
104     grid_4->addLayout( grid_7, 2, 0 );
105
106     grid->addWidget( Properties, 0, 0 );
107
108     /******************************************************************************/
109     ButtonGroup_Orientation = new QButtonGroup( this, "ButtonGroup_Orientation" );
110     ButtonGroup_Orientation->setTitle( tr( "SMESH_ORIENTATION"  ) );
111     ButtonGroup_Orientation->setColumnLayout(0, Qt::Vertical );
112     ButtonGroup_Orientation->layout()->setSpacing( 0 );
113     ButtonGroup_Orientation->layout()->setMargin( 0 );
114     grid_2 = new QGridLayout( ButtonGroup_Orientation->layout() );
115     grid_2->setAlignment( Qt::AlignTop );
116     grid_2->setSpacing( 6 );
117     grid_2->setMargin( 11 );
118     RadioVert = new QRadioButton( ButtonGroup_Orientation, "RadioVert" );
119     RadioVert->setText( tr( "SMESH_VERTICAL"  ) );
120     RadioHoriz = new QRadioButton( ButtonGroup_Orientation, "RadioHoriz" );
121     RadioHoriz->setText( tr( "SMESH_HORIZONTAL"  ) );
122     grid_2->addWidget( RadioVert, 0, 0 );
123     grid_2->addWidget( RadioHoriz, 0, 1 );
124
125     grid->addWidget( ButtonGroup_Orientation, 1, 0 );
126
127     /******************************************************************************/
128     GroupBox5 = new QGroupBox( this, "GroupBox5" );
129     GroupBox5->setTitle( tr( "SMESH_DIMENSIONS"  ) );
130     GroupBox5->setColumnLayout(0, Qt::Vertical );
131     GroupBox5->layout()->setSpacing( 0 );
132     GroupBox5->layout()->setMargin( 0 );
133     grid_11 = new QGridLayout( GroupBox5->layout() );
134     grid_11->setAlignment( Qt::AlignTop );
135     grid_11->setSpacing( 6 );
136     grid_11->setMargin( 11 );
137
138     LineEditWidth = new QLineEdit( GroupBox5, "LineEditWidth" );
139     grid_11->addWidget( LineEditWidth, 0, 0 );
140     Width = new QLabel( GroupBox5, "Width" );
141     Width->setText( tr( "SMESH_WIDTH"  ) );
142     grid_11->addWidget( Width, 0, 1 );
143     LineEditHeight = new QLineEdit( GroupBox5, "LineEditHeight" );
144     grid_11->addWidget( LineEditHeight, 1, 0 );
145     Height = new QLabel( GroupBox5, "Height" );
146     Height->setText( tr( "SMESH_HEIGHT"  ) );
147     grid_11->addWidget( Height, 1, 1 );
148
149     grid->addWidget( GroupBox5, 2, 0 );
150
151     /***************************************************************/
152     QGroupBox* GroupButtons = new QGroupBox( this, "GroupButtons" );
153     GroupButtons->setGeometry( QRect( 10, 10, 281, 48 ) ); 
154     GroupButtons->setTitle( tr( ""  ) );
155     GroupButtons->setColumnLayout(0, Qt::Vertical );
156     GroupButtons->layout()->setSpacing( 0 );
157     GroupButtons->layout()->setMargin( 0 );
158     grid_15 = new QGridLayout( GroupButtons->layout() );
159     grid_15->setAlignment( Qt::AlignTop );
160     grid_15->setSpacing( 6 );
161     grid_15->setMargin( 11 );
162     buttonOk = new QPushButton( GroupButtons, "buttonOk" );
163     buttonOk->setText( tr( "SMESH_BUT_OK"  ) );
164     buttonOk->setAutoDefault( TRUE );
165     buttonOk->setDefault( TRUE );
166     grid_15->addWidget( buttonOk, 0, 0 );
167     grid_15->addItem( new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
168     buttonCancel = new QPushButton( GroupButtons, "buttonCancel" );
169     buttonCancel->setText( tr( "SMESH_BUT_CANCEL"  ) );
170     buttonCancel->setAutoDefault( TRUE );
171     grid_15->addWidget( buttonCancel, 0, 2 );
172
173     grid->addWidget( GroupButtons, 3, 0 );
174
175     // signals and slots connections
176     connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
177     connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
178 }
179
180 /*  
181  *  Destroys the object and frees any allocated resources
182  */
183 SMESHGUI_Preferences_ScalarBarDlg::~SMESHGUI_Preferences_ScalarBarDlg()
184 {
185     // no need to delete child widgets, Qt does it all for us
186 }
187