Back to index

salome-gui  6.5.0
tubedialog_ui.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 # Copyright (C) 2010-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00003 #
00004 # This library is free software; you can redistribute it and/or
00005 # modify it under the terms of the GNU Lesser General Public
00006 # License as published by the Free Software Foundation; either
00007 # version 2.1 of the License.
00008 #
00009 # This library is distributed in the hope that it will be useful,
00010 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 # Lesser General Public License for more details.
00013 #
00014 # You should have received a copy of the GNU Lesser General Public
00015 # License along with this library; if not, write to the Free Software
00016 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00017 #
00018 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00019 #
00020 # Author : Guillaume Boulant (EDF)
00021 
00022 import sys
00023 from PyQt4 import QtGui
00024 from PyQt4 import QtCore
00025 
00026 
00027 class TubeDialog_UI(QtGui.QDialog):
00028     """
00029     This class defines the design of a Qt dialog box dedicated to the
00030     salome plugin examples. It presents a UI form that contains
00031     parameters for the spatial dimensions of geometrical object.  
00032     """
00033     def __init__(self, parent=None):
00034         QtGui.QDialog.__init__(self, parent)
00035         self.setupUi()
00036 
00037     def setupUi(self):
00038         self.setObjectName("Dialog")
00039         self.resize(400, 300)
00040         self.hboxlayout = QtGui.QHBoxLayout(self)
00041         self.hboxlayout.setMargin(9)
00042         self.hboxlayout.setSpacing(6)
00043         self.hboxlayout.setObjectName("hboxlayout")
00044         self.vboxlayout = QtGui.QVBoxLayout()
00045         self.vboxlayout.setMargin(0)
00046         self.vboxlayout.setSpacing(6)
00047         self.vboxlayout.setObjectName("vboxlayout")
00048         self.hboxlayout1 = QtGui.QHBoxLayout()
00049         self.hboxlayout1.setMargin(0)
00050         self.hboxlayout1.setSpacing(6)
00051         self.hboxlayout1.setObjectName("hboxlayout1")
00052         self.vboxlayout1 = QtGui.QVBoxLayout()
00053         self.vboxlayout1.setMargin(0)
00054         self.vboxlayout1.setSpacing(6)
00055         self.vboxlayout1.setObjectName("vboxlayout1")
00056         self.lblRadius = QtGui.QLabel(self)
00057         self.lblRadius.setObjectName("lblRadius")
00058         self.vboxlayout1.addWidget(self.lblRadius)
00059         self.lblLength = QtGui.QLabel(self)
00060         self.lblLength.setObjectName("lblLength")
00061         self.vboxlayout1.addWidget(self.lblLength)
00062         self.lblWidth = QtGui.QLabel(self)
00063         self.lblWidth.setObjectName("lblWidth")
00064         self.vboxlayout1.addWidget(self.lblWidth)
00065         self.hboxlayout1.addLayout(self.vboxlayout1)
00066         self.vboxlayout2 = QtGui.QVBoxLayout()
00067         self.vboxlayout2.setMargin(0)
00068         self.vboxlayout2.setSpacing(6)
00069         self.vboxlayout2.setObjectName("vboxlayout2")
00070         self.txtRadius = QtGui.QLineEdit(self)
00071         self.txtRadius.setObjectName("txtRadius")
00072         self.vboxlayout2.addWidget(self.txtRadius)
00073         self.txtLength = QtGui.QLineEdit(self)
00074         self.txtLength.setObjectName("txtLength")
00075         self.vboxlayout2.addWidget(self.txtLength)
00076         self.txtWidth = QtGui.QLineEdit(self)
00077         self.txtWidth.setObjectName("txtWidth")
00078         self.vboxlayout2.addWidget(self.txtWidth)
00079         self.hboxlayout1.addLayout(self.vboxlayout2)
00080         self.vboxlayout.addLayout(self.hboxlayout1)
00081         spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
00082         self.vboxlayout.addItem(spacerItem)
00083         self.buttonBox = QtGui.QDialogButtonBox(self)
00084         self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
00085         self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.NoButton|QtGui.QDialogButtonBox.Ok)
00086         self.buttonBox.setObjectName("buttonBox")
00087         self.vboxlayout.addWidget(self.buttonBox)
00088         self.hboxlayout.addLayout(self.vboxlayout)
00089 
00090         self.setWindowTitle("Tube construction")
00091         self.lblRadius.setText("Rayon")
00092         self.lblLength.setText("Longueur")
00093         self.lblWidth.setText("Epaisseur")
00094 
00095 #
00096 # ======================================================================
00097 # Unit test
00098 # ======================================================================
00099 #
00100 def main( args ):
00101     a = QtGui.QApplication(sys.argv)
00102     tubedialog = TubeDialog_UI()
00103     sys.exit(tubedialog.exec_())
00104 
00105 if __name__=="__main__":
00106     main(sys.argv)
00107