def script_clickExpandButton(self, gesture): if not self.inMainWindow(): gesture.send() return focus = api.getFocusObject() if getControlID(focus.windowHandle) in [ ctrlIdsDic["stationsList"], ctrlIdsDic["searchEdit"] ]: # focus in search edit box or stations list, we can't stay here name = clickButton("expandButton") else: name = clickButtonWithoutMoving("expandButton") if name: ui.message(name) # say if stations list is visible or not. time.sleep(1.0) h = findWindowNVDAObject("stationsList").windowHandle if not h or not winUser.isWindowVisible(h): ui.message( _("Search edit box and Stations list are not more visible") ) obj = api.getFocusObject() else: # now set focus on stations list obj = NVDAObjects.IAccessible.getNVDAObjectFromEvent(h, -4, 0) obj.setFocus() eventHandler.queueEvent("gainFocus", obj)
def callback(window, data): if ((visible is None or winUser.isWindowVisible(window) == visible) and (not controlID or winUser.getControlID(window) == controlID) and (not className or winUser.getClassName(window) == className)): result.append(window) return False return True
def callback(window, data): if ( (visible is None or winUser.isWindowVisible(window) == visible) and (not controlID or winUser.getControlID(window) == controlID) and (not className or winUser.getClassName(window) == className) ): result.append(window) return False return True
def findWindow(window): h = getWindow(getTopWindow(), firstChild) id = ctrlIdsDic[window] i = 70 while i: i = i - 1 if getControlID(h) == id: return h h = getWindow(h, nextWindow) return None
def findWindowNVDAObject(window): h = getWindow(getTopWindow(), firstChild) id = ctrlIdsDic[window] i = 70 while i: i = i - 1 if getControlID(h) == id: obj = NVDAObjects.IAccessible.getNVDAObjectFromEvent(h, -4, 0) return obj h = getWindow(h, nextWindow) return None
def _get_windowControlID(self): if not hasattr(self,"_windowControlID"): self._windowControlID=winUser.getControlID(self.windowHandle) return self._windowControlID