Beispiel #1
0
	def setToDisplaySaveUpdate( self, event = None ):
		"Set the preference values to the display, save the new values, then call the update function."
		for updatePreference in self.updatePreferences:
			updatePreference.setToDisplay()
		preferences.writePreferences( self )
		if self.updateFunction != None:
			self.updateFunction()
Beispiel #2
0
	def buttonOneReleased( self, event, shift = False ):
		"Move the viewpoint if the mouse was released."
		if self.buttonOnePressedCoordinate == None:
			return
		x = self.canvas.canvasx( event.x )
		y = self.canvas.canvasy( event.y )
		buttonOneReleasedCoordinate = complex( x, y )
		if abs( self.buttonOnePressedCoordinate - buttonOneReleasedCoordinate ) < 3:
			self.buttonOnePressedCoordinate = None
			self.canvas.delete( 'motion' )
			return
		latitudeLongitude = LatitudeLongitude( buttonOneReleasedCoordinate, self, shift )
		self.tableauPreferences.viewpointLatitude.value = latitudeLongitude.latitude
		self.tableauPreferences.viewpointLatitude.setStateToValue()
		self.tableauPreferences.viewpointLongitude.value = latitudeLongitude.longitude
		self.tableauPreferences.viewpointLongitude.setStateToValue()
		self.buttonOnePressedCoordinate = None
		preferences.writePreferences( self.tableauPreferences )
		self.update()
	def buttonRelease1( self, event, shift = False ):
		"The left button was released, <ButtonRelease-1> function."
		if self.buttonOnePressedCanvasCoordinate == None:
			return
		x = self.canvas.canvasx( event.x )
		y = self.canvas.canvasy( event.y )
		buttonOneReleasedCanvasCoordinate = complex( x, y )
		if abs( self.buttonOnePressedCanvasCoordinate - buttonOneReleasedCanvasCoordinate ) < 3:
			self.buttonOnePressedCanvasCoordinate = None
			self.canvas.delete( 'motion' )
			return
		latitudeLongitude = LatitudeLongitude( self.buttonOnePressedCanvasCoordinate, buttonOneReleasedCanvasCoordinate, self.window, shift )
		self.repository.viewpointLatitude.value = latitudeLongitude.latitude
		self.repository.viewpointLatitude.setStateToValue()
		self.repository.viewpointLongitude.value = latitudeLongitude.longitude
		self.repository.viewpointLongitude.setStateToValue()
		self.buttonOnePressedCanvasCoordinate = None
		preferences.writePreferences( self.repository )
		self.window.update()
		self.destroyEverything()
Beispiel #4
0
	def setToDisplaySave( self, event = None ):
		"Set the preference values to the display, save the new values."
		for menuEntity in self.menuEntities:
			if menuEntity in self.archive:
				menuEntity.setToDisplay()
		preferences.writePreferences( self )