Salome HOME
a01eb49dbc8e0cbf3e733aad8664894f7328e3ee
[modules/gui.git] / src / SalomeApp / pluginsdemo / tubedialog_ui.py
1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2010-2023  CEA, EDF, OPEN CASCADE
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 # Author : Guillaume Boulant (EDF)
21
22 import sys
23 from qtsalome import *
24
25
26 class TubeDialog_UI(QDialog):
27     """
28     This class defines the design of a Qt dialog box dedicated to the
29     salome plugin examples. It presents a UI form that contains
30     parameters for the spatial dimensions of geometrical object.  
31     """
32     def __init__(self, parent=None):
33         QDialog.__init__(self, parent)
34         self.setupUi()
35
36     def setupUi(self):
37         self.setObjectName("Dialog")
38         self.resize(400, 300)
39         self.hboxlayout = QHBoxLayout(self)
40         self.hboxlayout.setContentsMargins(9,9,9,9)
41         self.hboxlayout.setSpacing(6)
42         self.hboxlayout.setObjectName("hboxlayout")
43         self.vboxlayout = QVBoxLayout()
44         self.vboxlayout.setContentsMargins(0,0,0,0)
45         self.vboxlayout.setSpacing(6)
46         self.vboxlayout.setObjectName("vboxlayout")
47         self.hboxlayout1 = QHBoxLayout()
48         self.hboxlayout1.setContentsMargins(0,0,0,0)
49         self.hboxlayout1.setSpacing(6)
50         self.hboxlayout1.setObjectName("hboxlayout1")
51         self.vboxlayout1 = QVBoxLayout()
52         self.vboxlayout1.setContentsMargins(0,0,0,0)
53         self.vboxlayout1.setSpacing(6)
54         self.vboxlayout1.setObjectName("vboxlayout1")
55         self.lblRadius = QLabel(self)
56         self.lblRadius.setObjectName("lblRadius")
57         self.vboxlayout1.addWidget(self.lblRadius)
58         self.lblLength = QLabel(self)
59         self.lblLength.setObjectName("lblLength")
60         self.vboxlayout1.addWidget(self.lblLength)
61         self.lblWidth = QLabel(self)
62         self.lblWidth.setObjectName("lblWidth")
63         self.vboxlayout1.addWidget(self.lblWidth)
64         self.hboxlayout1.addLayout(self.vboxlayout1)
65         self.vboxlayout2 = QVBoxLayout()
66         self.vboxlayout2.setContentsMargins(0,0,0,0)
67         self.vboxlayout2.setSpacing(6)
68         self.vboxlayout2.setObjectName("vboxlayout2")
69         self.txtRadius = QLineEdit(self)
70         self.txtRadius.setObjectName("txtRadius")
71         self.vboxlayout2.addWidget(self.txtRadius)
72         self.txtLength = QLineEdit(self)
73         self.txtLength.setObjectName("txtLength")
74         self.vboxlayout2.addWidget(self.txtLength)
75         self.txtWidth = QLineEdit(self)
76         self.txtWidth.setObjectName("txtWidth")
77         self.vboxlayout2.addWidget(self.txtWidth)
78         self.hboxlayout1.addLayout(self.vboxlayout2)
79         self.vboxlayout.addLayout(self.hboxlayout1)
80         spacerItem = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
81         self.vboxlayout.addItem(spacerItem)
82         self.buttonBox = QDialogButtonBox(self)
83         self.buttonBox.setOrientation(Qt.Horizontal)
84         self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.NoButton|QDialogButtonBox.Ok)
85         self.buttonBox.setObjectName("buttonBox")
86         self.vboxlayout.addWidget(self.buttonBox)
87         self.hboxlayout.addLayout(self.vboxlayout)
88
89         self.setWindowTitle("Tube construction")
90         self.lblRadius.setText("Rayon")
91         self.lblLength.setText("Longueur")
92         self.lblWidth.setText("Epaisseur")
93
94 #
95 # ======================================================================
96 # Unit test
97 # ======================================================================
98 #
99 def main( args ):
100     a = QApplication(sys.argv)
101     tubedialog = TubeDialog_UI()
102     sys.exit(tubedialog.exec_())
103
104 if __name__=="__main__":
105     main(sys.argv)