コード例 #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
ファイル: firefox.py プロジェクト: atsuoishimoto/tweetitloud
	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
ファイル: thunderbird.py プロジェクト: Alain-Ambazac/nvda
	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()
コード例 #7
0
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
ファイル: foobar2000.py プロジェクト: mai-codes/evoHax-nvda
 def event_gainFocus(self, obj, nextHandler):
     if not self.statusBar: self.statusBar = api.getStatusBar()
     nextHandler()
コード例 #9
0
ファイル: foobar2000.py プロジェクト: Alain-Ambazac/nvda
	def event_gainFocus(self, obj, nextHandler):
		if not self.statusBar: self.statusBar=api.getStatusBar()
		nextHandler()
コード例 #10
0
ファイル: emule.py プロジェクト: nvdaes/emule
	def statusBarObj(self, pos):
		statusBar = api.getStatusBar()
		if statusBar:
			return statusBar.getChild(pos).name