Salome HOME
9f3cbbac7fb0bcf643907ea58b49b6faa7f30dbc
[modules/geom.git] / src / GEOMBase / GEOMBase_DlgSkeleton.cxx
1 // Copyright (C) 2014-2023  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // GEOM GEOMGUI : GUI for Geometry component
21 // File   : GEOMBase_DlgSkeleton.cxx
22 // Author : Roman NIKOLAEV, Open CASCADE S.A.S.
23
24 #include "GEOMBase_DlgSkeleton.h"
25
26 //Qt includes
27 #include <QGridLayout>
28 #include <QGroupBox>
29 #include <QRadioButton>
30 #include <QLabel>
31 #include <QLineEdit>
32 #include <QCheckBox>
33 #include <QPushButton>
34
35
36 /*!
37   Constructor.
38 */
39 GEOMBase_DlgSkeleton::GEOMBase_DlgSkeleton( QWidget* parent, Qt::WindowFlags flags ) :
40   QWidget(parent,flags)
41 {
42   init();
43 }
44
45 /*!
46   Destructor.
47 */
48 GEOMBase_DlgSkeleton::~GEOMBase_DlgSkeleton( ) {
49
50 }
51
52 /*!
53   Initialize the widget
54 */
55 void GEOMBase_DlgSkeleton::init( ) {
56   // Main layout
57   gridLayout = new QGridLayout(this);
58
59   //Constructors group
60   GroupConstructors = new QGroupBox(this);
61   GroupConstructors->setObjectName(QString::fromUtf8("GroupConstructors"));
62   QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
63   sizePolicy.setHorizontalStretch(0);
64   sizePolicy.setVerticalStretch(0);
65   sizePolicy.setHeightForWidth(GroupConstructors->sizePolicy().hasHeightForWidth());
66   GroupConstructors->setSizePolicy(sizePolicy);
67   hboxLayout = new QHBoxLayout(GroupConstructors);
68
69   RadioButton1 = new QRadioButton(GroupConstructors);
70   hboxLayout->addWidget(RadioButton1);
71
72   RadioButton2 = new QRadioButton(GroupConstructors);
73   hboxLayout->addWidget(RadioButton2);
74   
75   RadioButton3 = new QRadioButton(GroupConstructors);
76   hboxLayout->addWidget(RadioButton3);
77
78   RadioButton4 = new QRadioButton(GroupConstructors);
79   hboxLayout->addWidget(RadioButton4);
80
81   RadioButton5 = new QRadioButton(GroupConstructors);
82   hboxLayout->addWidget(RadioButton5);
83   gridLayout->addWidget(GroupConstructors, 0, 0, 1, 1);
84
85   //Name group
86   GroupBoxName = new QGroupBox(this);
87   sizePolicy.setHeightForWidth(GroupBoxName->sizePolicy().hasHeightForWidth());
88   GroupBoxName->setSizePolicy(sizePolicy);
89   hboxLayout1 = new QHBoxLayout(GroupBoxName);
90   hboxLayout1->setContentsMargins(9, 9, 9, 9);
91
92   NameLabel = new QLabel(GroupBoxName);
93   NameLabel->setWordWrap(false);
94   hboxLayout1->addWidget(NameLabel);
95
96   ResultName = new QLineEdit(GroupBoxName);
97   hboxLayout1->addWidget(ResultName);
98   gridLayout->addWidget(GroupBoxName, 1, 0, 1, 1);
99
100   //Group box with the check-boxes
101   GroupMedium = new QWidget(this);
102   QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Expanding);
103   sizePolicy1.setHorizontalStretch(0);
104   sizePolicy1.setVerticalStretch(0);
105   sizePolicy1.setHeightForWidth(GroupMedium->sizePolicy().hasHeightForWidth());
106   GroupMedium->setSizePolicy(sizePolicy1);
107
108   gridLayout->addWidget(GroupMedium, 2, 0, 1, 1);
109   GroupBoxPublish = new QGroupBox(this);
110   vboxLayout = new QVBoxLayout(GroupBoxPublish);
111
112   CheckBoxRestoreSS = new QCheckBox(GroupBoxPublish);
113   vboxLayout->addWidget(CheckBoxRestoreSS);
114
115   CheckBoxAddPrefix = new QCheckBox(GroupBoxPublish);
116   vboxLayout->addWidget(CheckBoxAddPrefix);
117
118   CheckBoxPreview = new QCheckBox(GroupBoxPublish);
119   vboxLayout->addWidget(CheckBoxPreview);
120   gridLayout->addWidget(GroupBoxPublish, 3, 0, 1, 1);
121
122   //Group with buttons
123   GroupButtons = new QGroupBox(this);
124
125   QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Fixed);
126   sizePolicy2.setHorizontalStretch(0);
127   sizePolicy2.setVerticalStretch(0);
128   sizePolicy2.setHeightForWidth(GroupButtons->sizePolicy().hasHeightForWidth());
129   GroupButtons->setSizePolicy(sizePolicy2);
130
131   hboxLayout2 = new QHBoxLayout(GroupButtons);
132   hboxLayout2->setContentsMargins(9, 9, 9, 9);
133   buttonOk = new QPushButton(GroupButtons);
134   hboxLayout2->addWidget(buttonOk);
135
136   buttonApply = new QPushButton(GroupButtons);
137   hboxLayout2->addWidget(buttonApply);
138   
139   QSpacerItem* spacerItem = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
140   hboxLayout2->addItem(spacerItem);
141   
142   buttonCancel = new QPushButton(GroupButtons);
143   hboxLayout2->addWidget(buttonCancel);
144   
145   buttonHelp = new QPushButton(GroupButtons);
146   
147   hboxLayout2->addWidget(buttonHelp);
148   
149   gridLayout->addWidget(GroupButtons, 4, 0, 1, 1);
150   
151   setTabOrder(CheckBoxRestoreSS, CheckBoxAddPrefix);
152   setTabOrder(CheckBoxAddPrefix, CheckBoxPreview);
153   setTabOrder(CheckBoxPreview, buttonOk);
154   setTabOrder(buttonOk, buttonApply);
155   setTabOrder(buttonApply, buttonCancel);
156   setTabOrder(buttonCancel, buttonHelp);
157   setTabOrder(buttonHelp, RadioButton1);
158   setTabOrder(RadioButton1, RadioButton2);
159   setTabOrder(RadioButton2, RadioButton3);
160   setTabOrder(RadioButton3, RadioButton4);
161   setTabOrder(RadioButton4, RadioButton5);
162   setTabOrder(RadioButton5, ResultName);
163
164   buttonOk->setText(tr("A&pply and Close"));
165   buttonApply->setText("&Apply");
166   buttonCancel->setText("&Close");
167   buttonHelp->setText("&Help");
168 }