]> SALOME platform Git repositories - tools/sat.git/blob - data/templates/PythonComponent/src/Dialog/EditPointDialog.py
Salome HOME
Debian/Trixie: sat generate a lot of warnings: https://github.com/SalomePlatform...
[tools/sat.git] / data / templates / PythonComponent / src / Dialog / EditPointDialog.py
1 from DialogEdit import *
2 from qtsalome import *
3
4 class EditPointDialog( DialogEdit ) :
5
6    def __init__( self, helpFile, controller, widgetDialogBox, model, oldPoint, pointRange  ) :
7        """Constructor"""
8
9        #Initializing parent widget
10        DialogEdit.__init__( self, helpFile, controller, widgetDialogBox )
11
12        self._model = model
13
14        #Reading oldX and oldY
15        oldX = ""
16        oldY = ""
17        i = 0
18        while oldPoint[i] != ':' :
19           oldX += oldPoint[i]
20           i += 1
21           pass
22        for j in range( i+1, len(oldPoint) ) :
23           oldY += oldPoint[j]
24           pass
25        self.pointRange = pointRange
26        self.entryX.setText( oldX )
27        self.entryY.setText( oldY )
28        pass
29
30    def addSpecialWidgets( self ) :
31        floatValidator = QDoubleValidator( self )
32
33        lX = QLabel( "X", self )
34        self.v11.addWidget( lX )
35        lY = QLabel( "Y", self )
36        self.v11.addWidget( lY )
37
38        self.entryX = QLineEdit( self )
39        self.entryX.setValidator( floatValidator )
40        self.v12.addWidget( self.entryX )
41        self.entryY = QLineEdit( self )
42        self.entryY.setValidator( floatValidator )
43        self.v12.addWidget( self.entryY )
44        pass
45
46    def execApply( self ) :
47        pointRange = self.pointRange
48        newX = float( self.newX )
49        newY = float( self.newY )
50        newPoint = newX, newY
51        self.getController().editPoint( self._model, newPoint, pointRange )
52        return
53
54
55    def retrieveUserEntries( self ) :
56        self.newX= str( self.entryX.text() )
57        self.newY= str( self.entryY.text() )
58        pass
59
60    def checkUserEntries( self ) :
61        if self.newX == "" or self.newY == "" :
62           self.errMessage = 'All attributes must be filled'
63           return False
64        return True
65
66 pass