1 from DialogEdit import *
2 from PyQt4.QtGui import *
3 from PyQt4.QtCore import *
5 class EditPointDialog( DialogEdit ) :
7 def __init__( self, helpFile, controller, widgetDialogBox, model, oldPoint, pointRange ) :
10 #Initializing parent widget
11 DialogEdit.__init__( self, helpFile, controller, widgetDialogBox )
15 #Reading oldX and oldY
19 while oldPoint[i] != ':' :
23 for j in range( i+1, len(oldPoint) ) :
26 self.pointRange = pointRange
27 self.entryX.setText( oldX )
28 self.entryY.setText( oldY )
31 def addSpecialWidgets( self ) :
32 floatValidator = QDoubleValidator( self )
34 lX = QLabel( "X", self )
35 self.v11.addWidget( lX )
36 lY = QLabel( "Y", self )
37 self.v11.addWidget( lY )
39 self.entryX = QLineEdit( self )
40 self.entryX.setValidator( floatValidator )
41 self.v12.addWidget( self.entryX )
42 self.entryY = QLineEdit( self )
43 self.entryY.setValidator( floatValidator )
44 self.v12.addWidget( self.entryY )
47 def execApply( self ) :
48 pointRange = self.pointRange
49 newX = float( self.newX )
50 newY = float( self.newY )
52 self.getController().editPoint( self._model, newPoint, pointRange )
56 def retrieveUserEntries( self ) :
57 self.newX= str( self.entryX.text() )
58 self.newY= str( self.entryY.text() )
61 def checkUserEntries( self ) :
62 if self.newX == "" or self.newY == "" :
63 self.errMessage = 'All attributes must be filled'