Exemplo n.º 1
0
				# clear failed connect space
				scr.addstr(curses.LINES - 2, 0, "                                                                           ");
				scr.addstr(6, 0, response)
				scr.refresh()
			elif response:
				db = response
				connected = True
		
		# Click in Tables menu
		elif inTab == "Tables" and tableMenu.itemAt(y, x):
			tableMenu.selectOnlyItem(tableMenu.itemAt(y, x))
		
		# if the click was in the Query or Search input box
		if not inputBox.isHidden() and (y >= inputY and  y <= inputYmax and x >= inputX):
			# Get whatever the user enters into the textbox
			queryInput = inputBox.edit()
			
			#Display "results"
			resultsPane.reset()
			queryResults = db.executeQuery(queryInput)
			if queryResults != False:
				resultsPane.setResults(queryResults)
			else:
				resultsPane.setResults(["Error in query"])
			resultsPane.showResults(resultsPane.getPageNum())
			
			# Make the textbox clear when next clicked on
			inputBox.clear()

		# If the click is at the bottom of the Query or Seach screen 
		elif y == curses.LINES - 1 and (inTab == "Query" or inTab == "Search"):