def event_NVDAObject_init(self,obj): role=obj.role windowClassName=obj.windowClassName controlID=obj.windowControlID #The control showing plain text messages has very stuffed parents #Use the grandparent window as its parent if role==controlTypes.ROLE_EDITABLETEXT and windowClassName=="RichEdit20W" and controlID==8224: obj.parent=Window._get_parent(Window._get_parent(obj)) #The control that shows HTML messages has stuffed parents. Use the control's parent window as its parent if windowClassName=="Internet Explorer_Server" and role==controlTypes.ROLE_PANE and not isinstance(obj,MSHTML): obj.parent=Window._get_parent(Window._get_parent(obj)) if role in (controlTypes.ROLE_MENUBAR,controlTypes.ROLE_MENUITEM): obj.description=None if role in (controlTypes.ROLE_TREEVIEW,controlTypes.ROLE_TREEVIEWITEM,controlTypes.ROLE_LIST,controlTypes.ROLE_LISTITEM): obj.shouldAllowIAccessibleFocusEvent=True if ((windowClassName=="SUPERGRID" and controlID==4704) or (windowClassName=="rctrl_renwnd32" and controlID==109)) and role==controlTypes.ROLE_UNKNOWN: obj.role=controlTypes.ROLE_LISTITEM
def event_valueChange(self,obj,nextHandler): #Ignore value changes from an annoying progress bar which is a child of the main window #that keeps moving due to application performance if isinstance(obj,IAccessible) and obj.role==controlTypes.ROLE_PROGRESSBAR: windowParent=Window._get_parent(obj) if windowParent and windowParent.windowClassName=="SWT_Window0": return return nextHandler()
def event_NVDAObject_init(self,obj): role=obj.role windowClassName=obj.windowClassName controlID=obj.windowControlID #The control showing plain text messages has very stuffed parents #Use the grandparent window as its parent if role==controlTypes.Role.EDITABLETEXT and windowClassName=="RichEdit20W" and controlID==8224: obj.parent=Window._get_parent(Window._get_parent(obj)) #The control that shows HTML messages has stuffed parents. Use the control's parent window as its parent if windowClassName=="Internet Explorer_Server" and role==controlTypes.Role.PANE and not isinstance(obj,MSHTML): obj.parent=Window._get_parent(Window._get_parent(obj)) if role in (controlTypes.Role.MENUBAR,controlTypes.Role.MENUITEM): obj.description=None if role in (controlTypes.Role.TREEVIEW,controlTypes.Role.TREEVIEWITEM,controlTypes.Role.LIST,controlTypes.Role.LISTITEM): obj.shouldAllowIAccessibleFocusEvent=True if ((windowClassName=="SUPERGRID" and controlID==4704) or (windowClassName=="rctrl_renwnd32" and controlID==109)) and role==controlTypes.Role.UNKNOWN: obj.role=controlTypes.Role.LISTITEM