Пример #1
0
 def script_sayLineNumber(self, gesture):
     #We're using two nested functioncalls. api.getStatusBarText(obj) and
     #api.getStatusBar(). api.getStatusBar() returns an NVDAObjects.NVDAObject,
     #and api.getStatusBarText(obj) returns the status bar text of
     #the given obj, if it's a status bar.
     #This is how we get the data to split for the line number.
     lineNumList = api.getStatusBarText(api.getStatusBar()).split()
     lineNum = lineNumList[2] + lineNumList[3]
     ui.message(lineNum)
Пример #2
0
	def event_stateChange(self, obj, nextHandler):
		if obj.role == controlTypes.ROLE_DOCUMENT and controlTypes.STATE_BUSY in obj.states and winUser.isWindowVisible(obj.windowHandle) and obj.isInForeground:
			statusBar = api.getStatusBar()
			if statusBar:
				statusText = api.getStatusBarText(statusBar)
				speech.cancelSpeech()
				speech.speakMessage(controlTypes.speechStateLabels[controlTypes.STATE_BUSY])
				speech.speakMessage(statusText)
				return
		nextHandler()
Пример #3
0
	def script_reportStatusLine(self,gesture):
		obj = api.getStatusBar()
		if not obj:
			ui.message(_("no status bar found"))
			return
		text = api.getStatusBarText(obj)

		if scriptHandler.getLastScriptRepeatCount()==0:
			ui.message(text)
		else:
			speech.speakSpelling(text)
		api.setNavigatorObject(obj)
Пример #4
0
 def event_stateChange(self, obj, nextHandler):
     if obj.role == controlTypes.ROLE_DOCUMENT and controlTypes.STATE_BUSY in obj.states and winUser.isWindowVisible(
             obj.windowHandle) and obj.isInForeground:
         statusBar = api.getStatusBar()
         if statusBar:
             statusText = api.getStatusBarText(statusBar)
             speech.cancelSpeech()
             speech.speakMessage(
                 controlTypes.stateLabels[controlTypes.STATE_BUSY])
             speech.speakMessage(statusText)
             return
     nextHandler()
Пример #5
0
	def event_gainFocus(self, obj, nextHandler):
		if obj.role == controlTypes.Role.DOCUMENT and controlTypes.State.BUSY in obj.states and winUser.isWindowVisible(obj.windowHandle):
			statusBar = api.getStatusBar()
			if statusBar:
				try:
					# The document loading status is contained in the second field of the status bar.
					statusText = statusBar.firstChild.next.name
				except:
					# Fall back to reading the entire status bar.
					statusText = api.getStatusBarText(statusBar)
				speech.speakMessage(controlTypes.stateLabels[controlTypes.State.BUSY])
				speech.speakMessage(statusText)
				return
		nextHandler()
Пример #6
0
	def event_gainFocus(self, obj, nextHandler):
		if obj.role == controlTypes.ROLE_DOCUMENT and controlTypes.STATE_BUSY in obj.states and winUser.isWindowVisible(obj.windowHandle):
			statusBar = api.getStatusBar()
			if statusBar:
				try:
					# The document loading status is contained in the second field of the status bar.
					statusText = statusBar.firstChild.next.name
				except:
					# Fall back to reading the entire status bar.
					statusText = api.getStatusBarText(statusBar)
				speech.speakMessage(controlTypes.stateLabels[controlTypes.STATE_BUSY])
				speech.speakMessage(statusText)
				return
		nextHandler()
def getStatusBarText():
    """Get the text from a status bar.
	@param obj: The status bar.
	@type obj: L{NVDAObjects.NVDAObject}
	@return: The status bar text.
	@rtype: str
	"""
    foreground = api.getForegroundObject()
    if foreground is None:
        return ""
    if (isinstance(foreground, UIA)
            and foreground.windowClassName == "CabinetWClass"
            and foreground.appModule.appName == "explorer"):
        return getWExplorerStatusBarText(foreground)
    obj = api.getStatusBar()
    if not obj:
        return ""
    text = obj.name or ""
    if text:
        text += " "
    return text + " ".join(chunk for child in obj.children[:-1]
                           for chunk in (child.name, child.value)
                           if chunk and isinstance(chunk, baseString)
                           and not chunk.isspace())  # noqa:E501
Пример #8
0
 def event_gainFocus(self, obj, nextHandler):
     if not self.statusBar: self.statusBar = api.getStatusBar()
     nextHandler()
Пример #9
0
	def event_gainFocus(self, obj, nextHandler):
		if not self.statusBar: self.statusBar=api.getStatusBar()
		nextHandler()
Пример #10
0
	def statusBarObj(self, pos):
		statusBar = api.getStatusBar()
		if statusBar:
			return statusBar.getChild(pos).name