def event_liveRegionChange(self, obj, nextHandler):
if isinstance(obj, UIA) and obj.name != self._nameChangeCache:
automationID = obj.UIAElement.cachedAutomationID
try:
# Don't repeat the fact that update download/installation is in progress if progress bar beep is on.
if ((automationID == "SystemSettings_MusUpdate_UpdateStatus_DescriptionTextBlock" and obj.previous.value <= "0")
# For search progress bar, do not repeat it.
or (automationID == "ProgressBar")
# Do not announce "result not found" error unless have to.
or (automationID == "NoResultsFoundTextBlock" and obj.parent.UIAElement.cachedAutomationID == "StatusTextPopup")
# But announce individual update progress in build 16215 and later.
or ("ApplicableUpdate" in automationID and automationID.endswith("_ContextDescriptionTextBlock"))):
self._nameChangeCache = obj.name
# Until the spacing problem is fixed for update label...
if "ApplicableUpdate" in automationID and automationID.endswith("_ContextDescriptionTextBlock"):
ui.message(" ".join([obj.parent.name, obj.name]))
else:
ui.message(obj.name)
# And no, never allow double-speaking (an ugly hack).
return
except AttributeError:
pass
评论列表
文章目录