1 from DialogEdit import *
4 class EditPointDialog( DialogEdit ) :
6 def __init__( self, helpFile, controller, widgetDialogBox, model, oldPoint, pointRange ) :
9 #Initializing parent widget
10 DialogEdit.__init__( self, helpFile, controller, widgetDialogBox )
14 #Reading oldX and oldY
18 while oldPoint[i] != ':' :
22 for j in range( i+1, len(oldPoint) ) :
25 self.pointRange = pointRange
26 self.entryX.setText( oldX )
27 self.entryY.setText( oldY )
30 def addSpecialWidgets( self ) :
31 floatValidator = QDoubleValidator( self )
33 lX = QLabel( "X", self )
34 self.v11.addWidget( lX )
35 lY = QLabel( "Y", self )
36 self.v11.addWidget( lY )
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 )
46 def execApply( self ) :
47 pointRange = self.pointRange
48 newX = float( self.newX )
49 newY = float( self.newY )
51 self.getController().editPoint( self._model, newPoint, pointRange )
55 def retrieveUserEntries( self ) :
56 self.newX= str( self.entryX.text() )
57 self.newY= str( self.entryY.text() )
60 def checkUserEntries( self ) :
61 if self.newX == "" or self.newY == "" :
62 self.errMessage = 'All attributes must be filled'