Skip to content

Commit

Permalink
Merge branch 't5049'. Fixes #5049
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelDCurran committed Jun 25, 2015
2 parents 958344e + bc74d9e commit 6d3ef4b
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
14 changes: 14 additions & 0 deletions source/NVDAObjects/UIA/__init__.py
Expand Up @@ -693,6 +693,20 @@ def _get_positionInfo(self):
parentCount+=1
return info

def _get_controllerFor(self):
e=self.UIAElement.getCurrentPropertyValue(UIAHandler.UIA_ControllerForPropertyId)
if UIAHandler.handler.clientObject.checkNotSupported(e):
return None
a=e.QueryInterface(UIAHandler.IUIAutomationElementArray)
objList=[]
for index in xrange(a.length):
e=a.getElement(index)
e=e.buildUpdatedCache(UIAHandler.handler.baseCacheRequest)
obj=UIA(UIAElement=e)
if obj:
objList.append(obj)
return objList

def event_UIA_elementSelected(self):
self.event_stateChange()

Expand Down
4 changes: 4 additions & 0 deletions source/NVDAObjects/__init__.py
Expand Up @@ -391,6 +391,10 @@ def _get_description(self):
"""
return ""

def _get_controllerFor(self):
"""Retreaves the object/s that this object controls."""
return []

def _get_actionCount(self):
"""Retreaves the number of actions supported by this object."""
return 0
Expand Down
28 changes: 28 additions & 0 deletions source/appModules/searchui.py
@@ -0,0 +1,28 @@
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2015 NV Access Limited
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.

import appModuleHandler
import controlTypes
import api
import speech
from NVDAObjects.UIA import UIA

# Windows 10 Search UI suggestion list item
class SuggestionListItem(UIA):

role=controlTypes.ROLE_LISTITEM

def event_UIA_elementSelected(self):
focusControllerFor=api.getFocusObject().controllerFor
if len(focusControllerFor)>0 and focusControllerFor[0].appModule is self.appModule:
speech.cancelSpeech()
api.setNavigatorObject(self)
self.reportFocus()

class AppModule(appModuleHandler.AppModule):

def chooseNVDAObjectOverlayClasses(self,obj,clsList):
if isinstance(obj,UIA) and obj.role==controlTypes.ROLE_DATAITEM and isinstance(obj.parent,UIA) and obj.parent.role==controlTypes.ROLE_LIST:
clsList.insert(0,SuggestionListItem)
1 change: 1 addition & 0 deletions user_docs/en/changes.t2t
Expand Up @@ -8,6 +8,7 @@
== New Features ==
- The existance of spelling errors is announced in editable fields for Internet Explorer and other MSHTML controls. (#4174)
- Many more unicode math symbols are now spoken when they appear in text. (#3805)
- Search suggestions in the Windows 10 start screen are automatically reported (#5049)


== Bug Fixes ==
Expand Down

0 comments on commit 6d3ef4b

Please sign in to comment.